5 #ifndef BPP_PHYL_LEGACY_LIKELIHOOD_DRNONHOMOGENEOUSTREELIKELIHOOD_H
6 #define BPP_PHYL_LEGACY_LIKELIHOOD_DRNONHOMOGENEOUSTREELIKELIHOOD_H
57 std::shared_ptr<SubstitutionModelSet> modelSet,
58 std::shared_ptr<DiscreteDistributionInterface> rDist,
60 bool reparametrizeRoot =
false);
79 std::shared_ptr<SubstitutionModelSet> modelSet,
80 std::shared_ptr<DiscreteDistributionInterface> rDist,
82 bool reparametrizeRoot =
false);
231 const std::vector<const VVVdouble*>& iLik,
232 const std::vector<const VVVdouble*>& tProb,
234 size_t nbDistinctSites,
260 const std::vector<const VVVdouble*>& iLik,
261 const std::vector<const VVVdouble*>& tProb,
266 size_t nbDistinctSites,
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).
std::shared_ptr< TreeTemplate< Node > > tree_
Likelihood data structure for rate across sites models, using a double-recursive algorithm.
This class implements the likelihood computation for a tree using the double-recursive algorithm,...
virtual void computeSubtreeLikelihoodPostfix(const Node *node)
void resetLikelihoodArrays(const Node *node)
DRNonHomogeneousTreeLikelihood(const Tree &tree, std::shared_ptr< SubstitutionModelSet > modelSet, std::shared_ptr< DiscreteDistributionInterface > rDist, bool verbose=true, bool reparametrizeRoot=false)
Build a new DRNonHomogeneousTreeLikelihood object without data.
const DRASDRTreeLikelihoodData & likelihoodData() 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.
DRASDRTreeLikelihoodData & likelihoodData()
void setData(const AlignmentDataInterface &sites)
Set the dataset for which the likelihood must be evaluated.
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.
friend class DRNonHomogeneousMixedTreeLikelihood
virtual void computeTreeDLikelihoods()
std::unique_ptr< DRASDRTreeLikelihoodData > likelihoodData_
double getLogLikelihood() const
Get the logarithm of the likelihood for the whole dataset.
double getLikelihood() const
Get the likelihood for the whole dataset.
virtual void computeTreeDLikelihoodAtNode(const Node *node)
double getFirstOrderDerivative(const std::string &variable) const
virtual void displayLikelihood(const Node *node)
This method is mainly for debugging purpose.
size_t getSiteIndex(size_t site) const
Get the index (used for inner computations) of a given site (original alignment column).
virtual ~DRNonHomogeneousTreeLikelihood()
virtual void computeLikelihoodAtNode(int nodeId, VVVdouble &likelihoodArray) const
Compute the likelihood array at a given node.
DRNonHomogeneousTreeLikelihood & operator=(const DRNonHomogeneousTreeLikelihood &lik)
void computeTreeLikelihood()
double getLikelihoodForASiteForARateClass(size_t site, size_t rateClass) const
Get the likelihood for a site knowing its rate class.
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 fireParameterChanged(const ParameterList ¶ms)
virtual void computeRootLikelihood()
virtual void computeLikelihoodAtNode_(const Node *node, VVVdouble &likelihoodArray) const
virtual void computeTreeD2Likelihoods()
virtual void computeTreeD2LikelihoodAtNode(const Node *node)
virtual void computeSubtreeLikelihoodPrefix(const Node *node)
double getSecondOrderDerivative(const std::string &variable) const
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.
double getSecondOrderDerivative(const std::string &variable1, const std::string &variable2) const
double getLogLikelihoodForASite(size_t site) const
Get the logarithm of the likelihood for a site.
double getValue() const
Function and NNISearchable interface.
void init_()
Method called by constructors.
DRNonHomogeneousTreeLikelihood * clone() const
Interface for double-recursive (DR) implementation of the likelihood computation.
The phylogenetic node class.
Interface for phylogenetic tree objects.
Defines the basic types of data flow nodes.
std::vector< VVdouble > VVVdouble