Package pal.eval
Class SimpleLikelihoodCalculator
java.lang.Object
pal.eval.SimpleLikelihoodCalculator
- All Implemented Interfaces:
LikelihoodCalculator
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleLikelihoodCalculator(SitePattern pattern) Need to use setTree(), and setModel() before using compute() if you use this constructorSimpleLikelihoodCalculator(SitePattern pattern, Tree tree, RateMatrix model) -
Method Summary
Modifier and TypeMethodDescriptiondoublecompute log-likelihood for current tree (fixed branch lengths and model) return log-likelihoodprotected NodegetNextBranch(Node branch, Node center) get next branch around a center node (center may be root, but root is never returned)protected double[][]getPartial(Node branch) get partial likelihood of a branchgetTree()final voidprotected voidpartialsExternal(Node branch) compute partials for external branchprotected voidpartialsInternal(Node center) compute partials for branch around center node (it is assumed that multiplied partials are available in the neighbor branch)protected voidproductPartials(Node center) multiply partials into the neighbour of branchvoidrelease()Doesn't do anything...voiddefine model (a site pattern must have been set before calling this method)voiddefine tree ,(must only be called only after a site pattern has been defined).final void
-
Constructor Details
-
SimpleLikelihoodCalculator
Need to use setTree(), and setModel() before using compute() if you use this constructor -
SimpleLikelihoodCalculator
-
-
Method Details
-
release
public void release()Doesn't do anything...- Specified by:
releasein interfaceLikelihoodCalculator
-
calculateLogLikelihood
public double calculateLogLikelihood()compute log-likelihood for current tree (fixed branch lengths and model) return log-likelihood- Specified by:
calculateLogLikelihoodin interfaceLikelihoodCalculator
-
getSitePattern
-
getTree
-
setRateMatrix
define model (a site pattern must have been set before calling this method)- Parameters:
m- model of substitution (rate matrix + rate distribution)
-
setTree
define tree ,(must only be called only after a site pattern has been defined).- Parameters:
t- tree
-
modelUpdated
public final void modelUpdated() -
treeUpdated
public final void treeUpdated() -
getPartial
get partial likelihood of a branch -
getNextBranch
get next branch around a center node (center may be root, but root is never returned) -
productPartials
multiply partials into the neighbour of branch -
partialsInternal
compute partials for branch around center node (it is assumed that multiplied partials are available in the neighbor branch) -
partialsExternal
compute partials for external branch
-