bpp-phyl  2.1.0
bpp::RNonHomogeneousMixedTreeLikelihood Class Reference

#include <Bpp/Phyl/Likelihood/RNonHomogeneousMixedTreeLikelihood.h>

+ Inheritance diagram for bpp::RNonHomogeneousMixedTreeLikelihood:
+ Collaboration diagram for bpp::RNonHomogeneousMixedTreeLikelihood:

List of all members.

Public Member Functions

 RNonHomogeneousMixedTreeLikelihood (const Tree &tree, MixedSubstitutionModelSet *modelSet, DiscreteDistribution *rDist, bool verbose=true, bool usePatterns=true) throw (Exception)
 Build a new RNonHomogeneousMixeTreeLikelihood object without data.
 RNonHomogeneousMixedTreeLikelihood (const Tree &tree, const SiteContainer &data, MixedSubstitutionModelSet *modelSet, DiscreteDistribution *rDist, bool verbose=true, bool usePatterns=true) throw (Exception)
 Build a new RNonHomogeneousMixedTreeLikelihood object and compute the corresponding likelihood.
 RNonHomogeneousMixedTreeLikelihood (const RNonHomogeneousMixedTreeLikelihood &lik)
RNonHomogeneousMixedTreeLikelihoodoperator= (const RNonHomogeneousMixedTreeLikelihood &lik)
virtual ~RNonHomogeneousMixedTreeLikelihood ()
RNonHomogeneousMixedTreeLikelihoodclone () const
void setParameters (const ParameterList &parameters) throw (ParameterNotFoundException, ConstraintException)
 Implements the Function interface.
double getValue () const throw (Exception)
DRASRTreeLikelihoodDatagetLikelihoodData ()
const DRASRTreeLikelihoodDatagetLikelihoodData () const
virtual void computeTreeLikelihood ()
virtual double getDLikelihoodForASiteForARateClass (size_t site, size_t rateClass) const
virtual double getDLikelihoodForASite (size_t site) const
virtual double getDLogLikelihoodForASite (size_t site) const
virtual double getDLogLikelihood () const
virtual double getD2LikelihoodForASiteForARateClass (size_t site, size_t rateClass) const
virtual double getD2LikelihoodForASite (size_t site) const
virtual double getD2LogLikelihoodForASite (size_t site) const
virtual double getD2LogLikelihood () const
virtual void initParameters ()
 This builds the parameters list from all parametrizable objects, i.e. substitution model, rate distribution and tree.
virtual void applyParameters () throw (Exception)
 All parameters are stored in a parameter list. This function apply these parameters to the substitution model, to the rate distribution and to the branch lengths.
virtual void initBranchLengthsParameters ()
virtual void setMinimumBranchLength (double minimum) throw (Exception)
virtual void setMaximumBranchLength (double maximum) throw (Exception)
virtual double getMinimumBranchLength () const
virtual double getMaximumBranchLength () const
const SubstitutionModelgetSubstitutionModel (int nodeId, size_t siteIndex) const throw (NodeNotFoundException)
 Get the substitution model associated to a given node and alignment column.
SubstitutionModelgetSubstitutionModel (int nodeId, size_t siteIndex) throw (NodeNotFoundException)
 Get the substitution model associated to a given node and alignment column.
virtual const SiteContainergetData () const =0
 Get the dataset for which the likelihood must be evaluated.
virtual bool isInitialized () const =0
virtual double getLikelihoodForASiteForAState (size_t site, int state) const =0
 Get the likelihood for a site and for a state.
virtual double getLogLikelihoodForASiteForAState (size_t site, int state) const =0
 Get the logarithm of the likelihood for a site and for a state.
virtual Vdouble getLikelihoodForEachSite () const =0
 Get the likelihood for each site.
virtual Vdouble getLogLikelihoodForEachSite () const =0
 Get the logarithm of the likelihood for each site.
virtual VVdouble getLikelihoodForEachSiteForEachState () const =0
 Get the likelihood for each site and for each state.
virtual VVdouble getLogLikelihoodForEachSiteForEachState () const =0
 Get the logarithm of the likelihood for each site and for each state.
virtual const TreegetTree () const =0
 Get the tree (topology and branch lengths).
virtual size_t getNumberOfSites () const =0
 Get the number of sites in the dataset.
virtual size_t getNumberOfStates () const =0
 Get the number of states in the alphabet associated to the dataset.
virtual const AlphabetgetAlphabet () const =0
 Get the alphabet associated to the dataset.
virtual void enableDerivatives (bool yn)=0
 Tell if derivatives must be computed.
virtual ParameterList getDerivableParameters () const =0
 All derivable parameters.
virtual ParameterList getNonDerivableParameters () const =0
 All non derivable parameters.
virtual void enableSecondOrderDerivatives (bool yn)=0
virtual bool enableSecondOrderDerivatives () const =0
virtual double d2f (const std::string &variable, const ParameterList &parameters)
virtual double d2f (const std::string &variable1, const std::string &variable2, const ParameterList &parameters)
virtual void enableFirstOrderDerivatives (bool yn)=0
virtual bool enableFirstOrderDerivatives () const =0
virtual double df (const std::string &variable, const ParameterList &parameters)
virtual double f (const ParameterList &parameters)
virtual bool hasParameter (const std::string &name) const =0
bool hasParameter (const std::string &name) const
virtual const ParameterListgetParameters () const =0
const ParameterListgetParameters () const
virtual const ParametergetParameter (const std::string &name) const =0
const ParametergetParameter (const std::string &name) const
virtual double getParameterValue (const std::string &name) const =0
double getParameterValue (const std::string &name) const
virtual void setAllParametersValues (const ParameterList &parameters)=0
void setAllParametersValues (const ParameterList &parameters)
virtual void setParameterValue (const std::string &name, double value)=0
void setParameterValue (const std::string &name, double value)
virtual void setParametersValues (const ParameterList &parameters)=0
void setParametersValues (const ParameterList &parameters)
virtual bool matchParametersValues (const ParameterList &parameters)=0
bool matchParametersValues (const ParameterList &parameters)
virtual size_t getNumberOfParameters () const =0
size_t getNumberOfParameters () const
virtual void setNamespace (const std::string &prefix)=0
void setNamespace (const std::string &prefix)
virtual std::string getNamespace () const =0
std::string getNamespace () const
virtual std::string getParameterNameWithoutNamespace (const std::string &name) const =0
std::string getParameterNameWithoutNamespace (const std::string &name) const
The TreeLikelihood interface.

Other methods are implemented in the AbstractHomogeneousTreeLikelihood class.

double getLikelihood () const
 Get the likelihood for the whole dataset.
double getLogLikelihood () const
 Get the logarithm of the likelihood for the whole dataset.
double getLikelihoodForASite (size_t site) const
 Get the likelihood for a site.
double getLogLikelihoodForASite (size_t site) const
 Get the logarithm of the likelihood for a site.
size_t getSiteIndex (size_t site) const throw (IndexOutOfBoundsException)
 Get the index (used for inner computations) of a given site (original alignment column).
The DiscreteRatesAcrossSites interface implementation:
double getLikelihoodForASiteForARateClass (size_t site, size_t rateClass) const
 Get the likelihood for a site knowing its rate class.
double getLogLikelihoodForASiteForARateClass (size_t site, size_t rateClass) const
 Get the logarithm of the likelihood for a site knowing its rate class.
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.
DerivableFirstOrder interface.
double getFirstOrderDerivative (const std::string &variable) const throw (Exception)
DerivableSecondOrder interface.
double getSecondOrderDerivative (const std::string &variable) const throw (Exception)
double getSecondOrderDerivative (const std::string &variable1, const std::string &variable2) const throw (Exception)
The TreeLikelihood interface.

Other methods are implemented in the AbstractTreeLikelihood class.

ParameterList getBranchLengthsParameters () const
 Get the branch lengths parameters.
ParameterList getSubstitutionModelParameters () const
 Get the parameters associated to substitution model(s).
ParameterList getRateDistributionParameters () const
 Get the parameters associated to the rate distirbution.
const SubstitutionModelgetSubstitutionModelForNode (int nodeId) const throw (NodeNotFoundException)
 Get the substitution model associated to a given node.
SubstitutionModelgetSubstitutionModelForNode (int nodeId) throw (NodeNotFoundException)
 Get the substitution model associated to a given node.
const std::vector< double > & getRootFrequencies (size_t siteIndex) const
 Get the values of the frequencies for each state in the alphabet at the root node.
VVVdouble getTransitionProbabilitiesPerRateClass (int nodeId, size_t siteIndex) const
 Retrieves all Pij(t) for a particular branch, defined by the upper node.
ConstBranchModelIteratorgetNewBranchModelIterator (int nodeId) const
ConstSiteModelIteratorgetNewSiteModelIterator (size_t siteIndex) const
The NonHomogeneousTreeLikelihood interface.

Other methods are implemented in the AbstractTreeLikelihood class.

const SubstitutionModelSetgetSubstitutionModelSet () const
SubstitutionModelSetgetSubstitutionModelSet ()
void setSubstitutionModelSet (SubstitutionModelSet *modelSet) throw (Exception)
ParameterList getRootFrequenciesParameters () const
The TreeLikelihood interface.
const SiteContainergetData () const
 Get the dataset for which the likelihood must be evaluated.
bool isInitialized () const
Vdouble getLikelihoodForEachSite () const
 Get the likelihood for each site.
Vdouble getLogLikelihoodForEachSite () const
 Get the logarithm of the likelihood for each site.
VVdouble getLikelihoodForEachSiteForEachState () const
 Get the likelihood for each site and for each state.
VVdouble getLogLikelihoodForEachSiteForEachState () const
 Get the logarithm of the likelihood for each site and for each state.
const TreegetTree () const
 Get the tree (topology and branch lengths).
size_t getNumberOfSites () const
 Get the number of sites in the dataset.
size_t getNumberOfStates () const
 Get the number of states in the alphabet associated to the dataset.
const AlphabetgetAlphabet () const
 Get the alphabet associated to the dataset.
void enableDerivatives (bool yn)
 Tell if derivatives must be computed.
void enableSecondOrderDerivatives (bool yn)
bool enableSecondOrderDerivatives () const
void enableFirstOrderDerivatives (bool yn)
bool enableFirstOrderDerivatives () const
The TreeLikelihood interface.

Other methods are implemented in the AbstractTreeLikelihood class.

double getLikelihoodForASiteForAState (size_t site, int state) const
 Get the likelihood for a site and for a state.
double getLogLikelihoodForASiteForAState (size_t site, int state) const
 Get the logarithm of the likelihood for a site and for a state.
VVdouble getTransitionProbabilities (int nodeId, size_t siteIndex) const
 Retrieves all Pij(t) for a particular branch, defined by the upper node and site.
ParameterList getDerivableParameters () const
 All derivable parameters.
ParameterList getNonDerivableParameters () const
 All non derivable parameters.
Retrieve some particular parameters subsets.
virtual VVdouble getTransitionProbabilities (int nodeId, size_t siteIndex) const =0
 Retrieves all Pij(t) for a particular branch, defined by the upper node and site.
The DiscreteRatesAcrossSites interface implementation:
const DiscreteDistributiongetRateDistribution () const
 Get the rate distribution used for the computation.
DiscreteDistributiongetRateDistribution ()
 Get the rate distribution used for the computation.
size_t getNumberOfClasses () const
 Get the number of classes.
VVdouble getLikelihoodForEachSiteForEachRateClass () const
 Get the likelihood for each site and each rate class.
VVdouble getLogLikelihoodForEachSiteForEachRateClass () const
 Get the logarithm of the likelihood for each site and each rate class.
VVVdouble getLikelihoodForEachSiteForEachRateClassForEachState () const
 Get the likelihood for each site and each rate class and each state.
VVVdouble getLogLikelihoodForEachSiteForEachRateClassForEachState () const
 Get the logarithm of the likelihood for each site and each rate class and each state.
VVdouble getPosteriorProbabilitiesOfEachRate () const
 Get the posterior probability for each site of belonging to a particular rate class.
Vdouble getRateWithMaxPostProbOfEachSite () const
 Get the posterior rate (the one with maximum posterior probability) for each site.
std::vector< size_t > getRateClassWithMaxPostProbOfEachSite () const
 Get the posterior rate class (the one with maximum posterior probability) for each site.
Vdouble getPosteriorRateOfEachSite () const
 Get the posterior rate, i.e. averaged over all classes and weighted with posterior probabilities, for each site.

Static Public Member Functions

Generic tools to deal with likelihood arrays
static void resetLikelihoodArray (VVVdouble &likelihoodArray)
 Set all conditional likelihoods to 1.
static void displayLikelihoodArray (const VVVdouble &likelihoodArray)
 Print the likelihood array to terminal (debugging tool).

Protected Member Functions

virtual void displayLikelihood (const Node *node)
 This method is mainly for debugging purpose.
virtual void computeAllTransitionProbabilities ()
 Fill the pxy_, dpxy_ and d2pxy_ arrays for all nodes.
void addParameter_ (Parameter *parameter)
void addParameters_ (const ParameterList &parameters)
void deleteParameter_ (size_t index)
void deleteParameter_ (std::string &name)
void deleteParameters_ (const std::vector< std::string > &names)
void resetParameters_ ()
ParametergetParameter_ (const std::string &name)
ParametergetParameter_ (size_t index)
const ParametergetParameter_ (size_t index) const
ParametergetParameterWithNamespace_ (const std::string &name)
const ParametergetParameterWithNamespace_ (const std::string &name) const
ParameterListgetParameters_ ()

Protected Attributes

SubstitutionModelSetmodelSet_
ParameterList brLenParameters_
std::map< int, VVVdoublepxy_
std::map< int, VVVdoubledpxy_
std::map< int, VVVdoubled2pxy_
std::vector< double > rootFreqs_
std::vector< Node * > nodes_
 Pointer toward all nodes in the tree.
std::map< int, const Node * > idToNode_
 An index linking nodes to their id, for faster access than the getNode() method.
size_t nbSites_
size_t nbDistinctSites_
size_t nbClasses_
size_t nbStates_
size_t nbNodes_
bool verbose_
double minimumBrLen_
double maximumBrLen_
std::auto_ptr< ConstraintbrLenConstraint_
bool reparametrizeRoot_
int root1_
int root2_
DiscreteDistributionrateDistribution_
const SiteContainerdata_
TreeTemplate< Node > * tree_
bool computeFirstOrderDerivatives_
bool computeSecondOrderDerivatives_
bool initialized_

Private Member Functions

 RNonHomogeneousMixedTreeLikelihood (const Tree &tree, MixedSubstitutionModelSet *modelSet, const MixedSubstitutionModelSet::HyperNode &hyperNode, int upperNode, DiscreteDistribution *rDist, bool verbose, bool usePatterns)
 Build a new RNonHomogeneousMixeTreeLikelihood object without data.
 RNonHomogeneousMixedTreeLikelihood (const Tree &tree, const SiteContainer &data, MixedSubstitutionModelSet *modelSet, const MixedSubstitutionModelSet::HyperNode &hyperNode, int upperNode, DiscreteDistribution *rDist, bool verbose, bool usePatterns)
 Build a new RNonHomogeneousMixeTreeLikelihood object with data.
void init (bool usePatterns)

Private Attributes

map< int, vector
< RNonHomogeneousMixedTreeLikelihood * > > 
mvTreeLikelihoods_
 the map of the branch numbers to the vectors of the TreeLikelihoods for the expanded model on this branch.
MixedSubstitutionModelSet::HyperNode hyperNode_
 A specific HyperNode in which the computation is processed. If the probability of this HyperNode is -1, it means that it should not be used, and the HyperNodes are all in the MixedSubstitutionModelSet object.
int upperNode_
 the number of the node under which tree the Treelikelihood is computed.
bool main_
 a flag to say if this object is the head of the hierarchy

Friends

class RNonHomogeneousMixedTreeLikelihood

The TreeLikelihood interface.

Other methods are implemented in the AbstractHomogeneousTreeLikelihood class.

void setData (const SiteContainer &sites) throw (Exception)
 Set the dataset for which the likelihood must be evaluated.
void initialize () throw (Exception)
 Init the likelihood object.
void computeTreeDLikelihood (const string &variable)
void computeTreeD2Likelihood (const string &variable)
double getProbability () const
 returns the probability of this object in the hierarchy
void setProbability (double x)
 sets the probability of this object in the hierarchy
const
MixedSubstitutionModelSet::HyperNode
getHyperNode ()
 returns the HyperNode describing the owned submodels.
virtual void computeSubtreeLikelihood (const Node *node)
 Compute the likelihood for a subtree defined by the Tree::Node node.
virtual void computeDownSubtreeDLikelihood (const Node *)
virtual void computeDownSubtreeD2Likelihood (const Node *)
void fireParameterChanged (const ParameterList &params)
void computeTransitionProbabilitiesForNode (const Node *node)
 Fill the pxy_, dpxy_ and d2pxy_ arrays for one node.

Detailed Description

@ brief A class to compute the average of several RNonHomogeneousTreeLikelihood defined from a Mixed Substitution Model.

This class is made recursively. At each node, we test if an expansion of a mixed model is necessary. This is the case when this model points towards different subtrees under this node, or towards a son of this node and a branch under it. If an expansion is necessary, a vector of RNonHomogeneousMixedLikelihood* is built with all the submodels combinations.

Note that this approach is not the most efficient, since a graph based one would avoid some computations, but it seems much more difficult to do it in the extant hierarchy.

Definition at line 69 of file RNonHomogeneousMixedTreeLikelihood.h.


Constructor & Destructor Documentation

RNonHomogeneousMixedTreeLikelihood::RNonHomogeneousMixedTreeLikelihood ( const Tree tree,
MixedSubstitutionModelSet modelSet,
const MixedSubstitutionModelSet::HyperNode hyperNode,
int  upperNode,
DiscreteDistribution rDist,
bool  verbose,
bool  usePatterns 
) [private]

Build a new RNonHomogeneousMixeTreeLikelihood object without data.

This constructor only initialize the parameters. To compute a likelihood, you will need to call the setData() and the computeTreeLikelihood() methods.

Parameters:
treeThe tree to use.
modelSetThe set of substitution models to use.
hyperNodean hypernode of the numbers of the submodels used in the mixed models.
upperNodethe number of the node under which the treelikelihood is computed.
rDistThe rate across sites distribution to use. If true, any rooted tree will be unrooted before likelihood computation.
verboseShould I display some info?
usePatternsTell if recursive site compression should be performed.
Exceptions:
Exceptionin an error occured.

Definition at line 103 of file RNonHomogeneousMixedTreeLikelihood.cpp.

References init(), and bpp::SubstitutionModelSet::isFullySetUpFor().

Referenced by init(), operator=(), and RNonHomogeneousMixedTreeLikelihood().

RNonHomogeneousMixedTreeLikelihood::RNonHomogeneousMixedTreeLikelihood ( const Tree tree,
const SiteContainer data,
MixedSubstitutionModelSet modelSet,
const MixedSubstitutionModelSet::HyperNode hyperNode,
int  upperNode,
DiscreteDistribution rDist,
bool  verbose,
bool  usePatterns 
) [private]

Build a new RNonHomogeneousMixeTreeLikelihood object with data.

This constructor only initialize the parameters. To compute a likelihood, you will need to call the setData() and the computeTreeLikelihood() methods.

Parameters:
treeThe tree to use.
dataSequences to use.
modelSetThe set of substitution models to use.
hyperNodean hypernode of the numbers of the submodels used in the mixed models.
upperNodethe number of the node under which the treelikelihood is computed.
rDistThe rate across sites distribution to use. If true, any rooted tree will be unrooted before likelihood computation.
verboseShould I display some info?
usePatternsTell if recursive site compression should be performed.
Exceptions:
Exceptionin an error occured.

Definition at line 124 of file RNonHomogeneousMixedTreeLikelihood.cpp.

References init(), and bpp::SubstitutionModelSet::isFullySetUpFor().

RNonHomogeneousMixedTreeLikelihood::RNonHomogeneousMixedTreeLikelihood ( const Tree tree,
MixedSubstitutionModelSet modelSet,
DiscreteDistribution rDist,
bool  verbose = true,
bool  usePatterns = true 
) throw (Exception)

Build a new RNonHomogeneousMixeTreeLikelihood object without data.

This constructor only initialize the parameters. To compute a likelihood, you will need to call the setData() and the computeTreeLikelihood() methods.

Parameters:
treeThe tree to use.
modelSetThe set of substitution models to use.
rDistThe rate across sites distribution to use. If true, any rooted tree will be unrooted before likelihood computation.
verboseShould I display some info?
usePatternsTell if recursive site compression should be performed.
Exceptions:
Exceptionin an error occured.

Definition at line 58 of file RNonHomogeneousMixedTreeLikelihood.cpp.

RNonHomogeneousMixedTreeLikelihood::RNonHomogeneousMixedTreeLikelihood ( const Tree tree,
const SiteContainer data,
MixedSubstitutionModelSet modelSet,
DiscreteDistribution rDist,
bool  verbose = true,
bool  usePatterns = true 
) throw (Exception)

Build a new RNonHomogeneousMixedTreeLikelihood object and compute the corresponding likelihood.

This constructor initializes all parameters, data, and likelihood arrays.

Parameters:
treeThe tree to use.
dataSequences to use.
modelSetThe set of substitution models to use.
rDistThe rate across sites distribution to use.
verboseShould I display some info?
usePatternsTell if recursive site compression should be performed.
Exceptions:
Exceptionin an error occured.

Definition at line 81 of file RNonHomogeneousMixedTreeLikelihood.cpp.


Member Function Documentation

void RNonHomogeneousTreeLikelihood::displayLikelihood ( const Node node) [protected, virtual, inherited]

This method is mainly for debugging purpose.

Parameters:
nodeThe node at which likelihood values must be displayed.

Definition at line 1359 of file RNonHomogeneousTreeLikelihood.cpp.

References bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood::displayLikelihoodArray(), bpp::Node::getId(), bpp::DRASRTreeLikelihoodData::getLikelihoodArray(), bpp::Node::getName(), and bpp::RNonHomogeneousTreeLikelihood::likelihoodData_.

void bpp::AbstractTreeLikelihood::enableDerivatives ( bool  yn) [inline, virtual, inherited]

Tell if derivatives must be computed.

This methods calls the enableFirstOrderDerivatives and enableSecondOrderDerivatives.

Parameters:
ynYes or no.

Implements bpp::TreeLikelihood.

Definition at line 293 of file AbstractTreeLikelihood.h.

References bpp::AbstractTreeLikelihood::computeFirstOrderDerivatives_, and bpp::AbstractTreeLikelihood::computeSecondOrderDerivatives_.

Referenced by bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood::AbstractDiscreteRatesAcrossSitesTreeLikelihood(), and bpp::DistanceEstimation::computeMatrix().

virtual void bpp::TreeLikelihood::enableDerivatives ( bool  yn) [pure virtual, inherited]

Tell if derivatives must be computed.

This methods calls the enableFirstOrderDerivatives and enableSecondOrderDerivatives.

Parameters:
ynYes or no.

Implemented in bpp::AbstractTreeLikelihood.

void RNonHomogeneousMixedTreeLikelihood::fireParameterChanged ( const ParameterList params) [protected, virtual]

Reimplemented from bpp::RNonHomogeneousTreeLikelihood.

Definition at line 337 of file RNonHomogeneousMixedTreeLikelihood.cpp.

References bpp::AbstractNonHomogeneousTreeLikelihood::applyParameters(), bpp::AbstractNonHomogeneousTreeLikelihood::brLenParameters_, bpp::AbstractNonHomogeneousTreeLikelihood::computeAllTransitionProbabilities(), computeTransitionProbabilitiesForNode(), bpp::RNonHomogeneousTreeLikelihood::computeTreeLikelihood(), bpp::ParameterList::getCommonParametersWith(), bpp::DiscreteDistribution::getIndependentParameters(), bpp::RNonHomogeneousTreeLikelihood::getLogLikelihood(), bpp::SubstitutionModelSet::getNodeParameters(), bpp::SubstitutionModelSet::getNodesWithParameter(), bpp::AbstractParametrizable::getParameter(), bpp::ParameterList::getParameterNames(), bpp::SubstitutionModelSet::getRootFrequencies(), bpp::TreeTemplate< N >::getRootNode(), bpp::Node::getSon(), bpp::Parameter::getValue(), bpp::AbstractNonHomogeneousTreeLikelihood::idToNode_, main_, bpp::AbstractParametrizable::matchParametersValues(), bpp::RNonHomogeneousTreeLikelihood::minusLogLik_, bpp::AbstractNonHomogeneousTreeLikelihood::modelSet_, mvTreeLikelihoods_, bpp::AbstractNonHomogeneousTreeLikelihood::nbNodes_, bpp::AbstractNonHomogeneousTreeLikelihood::nodes_, bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood::rateDistribution_, bpp::AbstractNonHomogeneousTreeLikelihood::reparametrizeRoot_, bpp::AbstractNonHomogeneousTreeLikelihood::root1_, bpp::AbstractNonHomogeneousTreeLikelihood::root2_, bpp::AbstractNonHomogeneousTreeLikelihood::rootFreqs_, setProbability(), bpp::TextTools::toString(), bpp::AbstractTreeLikelihood::tree_, upperNode_, and bpp::VectorTools::vectorUnion().

const Alphabet* bpp::AbstractTreeLikelihood::getAlphabet ( ) const [inline, virtual, inherited]

Get the alphabet associated to the dataset.

Returns:
the alphabet associated to the dataset.

Implements bpp::TreeLikelihood.

Definition at line 285 of file AbstractTreeLikelihood.h.

References bpp::AbstractTreeLikelihood::data_, and bpp::SiteContainer::getAlphabet().

virtual const Alphabet* bpp::TreeLikelihood::getAlphabet ( ) const [pure virtual, inherited]

Get the alphabet associated to the dataset.

Returns:
the alphabet associated to the dataset.

Implemented in bpp::AbstractTreeLikelihood.

virtual const SiteContainer* bpp::TreeLikelihood::getData ( ) const [pure virtual, inherited]

Get the dataset for which the likelihood must be evaluated.

Returns:
A pointer toward the site container where the sequences are stored.

Implemented in bpp::AbstractTreeLikelihood.

const SiteContainer* bpp::AbstractTreeLikelihood::getData ( ) const [inline, virtual, inherited]

Get the dataset for which the likelihood must be evaluated.

Returns:
A pointer toward the site container where the sequences are stored.

Implements bpp::TreeLikelihood.

Definition at line 284 of file AbstractTreeLikelihood.h.

References bpp::AbstractTreeLikelihood::data_.

Referenced by init().

All derivable parameters.

Usually, this contains all branch lengths parameters.

Returns:
A ParameterList.

Implements bpp::TreeLikelihood.

Reimplemented in bpp::RHomogeneousClockTreeLikelihood.

Definition at line 73 of file AbstractDiscreteRatesAcrossSitesTreeLikelihood.cpp.

virtual ParameterList bpp::TreeLikelihood::getDerivableParameters ( ) const [pure virtual, inherited]

All derivable parameters.

Usually, this contains all branch lengths parameters.

Returns:
A ParameterList.

Implemented in bpp::RHomogeneousClockTreeLikelihood, and bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood.

double RNonHomogeneousTreeLikelihood::getFirstOrderDerivative ( const std::string &  variable) const throw (Exception) [virtual, inherited]

Implements bpp::DerivableSecondOrder.

Definition at line 376 of file RNonHomogeneousTreeLikelihood.cpp.

returns the HyperNode describing the owned submodels.

Definition at line 271 of file RNonHomogeneousMixedTreeLikelihood.h.

double RNonHomogeneousTreeLikelihood::getLikelihood ( ) const [virtual, inherited]

Get the likelihood for the whole dataset.

Returns:
The likelihood of the dataset.

Implements bpp::TreeLikelihood.

Definition at line 158 of file RNonHomogeneousTreeLikelihood.cpp.

References bpp::RNonHomogeneousTreeLikelihood::getLikelihoodForASite(), and bpp::AbstractNonHomogeneousTreeLikelihood::nbSites_.

Returns:
The underlying likelihood data structure.

Implements bpp::TreeLikelihood.

Definition at line 222 of file RNonHomogeneousTreeLikelihood.h.

References bpp::RNonHomogeneousTreeLikelihood::likelihoodData_.

Returns:
The underlying likelihood data structure.

Implements bpp::TreeLikelihood.

Definition at line 223 of file RNonHomogeneousTreeLikelihood.h.

References bpp::RNonHomogeneousTreeLikelihood::likelihoodData_.

double RNonHomogeneousTreeLikelihood::getLikelihoodForASiteForARateClassForAState ( size_t  site,
size_t  rateClass,
int  state 
) const [virtual, inherited]

Get the likelihood for a site knowing its rate class and its ancestral state.

Parameters:
siteThe site index.
rateClassThe rate class index.
stateThe ancestral state.
Returns:
The likelihood for the specified site and rate class and ancestral state.

Implements bpp::DiscreteRatesAcrossSitesTreeLikelihood.

Definition at line 240 of file RNonHomogeneousTreeLikelihood.cpp.

References bpp::Node::getId(), bpp::DRASRTreeLikelihoodData::getLikelihoodArray(), bpp::DRASRTreeLikelihoodData::getRootArrayPosition(), bpp::TreeTemplate< N >::getRootNode(), bpp::RNonHomogeneousTreeLikelihood::likelihoodData_, and bpp::AbstractTreeLikelihood::tree_.

double AbstractDiscreteRatesAcrossSitesTreeLikelihood::getLikelihoodForASiteForAState ( size_t  site,
int  state 
) const [virtual, inherited]

Get the likelihood for a site and for a state.

Parameters:
siteThe site index to analyse.
stateThe state to consider.
Returns:
The likelihood for site site and state state.

Implements bpp::TreeLikelihood.

Definition at line 111 of file AbstractDiscreteRatesAcrossSitesTreeLikelihood.cpp.

virtual double bpp::TreeLikelihood::getLikelihoodForASiteForAState ( size_t  site,
int  state 
) const [pure virtual, inherited]

Get the likelihood for a site and for a state.

Parameters:
siteThe site index to analyse.
stateThe state to consider.
Returns:
The likelihood for site site and state state.

Implemented in bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood.

Referenced by bpp::AbstractTreeLikelihood::getLikelihoodForEachSiteForEachState().

virtual Vdouble bpp::TreeLikelihood::getLikelihoodForEachSite ( ) const [pure virtual, inherited]

Get the likelihood for each site.

Returns:
A vector with all likelihoods for each site.

Implemented in bpp::AbstractTreeLikelihood.

Get the likelihood for each site.

Returns:
A vector with all likelihoods for each site.

Implements bpp::TreeLikelihood.

Definition at line 46 of file AbstractTreeLikelihood.cpp.

References bpp::TreeLikelihood::getLikelihoodForASite(), and bpp::AbstractTreeLikelihood::getNumberOfSites().

Get the likelihood for each site and each rate class.

Returns:
A two-dimension vector with all likelihoods.

Implements bpp::DiscreteRatesAcrossSitesTreeLikelihood.

Definition at line 93 of file AbstractDiscreteRatesAcrossSitesTreeLikelihood.cpp.

Get the likelihood for each site and each rate class and each state.

Returns:
A three-dimension vector with all likelihoods.

Implements bpp::DiscreteRatesAcrossSitesTreeLikelihood.

Definition at line 156 of file AbstractDiscreteRatesAcrossSitesTreeLikelihood.cpp.

virtual VVdouble bpp::TreeLikelihood::getLikelihoodForEachSiteForEachState ( ) const [pure virtual, inherited]

Get the likelihood for each site and for each state.

Returns:
A 2d vector with all likelihoods for each site and for each state.

Implemented in bpp::AbstractTreeLikelihood.

Get the likelihood for each site and for each state.

Returns:
A 2d vector with all likelihoods for each site and for each state.

Implements bpp::TreeLikelihood.

Definition at line 64 of file AbstractTreeLikelihood.cpp.

References bpp::TreeLikelihood::getLikelihoodForASiteForAState(), bpp::AbstractTreeLikelihood::getNumberOfSites(), and bpp::AbstractTreeLikelihood::getNumberOfStates().

double RNonHomogeneousTreeLikelihood::getLogLikelihood ( ) const [virtual, inherited]

Get the logarithm of the likelihood for the whole dataset.

Returns:
The logarithm of the likelihood of the dataset.

Implements bpp::TreeLikelihood.

Definition at line 170 of file RNonHomogeneousTreeLikelihood.cpp.

References bpp::RNonHomogeneousTreeLikelihood::getLogLikelihoodForASite(), and bpp::AbstractNonHomogeneousTreeLikelihood::nbSites_.

Referenced by bpp::RNonHomogeneousTreeLikelihood::fireParameterChanged(), and fireParameterChanged().

double RNonHomogeneousTreeLikelihood::getLogLikelihoodForASite ( size_t  site) const [virtual, inherited]
double RNonHomogeneousTreeLikelihood::getLogLikelihoodForASiteForARateClass ( size_t  site,
size_t  rateClass 
) const [virtual, inherited]

Get the logarithm of the likelihood for a site knowing its rate class.

Parameters:
siteThe site index.
rateClassThe rate class index.
Returns:
The logarithm of the likelihood for the specified site and rate class.

Implements bpp::DiscreteRatesAcrossSitesTreeLikelihood.

Definition at line 227 of file RNonHomogeneousTreeLikelihood.cpp.

References bpp::Node::getId(), bpp::DRASRTreeLikelihoodData::getLikelihoodArray(), bpp::DRASRTreeLikelihoodData::getRootArrayPosition(), bpp::TreeTemplate< N >::getRootNode(), bpp::RNonHomogeneousTreeLikelihood::likelihoodData_, bpp::AbstractNonHomogeneousTreeLikelihood::nbStates_, bpp::AbstractNonHomogeneousTreeLikelihood::rootFreqs_, and bpp::AbstractTreeLikelihood::tree_.

double RNonHomogeneousTreeLikelihood::getLogLikelihoodForASiteForARateClassForAState ( size_t  site,
size_t  rateClass,
int  state 
) const [virtual, inherited]

Get the logarithm of the likelihood for a site knowing its rate class and its ancestral state.

Parameters:
siteThe site index.
rateClassThe rate class index.
stateThe ancestral state.
Returns:
The logarithm of the likelihood for the specified site and rate class and ancestral state..

Implements bpp::DiscreteRatesAcrossSitesTreeLikelihood.

Definition at line 247 of file RNonHomogeneousTreeLikelihood.cpp.

References bpp::Node::getId(), bpp::DRASRTreeLikelihoodData::getLikelihoodArray(), bpp::DRASRTreeLikelihoodData::getRootArrayPosition(), bpp::TreeTemplate< N >::getRootNode(), bpp::RNonHomogeneousTreeLikelihood::likelihoodData_, and bpp::AbstractTreeLikelihood::tree_.

double AbstractDiscreteRatesAcrossSitesTreeLikelihood::getLogLikelihoodForASiteForAState ( size_t  site,
int  state 
) const [virtual, inherited]

Get the logarithm of the likelihood for a site and for a state.

Parameters:
siteThe site index to analyse.
stateThe state to consider.
Returns:
The logarithm of the likelihood for site site and state state.

Implements bpp::TreeLikelihood.

Definition at line 124 of file AbstractDiscreteRatesAcrossSitesTreeLikelihood.cpp.

virtual double bpp::TreeLikelihood::getLogLikelihoodForASiteForAState ( size_t  site,
int  state 
) const [pure virtual, inherited]

Get the logarithm of the likelihood for a site and for a state.

Parameters:
siteThe site index to analyse.
stateThe state to consider.
Returns:
The logarithm of the likelihood for site site and state state.

Implemented in bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood.

Referenced by bpp::AbstractTreeLikelihood::getLogLikelihoodForEachSiteForEachState().

virtual Vdouble bpp::TreeLikelihood::getLogLikelihoodForEachSite ( ) const [pure virtual, inherited]

Get the logarithm of the likelihood for each site.

Returns:
A vector with all log likelihoods for each site.

Implemented in bpp::AbstractTreeLikelihood.

Get the logarithm of the likelihood for each site.

Returns:
A vector with all log likelihoods for each site.

Implements bpp::TreeLikelihood.

Definition at line 55 of file AbstractTreeLikelihood.cpp.

References bpp::TreeLikelihood::getLogLikelihoodForASite(), and bpp::AbstractTreeLikelihood::getNumberOfSites().

Get the logarithm of the likelihood for each site and each rate class.

Returns:
A two-dimension vector with all log likelihoods: V[i][j] = likelihood of site i and rate class j.

Implements bpp::DiscreteRatesAcrossSitesTreeLikelihood.

Definition at line 138 of file AbstractDiscreteRatesAcrossSitesTreeLikelihood.cpp.

Get the logarithm of the likelihood for each site and each rate class and each state.

Returns:
A three-dimension vector with all log likelihoods: V[i][j][k} = likelihood of site i and rate class j and state k.

Implements bpp::DiscreteRatesAcrossSitesTreeLikelihood.

Definition at line 179 of file AbstractDiscreteRatesAcrossSitesTreeLikelihood.cpp.

virtual VVdouble bpp::TreeLikelihood::getLogLikelihoodForEachSiteForEachState ( ) const [pure virtual, inherited]

Get the logarithm of the likelihood for each site and for each state.

Returns:
A 2d vector with all log likelihoods for each site and for each state.

Implemented in bpp::AbstractTreeLikelihood.

Get the logarithm of the likelihood for each site and for each state.

Returns:
A 2d vector with all log likelihoods for each site and for each state.

Implements bpp::TreeLikelihood.

Definition at line 81 of file AbstractTreeLikelihood.cpp.

References bpp::TreeLikelihood::getLogLikelihoodForASiteForAState(), bpp::AbstractTreeLikelihood::getNumberOfSites(), and bpp::AbstractTreeLikelihood::getNumberOfStates().

All non derivable parameters.

Usually, this contains all substitution model parameters and rate distribution.

Returns:
A ParameterList.

Implements bpp::TreeLikelihood.

Reimplemented in bpp::RHomogeneousClockTreeLikelihood.

Definition at line 82 of file AbstractDiscreteRatesAcrossSitesTreeLikelihood.cpp.

References bpp::ParameterList::addParameters().

virtual ParameterList bpp::TreeLikelihood::getNonDerivableParameters ( ) const [pure virtual, inherited]

All non derivable parameters.

Usually, this contains all substitution model parameters and rate distribution.

Returns:
A ParameterList.

Implemented in bpp::RHomogeneousClockTreeLikelihood, and bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood.

virtual size_t bpp::TreeLikelihood::getNumberOfSites ( ) const [pure virtual, inherited]

Get the number of sites in the dataset.

Returns:
the number of sites in the dataset.

Implemented in bpp::AbstractTreeLikelihood.

Referenced by bpp::SubstitutionMappingTools::getNormalizationsPerBranch().

size_t bpp::AbstractTreeLikelihood::getNumberOfStates ( ) const [inline, virtual, inherited]

Get the number of states in the alphabet associated to the dataset.

Returns:
the number of states in the alphabet associated to the dataset.

Implements bpp::TreeLikelihood.

Definition at line 291 of file AbstractTreeLikelihood.h.

References bpp::AbstractTreeLikelihood::data_, bpp::SiteContainer::getAlphabet(), and bpp::Alphabet::getSize().

Referenced by bpp::AbstractTreeLikelihood::getLikelihoodForEachSiteForEachState(), and bpp::AbstractTreeLikelihood::getLogLikelihoodForEachSiteForEachState().

virtual size_t bpp::TreeLikelihood::getNumberOfStates ( ) const [pure virtual, inherited]

Get the number of states in the alphabet associated to the dataset.

Returns:
the number of states in the alphabet associated to the dataset.

Implemented in bpp::AbstractTreeLikelihood.

Referenced by bpp::DRTreeLikelihoodTools::getPosteriorProbabilitiesForEachStateForEachRate(), and bpp::DRTreeLikelihoodTools::getPosteriorStateFrequencies().

Get the posterior probability for each site of belonging to a particular rate class.

Returns:
A two-dimension vector with all posterior probabilities: V[i][j] = probablity for site i of belonging to rate class j.

Implements bpp::DiscreteRatesAcrossSitesTreeLikelihood.

Definition at line 202 of file AbstractDiscreteRatesAcrossSitesTreeLikelihood.cpp.

Get the posterior rate, i.e. averaged over all classes and weighted with posterior probabilities, for each site.

Returns:
A vector with all rates.

Implements bpp::DiscreteRatesAcrossSitesTreeLikelihood.

Definition at line 220 of file AbstractDiscreteRatesAcrossSitesTreeLikelihood.cpp.

Get the posterior rate class (the one with maximum posterior probability) for each site.

Returns:
A vector with all rate classes indexes.

Implements bpp::DiscreteRatesAcrossSitesTreeLikelihood.

Definition at line 239 of file AbstractDiscreteRatesAcrossSitesTreeLikelihood.cpp.

Get the rate distribution used for the computation.

Returns:
A const pointer toward the rate distribution of this instance.

Implements bpp::DiscreteRatesAcrossSitesTreeLikelihood.

Definition at line 106 of file AbstractDiscreteRatesAcrossSitesTreeLikelihood.h.

References bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood::rateDistribution_.

Get the rate distribution used for the computation.

Returns:
A pointer toward the rate distribution of this instance.

Implements bpp::DiscreteRatesAcrossSitesTreeLikelihood.

Definition at line 107 of file AbstractDiscreteRatesAcrossSitesTreeLikelihood.h.

References bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood::rateDistribution_.

Get the parameters associated to the rate distirbution.

Returns:
A ParameterList object with all rate distribution parameters.

Reimplemented from bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood.

Definition at line 183 of file AbstractNonHomogeneousTreeLikelihood.h.

Get the posterior rate (the one with maximum posterior probability) for each site.

Returns:
A vector with all rate classes indexes.

Implements bpp::DiscreteRatesAcrossSitesTreeLikelihood.

Definition at line 253 of file AbstractDiscreteRatesAcrossSitesTreeLikelihood.cpp.

const std::vector<double>& bpp::AbstractNonHomogeneousTreeLikelihood::getRootFrequencies ( size_t  siteIndex) const [inline, virtual, inherited]

Get the values of the frequencies for each state in the alphabet at the root node.

For reversible models, these are the equilibrium frequencies. For non-reversible models, these usually are distinct parameters.

For models without site partitioning, the set of frequencies is the same for all positions. For partition models, the frequencies may differ from one site to another.

Parameters:
siteIndexThe index of the alignment position.
See also:
getSiteIndex
Returns:
A vector with ancestral frequencies for each state in the alphabet;

Implements bpp::TreeLikelihood.

Definition at line 198 of file AbstractNonHomogeneousTreeLikelihood.h.

References bpp::AbstractNonHomogeneousTreeLikelihood::rootFreqs_.

double RNonHomogeneousTreeLikelihood::getSecondOrderDerivative ( const std::string &  variable) const throw (Exception) [virtual, inherited]

Implements bpp::DerivableSecondOrder.

Definition at line 848 of file RNonHomogeneousTreeLikelihood.cpp.

double bpp::RNonHomogeneousTreeLikelihood::getSecondOrderDerivative ( const std::string &  variable1,
const std::string &  variable2 
) const throw (Exception) [inline, virtual, inherited]

Implements bpp::DerivableSecondOrder.

Definition at line 217 of file RNonHomogeneousTreeLikelihood.h.

size_t bpp::RNonHomogeneousTreeLikelihood::getSiteIndex ( size_t  site) const throw (IndexOutOfBoundsException) [inline, virtual, inherited]

Get the index (used for inner computations) of a given site (original alignment column).

Parameters:
siteAn alignment position.
Returns:
The site index corresponding to the given input alignment position.

Implements bpp::TreeLikelihood.

Definition at line 172 of file RNonHomogeneousTreeLikelihood.h.

References bpp::DRASRTreeLikelihoodData::getRootArrayPosition(), and bpp::RNonHomogeneousTreeLikelihood::likelihoodData_.

const SubstitutionModel* bpp::NonHomogeneousTreeLikelihood::getSubstitutionModel ( int  nodeId,
size_t  siteIndex 
) const throw (NodeNotFoundException) [inline, virtual, inherited]

Get the substitution model associated to a given node and alignment column.

Parameters:
nodeIdThe id of the request node.
siteIndexThe index of the alignment position.
See also:
getSiteIndex
Returns:
A pointer toward the corresponding model.
Exceptions:
NodeNotFoundExceptionThis exception may be thrown if the node is not found (depending on the implementation).

Implements bpp::TreeLikelihood.

Definition at line 69 of file NonHomogeneousTreeLikelihood.h.

References bpp::NonHomogeneousTreeLikelihood::getSubstitutionModelForNode().

SubstitutionModel* bpp::NonHomogeneousTreeLikelihood::getSubstitutionModel ( int  nodeId,
size_t  siteIndex 
) throw (NodeNotFoundException) [inline, virtual, inherited]

Get the substitution model associated to a given node and alignment column.

Parameters:
nodeIdThe id of the request node.
siteIndexThe index of the alignment position.
See also:
getSiteIndex
Returns:
A pointer toward the corresponding model.
Exceptions:
NodeNotFoundExceptionThis exception may be thrown if the node is not found (depending on the implementation).

Implements bpp::TreeLikelihood.

Definition at line 74 of file NonHomogeneousTreeLikelihood.h.

References bpp::NonHomogeneousTreeLikelihood::getSubstitutionModelForNode().

Get the substitution model associated to a given node.

Parameters:
nodeIdThe id of the request node.
Returns:
A pointer toward the corresponding model.
Exceptions:
NodeNotFoundExceptionThis exception may be thrown if the node is not found (depending on the implementation).

Implements bpp::NonHomogeneousTreeLikelihood.

Definition at line 188 of file AbstractNonHomogeneousTreeLikelihood.h.

References bpp::SubstitutionModelSet::getModelForNode(), and bpp::AbstractNonHomogeneousTreeLikelihood::modelSet_.

Get the substitution model associated to a given node.

Parameters:
nodeIdThe id of the request node.
Returns:
A pointer toward the corresponding model.
Exceptions:
NodeNotFoundExceptionThis exception may be thrown if the node is not found (depending on the implementation).

Implements bpp::NonHomogeneousTreeLikelihood.

Definition at line 193 of file AbstractNonHomogeneousTreeLikelihood.h.

References bpp::SubstitutionModelSet::getModelForNode(), and bpp::AbstractNonHomogeneousTreeLikelihood::modelSet_.

Returns:
The set of substitution models associated to this instance.

Implements bpp::NonHomogeneousTreeLikelihood.

Definition at line 221 of file AbstractNonHomogeneousTreeLikelihood.h.

References bpp::AbstractNonHomogeneousTreeLikelihood::modelSet_.

Returns:
The set of substitution models associated to this instance.

Implements bpp::NonHomogeneousTreeLikelihood.

Definition at line 223 of file AbstractNonHomogeneousTreeLikelihood.h.

References bpp::AbstractNonHomogeneousTreeLikelihood::modelSet_.

VVdouble AbstractDiscreteRatesAcrossSitesTreeLikelihood::getTransitionProbabilities ( int  nodeId,
size_t  siteIndex 
) const [virtual, inherited]

Retrieves all Pij(t) for a particular branch, defined by the upper node and site.

These intermediate results may be used by other methods.

Parameters:
nodeIdThe node defining the branch of interest.
siteIndexThe index of the alignment position.
See also:
getSiteIndex
Returns:
An array of dimension 2, where a[x][y] is the probability of substituting from x to y.

Implements bpp::TreeLikelihood.

Definition at line 311 of file AbstractDiscreteRatesAcrossSitesTreeLikelihood.cpp.

virtual VVdouble bpp::TreeLikelihood::getTransitionProbabilities ( int  nodeId,
size_t  siteIndex 
) const [pure virtual, inherited]

Retrieves all Pij(t) for a particular branch, defined by the upper node and site.

These intermediate results may be used by other methods.

Parameters:
nodeIdThe node defining the branch of interest.
siteIndexThe index of the alignment position.
See also:
getSiteIndex
Returns:
An array of dimension 2, where a[x][y] is the probability of substituting from x to y.

Implemented in bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood.

VVVdouble bpp::AbstractNonHomogeneousTreeLikelihood::getTransitionProbabilitiesPerRateClass ( int  nodeId,
size_t  siteIndex 
) const [inline, virtual, inherited]

Retrieves all Pij(t) for a particular branch, defined by the upper node.

These intermediate results may be used by other methods.

Parameters:
nodeIdThe node defining the branch of interest.
siteIndexThe position in the alignment.
Returns:
An array of dimension 3, where a[c][x][y] is the probability of substituting from x to y while being in rate class c.

Implements bpp::DiscreteRatesAcrossSitesTreeLikelihood.

Definition at line 200 of file AbstractNonHomogeneousTreeLikelihood.h.

References bpp::AbstractNonHomogeneousTreeLikelihood::pxy_.

const Tree& bpp::AbstractTreeLikelihood::getTree ( ) const [inline, virtual, inherited]

Get the tree (topology and branch lengths).

Returns:
The tree of this TreeLikelihood object.

Implements bpp::TreeLikelihood.

Definition at line 292 of file AbstractTreeLikelihood.h.

References bpp::AbstractTreeLikelihood::tree_.

Referenced by bpp::NNIHomogeneousTreeLikelihood::getTopology(), and init().

Init the likelihood object.

This method is used to initialize all parameters. It is typically called after the constructor and the setData method. It contains virtual methods that can't be called in the constructor.

Exceptions:
Exceptionif something bad happened, for instance if no data are associated to the likelihood function.

Reimplemented from bpp::AbstractNonHomogeneousTreeLikelihood.

Definition at line 314 of file RNonHomogeneousMixedTreeLikelihood.cpp.

References bpp::AbstractParametrizable::addParameters_(), bpp::AbstractNonHomogeneousTreeLikelihood::brLenParameters_, bpp::AbstractNonHomogeneousTreeLikelihood::initBranchLengthsParameters(), bpp::AbstractNonHomogeneousTreeLikelihood::initParameters(), main_, and mvTreeLikelihoods_.

virtual bool bpp::TreeLikelihood::isInitialized ( ) const [pure virtual, inherited]
Returns:
'true' is the likelihood function has been initialized.

Implemented in bpp::AbstractTreeLikelihood.

void RNonHomogeneousMixedTreeLikelihood::setData ( const SiteContainer sites) throw (Exception) [virtual]

Set the dataset for which the likelihood must be evaluated.

Parameters:
sitesThe data set to use.

Reimplemented from bpp::RNonHomogeneousTreeLikelihood.

Definition at line 437 of file RNonHomogeneousMixedTreeLikelihood.cpp.

References bpp::RNonHomogeneousTreeLikelihood::setData().

Implements the Function interface.

Update the parameter list and call the applyParameters() method. Then compute the likelihoods at each node (computeLikelihood() method) and call the getLogLikelihood() method.

If a subset of the whole parameter list is passed to the function, only these parameters are updated and the other remain constant (i.e. equal to their last value).

Parameters:
parametersThe parameter list to pass to the function.

Implements bpp::DerivableSecondOrder.

Definition at line 254 of file RNonHomogeneousTreeLikelihood.cpp.

sets the probability of this object in the hierarchy

Definition at line 458 of file RNonHomogeneousMixedTreeLikelihood.cpp.

References hyperNode_, and bpp::MixedSubstitutionModelSet::HyperNode::setProbability().

Referenced by fireParameterChanged().

Returns:
Set the substitution models for this instance.
Exceptions:
ExceptionIf the model could not be set (for instance, because of a wrong alphabet type).

Implements bpp::NonHomogeneousTreeLikelihood.

Definition at line 195 of file AbstractNonHomogeneousTreeLikelihood.cpp.

References bpp::Node::getId().


Friends And Related Function Documentation

friend class RNonHomogeneousMixedTreeLikelihood [friend, inherited]

Definition at line 271 of file RNonHomogeneousTreeLikelihood.h.


Member Data Documentation

A specific HyperNode in which the computation is processed. If the probability of this HyperNode is -1, it means that it should not be used, and the HyperNodes are all in the MixedSubstitutionModelSet object.

This object owns the HyperNode pointers of the owned RNonHomogeneousMixedTreeLikelihood.

Definition at line 92 of file RNonHomogeneousMixedTreeLikelihood.h.

Referenced by computeTransitionProbabilitiesForNode(), getProbability(), init(), operator=(), and setProbability().

Definition at line 61 of file AbstractDiscreteRatesAcrossSitesTreeLikelihood.h.

Referenced by bpp::AbstractHomogeneousTreeLikelihood::applyParameters(), bpp::AbstractNonHomogeneousTreeLikelihood::applyParameters(), bpp::TwoTreeLikelihood::applyParameters(), bpp::DRHomogeneousTreeLikelihood::computeRootLikelihood(), bpp::DRNonHomogeneousTreeLikelihood::computeRootLikelihood(), bpp::AbstractHomogeneousTreeLikelihood::computeTransitionProbabilitiesForNode(), bpp::AbstractNonHomogeneousTreeLikelihood::computeTransitionProbabilitiesForNode(), computeTransitionProbabilitiesForNode(), bpp::TwoTreeLikelihood::computeTreeD2Likelihood(), bpp::DRHomogeneousTreeLikelihood::computeTreeD2LikelihoodAtNode(), bpp::DRNonHomogeneousTreeLikelihood::computeTreeD2LikelihoodAtNode(), bpp::TwoTreeLikelihood::computeTreeDLikelihood(), bpp::DRHomogeneousTreeLikelihood::computeTreeDLikelihoodAtNode(), bpp::DRNonHomogeneousTreeLikelihood::computeTreeDLikelihoodAtNode(), bpp::TwoTreeLikelihood::computeTreeLikelihood(), bpp::DRHomogeneousTreeLikelihood::fireParameterChanged(), bpp::DRNonHomogeneousTreeLikelihood::fireParameterChanged(), bpp::RHomogeneousTreeLikelihood::fireParameterChanged(), bpp::RNonHomogeneousTreeLikelihood::fireParameterChanged(), bpp::TwoTreeLikelihood::fireParameterChanged(), fireParameterChanged(), bpp::RNonHomogeneousTreeLikelihood::getD2LikelihoodForASite(), bpp::RHomogeneousTreeLikelihood::getD2LikelihoodForASite(), bpp::RNonHomogeneousTreeLikelihood::getDLikelihoodForASite(), bpp::RHomogeneousTreeLikelihood::getDLikelihoodForASite(), bpp::RHomogeneousTreeLikelihood::getLikelihoodForASite(), bpp::RNonHomogeneousTreeLikelihood::getLikelihoodForASite(), bpp::RHomogeneousTreeLikelihood::getLogLikelihoodForASite(), bpp::RNonHomogeneousTreeLikelihood::getLogLikelihoodForASite(), bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood::getNumberOfClasses(), bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood::getRateDistribution(), init(), bpp::AbstractHomogeneousTreeLikelihood::initParameters(), bpp::AbstractNonHomogeneousTreeLikelihood::initParameters(), bpp::TwoTreeLikelihood::initParameters(), and bpp::AbstractDiscreteRatesAcrossSitesTreeLikelihood::operator=().

TreeTemplate<Node>* bpp::AbstractTreeLikelihood::tree_ [mutable, protected, inherited]

Definition at line 226 of file AbstractTreeLikelihood.h.

Referenced by bpp::AbstractHomogeneousTreeLikelihood::AbstractHomogeneousTreeLikelihood(), bpp::AbstractNonHomogeneousTreeLikelihood::AbstractNonHomogeneousTreeLikelihood(), bpp::AbstractTreeLikelihood::AbstractTreeLikelihood(), bpp::DRHomogeneousTreeLikelihood::computeLikelihoodAtNode(), bpp::DRNonHomogeneousTreeLikelihood::computeLikelihoodAtNode(), bpp::DRHomogeneousTreeLikelihood::computeRootLikelihood(), bpp::DRNonHomogeneousTreeLikelihood::computeRootLikelihood(), bpp::RNonHomogeneousTreeLikelihood::computeTreeD2Likelihood(), computeTreeD2Likelihood(), bpp::RNonHomogeneousTreeLikelihood::computeTreeDLikelihood(), computeTreeDLikelihood(), bpp::DRHomogeneousTreeLikelihood::computeTreeLikelihood(), bpp::DRNonHomogeneousTreeLikelihood::computeTreeLikelihood(), bpp::RNonHomogeneousTreeLikelihood::computeTreeLikelihood(), bpp::RHomogeneousTreeLikelihood::computeTreeLikelihood(), bpp::DRHomogeneousTreeLikelihood::DRHomogeneousTreeLikelihood(), bpp::DRNonHomogeneousTreeLikelihood::DRNonHomogeneousTreeLikelihood(), bpp::DRNonHomogeneousTreeLikelihood::fireParameterChanged(), bpp::RNonHomogeneousTreeLikelihood::fireParameterChanged(), fireParameterChanged(), bpp::RNonHomogeneousTreeLikelihood::getD2LikelihoodForASiteForARateClass(), bpp::RHomogeneousTreeLikelihood::getD2LikelihoodForASiteForARateClass(), bpp::RNonHomogeneousTreeLikelihood::getDLikelihoodForASiteForARateClass(), bpp::RHomogeneousTreeLikelihood::getDLikelihoodForASiteForARateClass(), bpp::RHomogeneousTreeLikelihood::getLikelihoodForASiteForARateClass(), bpp::RNonHomogeneousTreeLikelihood::getLikelihoodForASiteForARateClass(), bpp::RHomogeneousTreeLikelihood::getLikelihoodForASiteForARateClassForAState(), bpp::RNonHomogeneousTreeLikelihood::getLikelihoodForASiteForARateClassForAState(), bpp::RHomogeneousTreeLikelihood::getLogLikelihoodForASiteForARateClass(), bpp::RNonHomogeneousTreeLikelihood::getLogLikelihoodForASiteForARateClass(), bpp::RHomogeneousTreeLikelihood::getLogLikelihoodForASiteForARateClassForAState(), bpp::RNonHomogeneousTreeLikelihood::getLogLikelihoodForASiteForARateClassForAState(), bpp::AbstractHomogeneousTreeLikelihood::getNewSiteModelIterator(), bpp::AbstractTreeLikelihood::getTree(), bpp::DRHomogeneousTreeLikelihood::operator=(), bpp::DRNonHomogeneousTreeLikelihood::operator=(), bpp::AbstractHomogeneousTreeLikelihood::operator=(), bpp::RHomogeneousTreeLikelihood::operator=(), bpp::RNonHomogeneousTreeLikelihood::operator=(), bpp::AbstractNonHomogeneousTreeLikelihood::operator=(), bpp::AbstractTreeLikelihood::operator=(), bpp::RHomogeneousTreeLikelihood::RHomogeneousTreeLikelihood(), bpp::RNonHomogeneousTreeLikelihood::RNonHomogeneousTreeLikelihood(), and bpp::AbstractTreeLikelihood::~AbstractTreeLikelihood().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Friends