40 #ifndef _DRNONHOMOGENEOUSTREELIKELIHOOD_H_ 41 #define _DRNONHOMOGENEOUSTREELIKELIHOOD_H_ 47 #include <Bpp/Numeric/VectorTools.h> 48 #include <Bpp/Numeric/Prob/DiscreteDistribution.h> 94 DiscreteDistribution* rDist,
96 bool reparametrizeRoot =
false)
115 const SiteContainer& data,
117 DiscreteDistribution* rDist,
119 bool reparametrizeRoot = false)
138 void init_() throw (Exception);
149 void setData(const SiteContainer& sites) throw (Exception);
182 void setParameters(
const ParameterList& parameters)
throw (ParameterNotFoundException, ConstraintException);
187 double getValue()
const throw (Exception);
269 const std::vector<const VVVdouble*>& iLik,
270 const std::vector<const VVVdouble*>& tProb,
271 VVVdouble& oLik,
size_t nbNodes,
272 size_t nbDistinctSites,
298 const std::vector<const VVVdouble*>& iLik,
299 const std::vector<const VVVdouble*>& tProb,
300 const VVVdouble* iLikR,
301 const VVVdouble* tProbR,
304 size_t nbDistinctSites,
314 #endif //_DRNONHOMOGENEOUSTREELIKELIHOOD_H_
void setData(const SiteContainer &sites)
Set the dataset for which the likelihood must be evaluated.
Substitution models manager for non-homogeneous / non-reversible models of evolution.
double getLogLikelihoodForASite(size_t site) const
Get the logarithm of the likelihood for a site.
Partial implementation for branch non-homogeneous models of the TreeLikelihood interface.
DRNonHomogeneousTreeLikelihood(const Tree &tree, SubstitutionModelSet *modelSet, DiscreteDistribution *rDist, bool verbose=true, bool reparametrizeRoot=false)
Build a new DRNonHomogeneousTreeLikelihood object without data.
double getLogLikelihood() const
Get the logarithm of the likelihood for the whole dataset.
virtual void computeTreeD2Likelihoods()
virtual void computeTreeDLikelihoodAtNode(const Node *node)
void resetLikelihoodArrays(const Node *node)
double getLikelihoodForASiteForARateClass(size_t site, size_t rateClass) const
Get the likelihood for a site knowing its rate class.
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 phylogenetic tree objects.
virtual void computeSubtreeLikelihoodPostfix(const Node *node)
DRASDRTreeLikelihoodData * likelihoodData_
virtual void computeRootLikelihood()
DRNonHomogeneousTreeLikelihood * clone() const
void init_()
Method called by constructors.
double getValue() const
Function and NNISearchable interface.
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 fireParameterChanged(const ParameterList ¶ms)
TreeTemplate< Node > * tree_
virtual void computeLikelihoodAtNode(int nodeId, VVVdouble &likelihoodArray) const
Compute the likelihood array at a given node.
double getLogLikelihoodForASiteForARateClass(size_t site, size_t rateClass) const
Get the logarithm of the likelihood for a site knowing its rate class.
The phylogenetic node class.
friend class DRNonHomogeneousMixedTreeLikelihood
virtual void displayLikelihood(const Node *node)
This method is mainly for debugging purpose.
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.
void computeTreeLikelihood()
double getLikelihood() const
Get the likelihood for the whole dataset.
void setParameters(const ParameterList ¶meters)
Implements the Function interface.
virtual void computeSubtreeLikelihoodPrefix(const Node *node)
This class implements the likelihood computation for a tree using the double-recursive algorithm...
virtual void computeTreeDLikelihoods()
Interface for double-recursive (DR) implementation of the likelihood computation. ...
DRASDRTreeLikelihoodData * getLikelihoodData()
Likelihood data structure for rate across sites models, using a double-recursive algorithm.
virtual void computeLikelihoodAtNode_(const Node *node, VVVdouble &likelihoodArray) const
virtual void computeTreeD2LikelihoodAtNode(const Node *node)
double getLikelihoodForASite(size_t site) const
Get the likelihood for a site.
size_t getRootArrayPosition(const size_t site) const
const DRASDRTreeLikelihoodData * getLikelihoodData() const
size_t getSiteIndex(size_t site) const
Get the index (used for inner computations) of a given site (original alignment column).
double getSecondOrderDerivative(const std::string &variable) const