40 #ifndef _RHOMOGENEOUSTREELIKELIHOOD_H_ 41 #define _RHOMOGENEOUSTREELIKELIHOOD_H_ 44 #include "../Model/SubstitutionModel.h" 47 #include <Bpp/Numeric/VectorTools.h> 48 #include <Bpp/Numeric/Prob/DiscreteDistribution.h> 111 DiscreteDistribution* rDist,
112 bool checkRooted =
true,
114 bool usePatterns =
true)
134 const SiteContainer& data,
136 DiscreteDistribution* rDist,
137 bool checkRooted = true,
139 bool usePatterns = true)
155 void init_(
bool usePatterns)
throw (Exception);
166 void setData(
const SiteContainer& sites)
throw (Exception);
198 void setParameters(
const ParameterList& parameters)
throw (ParameterNotFoundException, ConstraintException);
199 double getValue()
const throw(Exception);
275 #endif //_RHOMOGENEOUSTREELIKELIHOOD_H_ virtual void computeDownSubtreeDLikelihood(const Node *)
RHomogeneousTreeLikelihood * clone() const
Interface for all substitution models.
RHomogeneousTreeLikelihood(const Tree &tree, SubstitutionModel *model, DiscreteDistribution *rDist, bool checkRooted=true, bool verbose=true, bool usePatterns=true)
Build a new RHomogeneousTreeLikelihood object without data.
double getLogLikelihoodForASite(size_t site) const
Get the logarithm of the likelihood for a site.
size_t getSiteIndex(size_t site) const
Get the index (used for inner computations) of a given site (original alignment column).
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...
size_t getRootArrayPosition(size_t currentPosition) const
DRASRTreeLikelihoodData * likelihoodData_
virtual double getD2LogLikelihoodForASite(size_t site) const
virtual void computeDownSubtreeD2Likelihood(const Node *)
virtual double getD2LikelihoodForASiteForARateClass(size_t site, size_t rateClass) const
virtual void computeTreeD2Likelihood(const std::string &variable)
DRASRTreeLikelihoodData * getLikelihoodData()
discrete Rate Across Sites, (simple) Recursive likelihood data structure.
double getLikelihood() const
Get the likelihood for the whole dataset.
virtual double getD2LogLikelihood() const
Interface for phylogenetic tree objects.
double getSecondOrderDerivative(const std::string &variable1, const std::string &variable2) const
This class implement the 'traditional' way of computing likelihood for a tree.
virtual double getDLogLikelihoodForASite(size_t site) const
const DRASRTreeLikelihoodData * getLikelihoodData() const
void fireParameterChanged(const ParameterList ¶ms)
double getLogLikelihood() const
Get the logarithm of the likelihood for the whole dataset.
virtual double getD2LikelihoodForASite(size_t site) const
The phylogenetic node class.
double getLikelihoodForASite(size_t site) const
Get the likelihood for a site.
void setParameters(const ParameterList ¶meters)
Implements the Function interface.
double getLogLikelihoodForASiteForARateClass(size_t site, size_t rateClass) const
Get the logarithm of the likelihood for a site knowing its rate class.
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 getDLikelihoodForASiteForARateClass(size_t site, size_t rateClass) const
double getSecondOrderDerivative(const std::string &variable) const
virtual double getDLikelihoodForASite(size_t site) const
double getFirstOrderDerivative(const std::string &variable) const
virtual void displayLikelihood(const Node *node)
This method is mainly for debugging purpose.
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.
void computeTreeLikelihood()
Partial implementation for homogeneous model of the TreeLikelihood interface.
void init_(bool usePatterns)
Method called by constructors.
double getLikelihoodForASiteForARateClass(size_t site, size_t rateClass) const
Get the likelihood for a site knowing its rate class.
void setData(const SiteContainer &sites)
Set the dataset for which the likelihood must be evaluated.
virtual double getDLogLikelihood() const