Example #1
0
def winProb(p1,p2):
    norm = scipy_norm()
    cdf = norm.cdf
    deltaMu = p1.skill[0] - p2.skill[0]
    rsss = sqrt(p1.skill[1]**2 + p2.skill[1]**2)

    print cdf(deltaMu/rsss)

    plt.plot([x[1] for x in p1.skillHistory])
    plt.plot([x[1] for x in p2.skillHistory])
    plt.show()
Example #2
0
 def ProbabilityPositive(self):
     mu, sigma = self.MuSigma()
     return 1.0 - scipy_norm(loc=mu, scale=sigma).cdf(0.0)
Example #3
0
"TrueSkill(TM): A Bayesian Skill Rating System".
"""

from __future__ import print_function

__author__ = "Doug Zongker <*****@*****.**>"

import sys
if sys.hexversion < 0x02060000:
    print("requires Python 2.6 or higher")
    sys.exit(1)

from scipy.stats.distributions import norm as scipy_norm
from math import sqrt

norm = scipy_norm()
pdf = norm.pdf
cdf = norm.cdf
icdf = norm.ppf  # inverse CDF

# Update rules for approximate marginals for the win and draw cases,
# respectively.


def Vwin(t, e):
    return pdf(t - e) / cdf(t - e)


def Wwin(t, e):
    return Vwin(t, e) * (Vwin(t, e) + t - e)
Example #4
0
"""
import math
import sys
import csv

from scipy.stats.distributions import norm as scipy_norm
from collections import defaultdict
import numpy as np

beta = 25.0
gamma = 1.0 / 12
STDEVS = 3
MEAN = 25.0
epsilon = 0.5

norm = scipy_norm()


def pdf(x):
    return norm.pdf(x)


def cdf(x):
    return norm.cdf(x)


def Vwin(t, e):
    return pdf(t - e) / cdf(t - e)


def Wwin(t, e):
Example #5
0
 def ProbabilityPositive(self):
   mu, sigma = self.MuSigma()
   return 1.0 - scipy_norm(loc=mu, scale=sigma).cdf(0.0)