Package pal.eval
Class FastLikelihoodCalculator
java.lang.Object
pal.eval.FastLikelihoodCalculator
- All Implemented Interfaces:
LikelihoodCalculator
,PalObjectListener
public class FastLikelihoodCalculator
extends Object
implements PalObjectListener, LikelihoodCalculator
Title: Fast Likelihood Calculator
Description: A fast likelihood calculator
Original code by Matthew Goode. This calculates the likelihood of similar trees (or a single changing tree) on the same site pattern fast by remembering partial likelihoods of invariant subtrees. This class should be avoided if the underlying tree doesn't change (use GeneralLikelihoodCalculator). A new framework will be added one day to accomodate optimising tree topologies.
Description: A fast likelihood calculator
Original code by Matthew Goode. This calculates the likelihood of similar trees (or a single changing tree) on the same site pattern fast by remembering partial likelihoods of invariant subtrees. This class should be avoided if the underlying tree doesn't change (use GeneralLikelihoodCalculator). A new framework will be added one day to accomodate optimising tree topologies.
- Version:
- $Id: FastLikelihoodCalculator.java,v 1.11 2002/09/08 03:46:12 matt Exp $
- Author:
- Matthew Goode, Alexei Drummond
-
Nested Class Summary
Nested classes/interfaces inherited from interface pal.misc.PalObjectListener
PalObjectListener.EventGenerator
-
Constructor Summary
ConstructorsConstructorDescriptionFastLikelihoodCalculator
(SitePattern pattern) Constructor taking only site pattern.FastLikelihoodCalculator
(SitePattern pattern, Tree tree, RateMatrix model) Constructor taking site pattern, tree and model. -
Method Summary
Modifier and TypeMethodDescriptiondouble
void
Signifies that parametric valued governing the state of this Object have changed.void
release()
This method should be called when the user is through using this calculator to inform it to release any resources it has allocated.final void
setRateMatrix
(RateMatrix rateMatrix) final void
void
Signifies that the structure of the object has changed (for example in trees to topology has changed)final void
updateSitePattern
(SitePattern pattern)
-
Constructor Details
-
FastLikelihoodCalculator
Constructor taking only site pattern.
NOTE: setTree and setRateMatrix must both be called (in that order) before computeLikelihood. -
FastLikelihoodCalculator
Constructor taking site pattern, tree and model.
-
-
Method Details
-
parametersChanged
Description copied from interface:PalObjectListener
Signifies that parametric valued governing the state of this Object have changed. Parameters don't have to be visible ones For example, in trees the branch lengths have changed.- Specified by:
parametersChanged
in interfacePalObjectListener
-
structureChanged
Description copied from interface:PalObjectListener
Signifies that the structure of the object has changed (for example in trees to topology has changed)- Specified by:
structureChanged
in interfacePalObjectListener
-
setRateMatrix
-
release
public void release()Description copied from interface:LikelihoodCalculator
This method should be called when the user is through using this calculator to inform it to release any resources it has allocated.- Specified by:
release
in interfaceLikelihoodCalculator
-
setTree
-
updateSitePattern
-
calculateLogLikelihood
public double calculateLogLikelihood()- Specified by:
calculateLogLikelihood
in interfaceLikelihoodCalculator
- Returns:
- the likelihood of this tree under the given model and data.
-