5 #ifndef BPP_PHYL_LEGACY_LIKELIHOOD_RHOMOGENEOUSTREELIKELIHOOD_H
6 #define BPP_PHYL_LEGACY_LIKELIHOOD_RHOMOGENEOUSTREELIKELIHOOD_H
11 #include "../../Model/SubstitutionModel.h"
73 std::shared_ptr<TransitionModelInterface> model,
74 std::shared_ptr<DiscreteDistributionInterface> rDist,
75 bool checkRooted =
true,
77 bool usePatterns =
true);
97 std::shared_ptr<TransitionModelInterface> model,
98 std::shared_ptr<DiscreteDistributionInterface> rDist,
99 bool checkRooted =
true,
101 bool usePatterns =
true);
115 void init_(
bool usePatterns);
Partial implementation for homogeneous model 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.
size_t getRootArrayPosition(size_t currentPosition) const
The phylogenetic node class.
This class implement the 'traditional' way of computing likelihood for a tree.
virtual double getD2LikelihoodForASiteForARateClass(size_t site, size_t rateClass) const
virtual double getDLikelihoodForASiteForARateClass(size_t site, size_t rateClass) const
void setParameters(const ParameterList ¶meters)
Implements the Function interface.
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.
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.
const DRASRTreeLikelihoodData & likelihoodData() const
double getLogLikelihoodForASite(size_t site) const
Get the logarithm of the likelihood for a site.
RHomogeneousTreeLikelihood & operator=(const RHomogeneousTreeLikelihood &lik)
virtual void displayLikelihood(const Node *node)
This method is mainly for debugging purpose.
virtual ~RHomogeneousTreeLikelihood()
virtual void computeSubtreeLikelihood(const Node *node)
Compute the likelihood for a subtree defined by the Tree::Node node.
double getSecondOrderDerivative(const std::string &variable) const
double getLikelihoodForASite(size_t site) const
Get 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 setData(const AlignmentDataInterface &sites)
Set the dataset for which the likelihood must be evaluated.
virtual double getD2LikelihoodForASite(size_t site) const
virtual void computeTreeDLikelihood(const std::string &variable)
virtual void computeTreeD2Likelihood(const std::string &variable)
RHomogeneousTreeLikelihood(const Tree &tree, std::shared_ptr< TransitionModelInterface > model, std::shared_ptr< DiscreteDistributionInterface > rDist, bool checkRooted=true, bool verbose=true, bool usePatterns=true)
Build a new RHomogeneousTreeLikelihood object without data.
virtual double getDLikelihoodForASite(size_t site) const
double getLikelihood() const
Get the likelihood for the whole dataset.
RHomogeneousTreeLikelihood * clone() const
double getFirstOrderDerivative(const std::string &variable) const
size_t getSiteIndex(size_t site) const
Get the index (used for inner computations) of a given site (original alignment column).
virtual double getD2LogLikelihood() const
DRASRTreeLikelihoodData & likelihoodData()
double getSecondOrderDerivative(const std::string &variable1, const std::string &variable2) const
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.
virtual double getDLogLikelihoodForASite(size_t site) const
double getLogLikelihood() const
Get the logarithm of the likelihood for the whole dataset.
void computeTreeLikelihood()
void init_(bool usePatterns)
Method called by constructors.
DRASRTreeLikelihoodData * likelihoodData_
virtual double getDLogLikelihood() const
virtual void computeDownSubtreeD2Likelihood(const Node *)
void fireParameterChanged(const ParameterList ¶ms)
virtual void computeDownSubtreeDLikelihood(const Node *)
Interface for phylogenetic tree objects.
Defines the basic types of data flow nodes.