40 #ifndef _DRHOMOGENEOUSTREELIKELIHOOD_H_ 41 #define _DRHOMOGENEOUSTREELIKELIHOOD_H_ 47 #include <Bpp/Numeric/VectorTools.h> 48 #include <Bpp/Numeric/Prob/DiscreteDistribution.h> 92 DiscreteDistribution* rDist,
93 bool checkRooted =
true,
113 const SiteContainer& data,
115 DiscreteDistribution* rDist,
116 bool checkRooted = true,
136 void init_() throw (Exception);
147 void setData(const SiteContainer & sites) throw (Exception);
180 void setParameters(
const ParameterList & parameters)
throw (ParameterNotFoundException, ConstraintException);
185 double getValue()
const throw (Exception);
266 const std::vector<const VVVdouble*>& iLik,
267 const std::vector<const VVVdouble*>& tProb,
268 VVVdouble& oLik,
size_t nbNodes,
269 size_t nbDistinctSites,
295 const std::vector<const VVVdouble*>& iLik,
296 const std::vector<const VVVdouble*>& tProb,
297 const VVVdouble* iLikR,
298 const VVVdouble* tProbR,
301 size_t nbDistinctSites,
311 #endif //_DRHOMOGENEOUSTREELIKELIHOOD_H_ virtual void computeTreeD2Likelihoods()
double getFirstOrderDerivative(const std::string &variable) 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.
Interface for all substitution models.
virtual void computeLikelihoodAtNode(int nodeId, VVVdouble &likelihoodArray) const
Compute the likelihood array at a given node.
double getLikelihood() const
Get the likelihood for the whole dataset.
void setParameters(const ParameterList ¶meters)
Implements the Function interface.
DRHomogeneousTreeLikelihood(const Tree &tree, SubstitutionModel *model, DiscreteDistribution *rDist, bool checkRooted=true, bool verbose=true)
Build a new DRHomogeneousTreeLikelihood object without data.
virtual void computeTreeD2LikelihoodAtNode(const Node *node)
virtual void computeSubtreeLikelihoodPostfix(const Node *node)
DRASDRTreeLikelihoodData * likelihoodData_
DRHomogeneousTreeLikelihood * clone() const
virtual void resetLikelihoodArrays(const Node *node)
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).
DRASDRTreeLikelihoodData * getLikelihoodData()
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...
void init_()
Method called by constructors.
virtual void computeRootLikelihood()
void setData(const SiteContainer &sites)
Set the dataset for which the likelihood must be evaluated.
double getValue() const
Function and NNISearchable interface.
void computeTreeLikelihood()
double getLogLikelihoodForASiteForARateClass(size_t site, size_t rateClass) const
Get the logarithm of the likelihood for a site knowing its rate class.
double getLikelihoodForASite(size_t site) const
Get the likelihood for a site.
virtual void fireParameterChanged(const ParameterList ¶ms)
This class implements the likelihood computation for a tree using the double-recursive algorithm...
double getSecondOrderDerivative(const std::string &variable) const
TreeTemplate< Node > * tree_
The phylogenetic node class.
virtual void displayLikelihood(const Node *node)
This method is mainly for debugging purpose.
double getLogLikelihoodForASite(size_t site) const
Get the logarithm of the likelihood for a site.
const DRASDRTreeLikelihoodData * getLikelihoodData() const
double getLogLikelihood() const
Get the logarithm of the likelihood for the whole dataset.
static void computeLikelihoodFromArrays(const std::vector< const VVVdouble *> &iLik, const std::vector< const VVVdouble *> &tProb, VVVdouble &oLik, size_t nbNodes, size_t nbDistinctSites, size_t nbClasses, size_t nbStates, bool reset=true)
Compute conditional likelihoods.
virtual void computeSubtreeLikelihoodPrefix(const Node *node)
Interface for double-recursive (DR) implementation of the likelihood computation. ...
Likelihood data structure for rate across sites models, using a double-recursive algorithm.
A class to compute the average of several DRHomogeneousTreeLikelihood defined from a Mixed Substituti...
virtual void computeLikelihoodAtNode_(const Node *node, VVVdouble &likelihoodArray, const Node *sonNode=0) const
virtual void computeTreeDLikelihoods()
Partial implementation for homogeneous model of the TreeLikelihood interface.
size_t getRootArrayPosition(const size_t site) const
virtual void computeTreeDLikelihoodAtNode(const Node *node)
double getLikelihoodForASiteForARateClass(size_t site, size_t rateClass) const
Get the likelihood for a site knowing its rate class.