39 #ifndef _DRHOMOGENEOUSMIXEDTREELIKELIHOOD_H_ 40 #define _DRHOMOGENEOUSMIXEDTREELIKELIHOOD_H_ 43 #include "../Model/SubstitutionModel.h" 44 #include "../Model/MixedSubstitutionModel.h" 46 #include <Bpp/Numeric/VectorTools.h> 47 #include <Bpp/Numeric/Prob/DiscreteDistribution.h> 94 DiscreteDistribution* rDist,
95 bool checkRooted =
true,
97 bool rootArray =
false)
118 const SiteContainer& data,
120 DiscreteDistribution* rDist,
121 bool checkRooted = true,
123 bool rootArray = false)
145 void setData(
const SiteContainer& sites)
throw (Exception);
217 #endif // _DRHOMOGENEOUSMIXEDTREELIKELIHOOD_H_ double getFirstOrderDerivative(const std::string &variable) const
Interface for all substitution models.
virtual void computeLikelihoodAtNode_(const Node *node, VVVdouble &likelihoodArray, const Node *sonNode=0) const
double getSecondOrderDerivative(const std::string &variable1, const std::string &variable2) const
double getLikelihoodForASite(size_t site) const
Get the likelihood for a site.
virtual void computeTreeD2LikelihoodAtNode(const Node *)
void computeTreeLikelihood()
virtual void computeSubtreeLikelihoodPostfix(const Node *node)
Compute the likelihood for a subtree defined by the Tree::Node node.
std::vector< DRHomogeneousTreeLikelihood * > treeLikelihoodsContainer_
DRHomogeneousMixedTreeLikelihood * clone() const
Interface for phylogenetic tree objects.
double getLogLikelihoodForASite(size_t site) const
Get the logarithm of the likelihood for a site.
double getLogLikelihoodForASiteForARateClass(size_t site, size_t rateClass) const
Get the logarithm of the likelihood for a site knowing its rate class.
void initialize()
Init the likelihood object.
double getSecondOrderDerivative(const std::string &variable) const
DRHomogeneousMixedTreeLikelihood(const Tree &tree, SubstitutionModel *model, DiscreteDistribution *rDist, bool checkRooted=true, bool verbose=true, bool rootArray=false)
Build a new DRHomogeneousMixedTreeLikelihood object without data.
virtual void computeTreeDLikelihoods()
virtual void computeSubtreeLikelihoodPrefix(const Node *node)
virtual void computeTreeD2Likelihoods()
double getLikelihoodForASiteForARateClass(size_t site, size_t rateClass) const
Get the likelihood for a site knowing its rate class.
This class implements the likelihood computation for a tree using the double-recursive algorithm...
double getLikelihood() const
Get the likelihood for the whole dataset.
void fireParameterChanged(const ParameterList ¶ms)
virtual void displayLikelihood(const Node *node)
This method is mainly for debugging purpose.
void resetLikelihoodArrays(const Node *node)
The phylogenetic node class.
virtual void computeRootLikelihood()
void setData(const SiteContainer &sites)
Set the dataset for which the likelihood must be evaluated.
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.
std::vector< double > probas_
A class to compute the average of several DRHomogeneousTreeLikelihood defined from a Mixed Substituti...
double getLogLikelihood() const
Get the logarithm of the likelihood for the whole dataset.
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...