5 #ifndef BPP_PHYL_LEGACY_LIKELIHOOD_RNONHOMOGENEOUSTREELIKELIHOOD_H
6 #define BPP_PHYL_LEGACY_LIKELIHOOD_RNONHOMOGENEOUSTREELIKELIHOOD_H
11 #include "../Model/SubstitutionModelSet.h"
74 std::shared_ptr<SubstitutionModelSet> modelSet,
75 std::shared_ptr<DiscreteDistributionInterface> rDist,
77 bool usePatterns =
true,
78 bool reparametrizeRoot =
false);
97 std::shared_ptr<SubstitutionModelSet> modelSet,
98 std::shared_ptr<DiscreteDistributionInterface> rDist,
100 bool usePatterns =
true,
101 bool reparametrizeRoot =
false);
115 void init_(
bool usePatterns);
Partial implementation for branch non-homogeneous models of the TreeLikelihood interface.
const AlignmentDataInterface & data() const
Get the dataset for which the likelihood must be evaluated.
const Tree & tree() const
Get the tree (topology and branch lengths).
discrete Rate Across Sites, (simple) Recursive likelihood data structure.
The phylogenetic node class.
This class implement the 'traditional' way of computing likelihood for a tree, allowing for non-homog...
double getFirstOrderDerivative(const std::string &variable) const
void init_(bool usePatterns)
Method called by constructors.
virtual void computeDownSubtreeD2Likelihood(const Node *)
virtual double getD2LikelihoodForASite(size_t site) const
void setParameters(const ParameterList ¶meters)
Implements the Function interface.
double getLikelihood() const
Get the likelihood for the whole dataset.
virtual void computeTreeDLikelihood(const std::string &variable)
RNonHomogeneousTreeLikelihood & operator=(const RNonHomogeneousTreeLikelihood &lik)
virtual double getD2LogLikelihood() const
double getLikelihoodForASite(size_t site) const
Get the likelihood for a site.
RNonHomogeneousTreeLikelihood(const Tree &tree, std::shared_ptr< SubstitutionModelSet > modelSet, std::shared_ptr< DiscreteDistributionInterface > rDist, bool verbose=true, bool usePatterns=true, bool reparametrizeRoot=false)
Build a new NonHomogeneousTreeLikelihood object without data.
double getLogLikelihood() const
Get the logarithm of the likelihood for the whole dataset.
void fireParameterChanged(const ParameterList ¶ms)
double getSecondOrderDerivative(const std::string &variable1, const std::string &variable2) const
virtual double getDLikelihoodForASite(size_t site) const
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.
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.
virtual ~RNonHomogeneousTreeLikelihood()
virtual double getD2LogLikelihoodForASite(size_t site) const
double getLikelihoodForASiteForARateClass(size_t site, size_t rateClass) const
Get the likelihood for a site knowing its rate class.
void setData(const AlignmentDataInterface &sites)
Set the dataset for which the likelihood must be evaluated.
virtual double getDLikelihoodForASiteForARateClass(size_t site, size_t rateClass) const
std::shared_ptr< DRASRTreeLikelihoodData > likelihoodData_
virtual double getDLogLikelihoodForASite(size_t site) const
size_t getSiteIndex(size_t site) const
Get the index (used for inner computations) of a given site (original alignment column).
virtual void displayLikelihood(const Node *node)
This method is mainly for debugging purpose.
virtual void computeDownSubtreeDLikelihood(const Node *)
virtual double getD2LikelihoodForASiteForARateClass(size_t site, size_t rateClass) const
virtual void computeTreeD2Likelihood(const std::string &variable)
double getLogLikelihoodForASite(size_t site) const
Get the logarithm of the likelihood for a site.
virtual double getDLogLikelihood() const
RNonHomogeneousTreeLikelihood * clone() const
const DRASRTreeLikelihoodData & likelihoodData() const
double getLogLikelihoodForASiteForARateClass(size_t site, size_t rateClass) const
Get the logarithm of the likelihood for a site knowing its rate class.
double getSecondOrderDerivative(const std::string &variable) const
virtual void computeSubtreeLikelihood(const Node *node)
Compute the likelihood for a subtree defined by the Tree::Node node.
virtual void computeTreeLikelihood()
DRASRTreeLikelihoodData & likelihoodData()
Interface for phylogenetic tree objects.
Defines the basic types of data flow nodes.