Exemple #1
0
    def __init__(self, counts, locPrior, alpha, dag):
        likelihoodCalc.__init__(self, counts, locPrior, alpha, dag)
        (lks, lksTot, junk) = deterministic(self.counts, locPrior, self.dag)

        self.lksTot = lksTot
        self.lksDat = {False: lks, True: powList(lks, alpha)}
        self.calc()
Exemple #2
0
    def __init__(self, counts, locPrior, alpha, dag):

        likelihoodCalc.__init__(self, counts, locPrior, alpha, dag)
        (lks, lksTot, (betas, betasFound, betasNFound)) = multiRate(self.counts, locPrior, self.dag)

        self.lksTot = lksTot

        self.betasDat = switchDat(betas, betasFound, betasNFound, alpha)
        self.likelihoodDat = {False: lks, True: powList(lks, alpha)}

        s = listAdd(lks, dag.sumUpto(lks))
        s = listDiv(s, betas)  # sumUpto with the beta contribution from [i] cancelled
        renyiLks = powList(lks, alpha)
        r = listAdd(renyiLks, dag.sumUpto(renyiLks))
        r = listDiv(r, self.betasDat[True][cOrig])
        self.uptoBetas = {False: s, True: r}  #
        self.calc()
Exemple #3
0
 def __init__(self,counts,locPrior,alpha,dag):
     likelihoodCalc.__init__(self,counts,locPrior,alpha,dag)
     (lks,lksTot,junk)=deterministic(self.counts,locPrior,self.dag)
 
     
     self.lksTot=lksTot
     self.lksDat={False:lks,True:powList(lks,alpha)}
     self.calc()
Exemple #4
0
    def __init__(self,counts,locPrior,alpha,dag):

        likelihoodCalc.__init__(self,counts,locPrior,alpha,dag)
        (lks,lksTot,(betas,betasFound,betasNFound))=multiRate(self.counts,locPrior,self.dag)

        self.lksTot=lksTot
         
        self.betasDat=switchDat(betas,betasFound,betasNFound,alpha)
        self.likelihoodDat={False: lks, True: powList(lks,alpha)}

        s= listAdd(lks,dag.sumUpto(lks))
        s=listDiv(s,betas)                  # sumUpto with the beta contribution from [i] cancelled
        renyiLks=powList(lks,alpha)
        r=listAdd(renyiLks, dag.sumUpto(renyiLks))
        r=listDiv(r,self.betasDat[True][cOrig])
        self.uptoBetas = {False: s, True: r} # 
        self.calc()
Exemple #5
0
def switchDat(orig, found, Nfound, alpha):
    r = {}
    r[False] = [orig, found, Nfound]
    r[True] = [powList(orig, alpha), powList(found, alpha), powList(Nfound, alpha)]
    return r
Exemple #6
0
def switchDat(orig,found,Nfound,alpha):
    r={}
    r[False]=[orig,found,Nfound]
    r[True]=[powList(orig,alpha),powList(found,alpha),powList(Nfound,alpha)]
    return r