41 #ifndef _RNONHOMOGENEOUSTREELIKELIHOOD_H_ 42 #define _RNONHOMOGENEOUSTREELIKELIHOOD_H_ 45 #include "../Model/SubstitutionModelSet.h" 48 #include <Bpp/Numeric/VectorTools.h> 49 #include <Bpp/Numeric/Prob/DiscreteDistribution.h> 113 DiscreteDistribution* rDist,
115 bool usePatterns =
true,
116 bool reparametrizeRoot =
false)
135 const SiteContainer& data,
137 DiscreteDistribution* rDist,
139 bool usePatterns = true,
140 bool reparametrizeRoot = false)
156 void init_(
bool usePatterns)
throw (Exception);
167 void setData(
const SiteContainer& sites)
throw (Exception);
200 void setParameters(
const ParameterList& parameters)
throw (ParameterNotFoundException, ConstraintException);
201 double getValue()
const throw(Exception);
277 #endif //_RNONHOMOGENEOUSTREELIKELIHOOD_H_ virtual void computeDownSubtreeDLikelihood(const Node *)
This class implement the 'traditional' way of computing likelihood for a tree, allowing for non-homog...
DRASRTreeLikelihoodData * getLikelihoodData()
Substitution models manager for non-homogeneous / non-reversible models of evolution.
Partial implementation for branch non-homogeneous models of the TreeLikelihood interface.
virtual void computeTreeD2Likelihood(const std::string &variable)
size_t getRootArrayPosition(size_t currentPosition) const
double getLikelihoodForASite(size_t site) const
Get the likelihood for a site.
virtual double getDLogLikelihood() const
double getFirstOrderDerivative(const std::string &variable) const
void fireParameterChanged(const ParameterList ¶ms)
discrete Rate Across Sites, (simple) Recursive likelihood data structure.
Interface for phylogenetic tree objects.
size_t getSiteIndex(size_t site) const
Get the index (used for inner computations) of a given site (original alignment column).
virtual double getD2LogLikelihood() const
virtual void computeTreeLikelihood()
double getLogLikelihoodForASite(size_t site) const
Get the logarithm of the likelihood for a site.
const DRASRTreeLikelihoodData * getLikelihoodData() const
virtual void computeDownSubtreeD2Likelihood(const Node *)
virtual double getD2LikelihoodForASiteForARateClass(size_t site, size_t rateClass) const
double getLikelihoodForASiteForARateClass(size_t site, size_t rateClass) const
Get the likelihood for a site knowing its rate class.
virtual double getD2LikelihoodForASite(size_t site) const
void setData(const SiteContainer &sites)
Set the dataset for which the likelihood must be evaluated.
RNonHomogeneousTreeLikelihood(const Tree &tree, SubstitutionModelSet *modelSet, DiscreteDistribution *rDist, bool verbose=true, bool usePatterns=true, bool reparametrizeRoot=false)
Build a new NonHomogeneousTreeLikelihood object without data.
virtual void computeTreeDLikelihood(const std::string &variable)
virtual void computeSubtreeLikelihood(const Node *node)
Compute the likelihood for a subtree defined by the Tree::Node node.
virtual double getDLikelihoodForASite(size_t site) const
DRASRTreeLikelihoodData * likelihoodData_
virtual double getDLikelihoodForASiteForARateClass(size_t site, size_t rateClass) const
virtual void displayLikelihood(const Node *node)
This method is mainly for debugging purpose.
The phylogenetic node class.
virtual double getDLogLikelihoodForASite(size_t site) const
double getSecondOrderDerivative(const std::string &variable) const
void init_(bool usePatterns)
Method called by constructors.
void setParameters(const ParameterList ¶meters)
Implements the Function interface.
double getLikelihood() const
Get the likelihood for the whole dataset.
double getLogLikelihood() const
Get the logarithm of the likelihood for the whole dataset.
virtual double getD2LogLikelihoodForASite(size_t site) const
double getLikelihoodForASiteForARateClassForAState(size_t site, size_t rateClass, int state) const
Get the likelihood for a site knowing its rate class and its ancestral state.
RNonHomogeneousTreeLikelihood * clone() const
double getLogLikelihoodForASiteForARateClass(size_t site, size_t rateClass) const
Get the logarithm of the likelihood for a site knowing its rate class.
double getLogLikelihoodForASiteForARateClassForAState(size_t site, size_t rateClass, int state) const
Get the logarithm of the likelihood for a site knowing its rate class and its ancestral state...