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()
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()
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()
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()
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
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