|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--pal.eval.SimpleLikelihoodCalculator
Only to be used by one thread. Based on the LikelihoodValue class but does not allow the use of a rate distribution.
Constructor Summary | |
SimpleLikelihoodCalculator(SitePattern pattern)
Need to use setTree(), and setModel() before using compute() if you use this constructor |
|
SimpleLikelihoodCalculator(SitePattern pattern,
Tree tree,
SubstitutionModel model)
|
Method Summary | |
double |
calculateLogLikelihood()
compute log-likelihood for current tree (fixed branch lengths and model) return log-likelihood |
protected Node |
getNextBranch(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 branch |
SitePattern |
getSitePattern()
|
Tree |
getTree()
|
void |
modelUpdated()
|
protected void |
partialsExternal(Node branch)
compute partials for external branch |
protected void |
partialsInternal(Node center)
compute partials for branch around center node (it is assumed that multiplied partials are available in the neighbor branch) |
protected void |
productPartials(Node center)
multiply partials into the neighbour of branch |
void |
setModel(SubstitutionModel m)
define model (a site pattern must have been set before calling this method) |
void |
setRateMatrix(RateMatrix m)
define model (a site pattern must have been set before calling this method) |
void |
setTree(Tree t)
define tree ,(must only be called only after a site pattern has been defined). |
void |
treeUpdated()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SimpleLikelihoodCalculator(SitePattern pattern)
public SimpleLikelihoodCalculator(SitePattern pattern, Tree tree, SubstitutionModel model)
Method Detail |
public double calculateLogLikelihood()
calculateLogLikelihood
in interface LikelihoodCalculator
public SitePattern getSitePattern()
public Tree getTree()
public void setModel(SubstitutionModel m)
m
- model of substitution (rate matrix + rate distribution)public void setRateMatrix(RateMatrix m)
m
- model of substitution (rate matrix + rate distribution)public void setTree(Tree t)
t
- treepublic final void modelUpdated()
public final void treeUpdated()
protected double[][] getPartial(Node branch)
protected Node getNextBranch(Node branch, Node center)
protected void productPartials(Node center)
protected void partialsInternal(Node center)
protected void partialsExternal(Node branch)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |