Package pal.eval

Class GeneralLikelihoodCalculator

  • All Implemented Interfaces:
    LikelihoodCalculator, PalObjectListener

    public class GeneralLikelihoodCalculator
    extends java.lang.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.
    Version:
    $Id: GeneralLikelihoodCalculator.java,v 1.10 2004/01/12 09:30:27 matt Exp $
    Author:
    Matthew Goode
    • Constructor Detail

      • GeneralLikelihoodCalculator

        public GeneralLikelihoodCalculator​(Alignment baseAlignment,
                                           Tree tree,
                                           RateMatrix model)
        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

        public GeneralLikelihoodCalculator​(Alignment baseAlignment,
                                           Tree tree,
                                           SubstitutionModel model)
        Constructor taking site pattern, tree and a general substitution model.
    • Method Detail

      • parametersChanged

        public void parametersChanged​(PalObjectEvent pe)
        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 interface PalObjectListener
      • 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 interface LikelihoodCalculator
      • calculateLogLikelihoodSummary

        public LikelihoodSummary 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)