Package pal.eval
Class GeneralLikelihoodCalculator
java.lang.Object
pal.eval.GeneralLikelihoodCalculator
- All Implemented Interfaces:
LikelihoodCalculator,PalObjectListener
public class GeneralLikelihoodCalculator
extends Object
implements PalObjectListener, LikelihoodCalculator
Title: General Likelihood Calculator
Description: A General likelihood calculator
This calculates the likelihood of an topologically invariant tree (on an unchanging alignment) quickly by remembering partial likelihoods of invariant subtrees, and by essentially generating site patterns for each sub tree. Works with Rate Distributions and other more complex SubstitutionModels. Will optimise (as in computational time) itself when using Nucleotide based data.
Description: A General likelihood calculator
This calculates the likelihood of an topologically invariant tree (on an unchanging alignment) quickly by remembering partial likelihoods of invariant subtrees, and by essentially generating site patterns for each sub tree. Works with Rate Distributions and other more complex SubstitutionModels. Will optimise (as in computational time) itself when using Nucleotide based data.
- Version:
- $Id: GeneralLikelihoodCalculator.java,v 1.10 2004/01/12 09:30:27 matt Exp $
- Author:
- Matthew Goode
-
Nested Class Summary
Nested classes/interfaces inherited from interface pal.misc.PalObjectListener
PalObjectListener.EventGenerator -
Constructor Summary
ConstructorsConstructorDescriptionGeneralLikelihoodCalculator(Alignment baseAlignment, Tree tree, RateMatrix model) Constructor taking site pattern, tree and a rate matrix.GeneralLikelihoodCalculator(Alignment baseAlignment, Tree tree, RateMatrix model, RateDistribution distribution) Constructor taking site pattern, tree rate matrix, and a rate distributionGeneralLikelihoodCalculator(Alignment baseAlignment, Tree tree, SubstitutionModel model) Constructor taking site pattern, tree and a general substitution model. -
Method Summary
Modifier and TypeMethodDescriptiondoubleprotected static final voiddirectProduct4(double[] v1, double[] v2, double[] store) protected static final doubledotProduct4(double[] v1, double[] v2) protected static final doubledotProduct4(double[] v1, double[] v2, double[] v3) voidSignifies that parametric valued governing the state of this Object have changed.voidrelease()This method should be called when the user is through using this calculator to inform it to release any resources it has allocated.final voidsetup(Tree t, SubstitutionModel model) voidSignifies that the structure of the object has changed (for example in trees to topology has changed)protected static final doublesum4(double[] v)
-
Constructor Details
-
GeneralLikelihoodCalculator
Constructor taking site pattern, tree and a rate matrix. -
GeneralLikelihoodCalculator
public GeneralLikelihoodCalculator(Alignment baseAlignment, Tree tree, RateMatrix model, RateDistribution distribution) Constructor taking site pattern, tree rate matrix, and a rate distribution -
GeneralLikelihoodCalculator
Constructor taking site pattern, tree and a general substitution model.
-
-
Method Details
-
parametersChanged
Description copied from interface:PalObjectListenerSignifies 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:
parametersChangedin interfacePalObjectListener
-
structureChanged
Description copied from interface:PalObjectListenerSignifies that the structure of the object has changed (for example in trees to topology has changed)- Specified by:
structureChangedin interfacePalObjectListener
-
setup
-
release
public void release()Description copied from interface:LikelihoodCalculatorThis method should be called when the user is through using this calculator to inform it to release any resources it has allocated.- Specified by:
releasein interfaceLikelihoodCalculator
-
calculateLogLikelihood
public double calculateLogLikelihood()- Specified by:
calculateLogLikelihoodin interfaceLikelihoodCalculator- Returns:
- the likelihood of this tree under the given model and data.
-
calculateLogLikelihoodSummary
- Returns:
- the LikelihoodSummary of this tree under the given model and data.
-
dotProduct4
protected static final double dotProduct4(double[] v1, double[] v2) -
dotProduct4
protected static final double dotProduct4(double[] v1, double[] v2, double[] v3) -
directProduct4
protected static final void directProduct4(double[] v1, double[] v2, double[] store) -
sum4
protected static final double sum4(double[] v)
-