def __init__(self): self.scale = ReadScale() scores = ReadRanks() score_pmf = thinkbayes.MakePmfFromDict(dict(scores)) self.raw = self.ReverseScale(score_pmf) self.max_score = max(self.raw.Values()) self.prior = DivideValues(self.raw, denom=self.max_score)
def makeOneCauseMI(p=0.5, q=0.5): px=prob.MakePmfFromDict({"H":p, "L":1.0-p}) joint = prob.Joint() for v1, p1 in px.Items(): if v1 =="H": joint.Set((v1, "H"), p1*q) joint.Set((v1, "L"), p1*q) else: joint.Set((v1, "H"), 0.0) joint.Set((v1, "L"), p1*1.0) py=joint.Marginal(1) return px, py, joint
def __init__(self): self.scale = ReadScale() scores = ReadRanks() score_pmf = thinkbayes.MakePmfFromDict(dict(scores)) self.raw = self.ReverseScale(score_pmf) self.max_score = max(self.raw.Values()) self.prior = DivideValues(self.raw, denom=self.max_score) center = -0.05 width = 1.8 self.difficulties = MakeDifficulties(center, width, self.max_score)