bpp-phyl  2.2.0
DiscreteRatesAcrossSitesTreeLikelihood.h
Go to the documentation of this file.
1 //
2 // File: DiscreteRateAcrossSitesTreeLikelihood.h
3 // Created by: Julien Dutheil
4 // Created on: 2005
5 //
6 
7 /*
8 Copyright or © or Copr. Bio++ Development Team, (November 16, 2004)
9 
10 This software is a computer program whose purpose is to provide classes
11 for phylogenetic data analysis.
12 
13 This software is governed by the CeCILL license under French law and
14 abiding by the rules of distribution of free software. You can use,
15 modify and/ or redistribute the software under the terms of the CeCILL
16 license as circulated by CEA, CNRS and INRIA at the following URL
17 "http://www.cecill.info".
18 
19 As a counterpart to the access to the source code and rights to copy,
20 modify and redistribute granted by the license, users are provided only
21 with a limited warranty and the software's author, the holder of the
22 economic rights, and the successive licensors have only limited
23 liability.
24 
25 In this respect, the user's attention is drawn to the risks associated
26 with loading, using, modifying and/or developing or reproducing the
27 software by the user in light of its specific status of free software,
28 that may mean that it is complicated to manipulate, and that also
29 therefore means that it is reserved for developers and experienced
30 professionals having in-depth computer knowledge. Users are therefore
31 encouraged to load and test the software's suitability as regards their
32 requirements in conditions enabling the security of their systems and/or
33 data to be ensured and, more generally, to use and operate it in the
34 same conditions as regards security.
35 
36 The fact that you are presently reading this means that you have had
37 knowledge of the CeCILL license and that you accept its terms.
38 */
39 
40 #ifndef _DISCRETERATESACROSSSITESTREELIKELIHOOD_H_
41 #define _DISCRETERATESACROSSSITESTREELIKELIHOOD_H_
42 
43 #include "TreeLikelihood.h"
44 
45 #include <Bpp/Numeric/Prob/DiscreteDistribution.h>
46 #include <Bpp/Numeric/ParameterList.h>
47 
48 namespace bpp
49 {
50 
57  public virtual TreeLikelihood
58 {
59  public:
62 
63  public:
64 
70  virtual const DiscreteDistribution* getRateDistribution() const = 0;
71 
77  virtual DiscreteDistribution* getRateDistribution() = 0;
78 
86  virtual double getLikelihoodForASiteForARateClass(size_t site, size_t rateClass) const = 0;
87 
95  virtual double getLogLikelihoodForASiteForARateClass(size_t site, size_t rateClass) const = 0;
96 
105  virtual double getLikelihoodForASiteForARateClassForAState(size_t site, size_t rateClass, int state) const = 0;
106 
115  virtual double getLogLikelihoodForASiteForARateClassForAState(size_t site, size_t rateClass, int state) const = 0;
116 
122  virtual VVdouble getLikelihoodForEachSiteForEachRateClass() const = 0;
123 
130  virtual VVdouble getLogLikelihoodForEachSiteForEachRateClass() const = 0;
131 
137  virtual VVVdouble getLikelihoodForEachSiteForEachRateClassForEachState() const = 0;
138 
145  virtual VVVdouble getLogLikelihoodForEachSiteForEachRateClassForEachState() const = 0;
146 
154  virtual VVdouble getPosteriorProbabilitiesOfEachRate() const = 0;
155 
162  virtual std::vector<size_t> getRateClassWithMaxPostProbOfEachSite() const = 0;
163 
170  virtual Vdouble getRateWithMaxPostProbOfEachSite() const = 0;
171 
178  virtual Vdouble getPosteriorRateOfEachSite() const = 0;
179 
185  virtual ParameterList getRateDistributionParameters() const = 0;
186 
192  virtual size_t getNumberOfClasses() const = 0;
193 
203  virtual VVVdouble getTransitionProbabilitiesPerRateClass(int nodeId, size_t siteIndex) const = 0;
204 
205 };
206 
207 } //end of namespace bpp.
208 
209 #endif //_DISCRETERATESACROSSSITESTREELIKELIHOOD_H_
210 
virtual VVdouble getLikelihoodForEachSiteForEachRateClass() const =0
Get the likelihood for each site and each rate class.
The TreeLikelihood interface.
virtual size_t getNumberOfClasses() const =0
Get the number of classes.
virtual double getLikelihoodForASiteForARateClassForAState(size_t site, size_t rateClass, int state) const =0
Get the likelihood for a site knowing its rate class and its ancestral state.
virtual double getLogLikelihoodForASiteForARateClassForAState(size_t site, size_t rateClass, int state) const =0
Get the logarithm of the likelihood for a site knowing its rate class and its ancestral state...
virtual VVdouble getPosteriorProbabilitiesOfEachRate() const =0
Get the posterior probability for each site of belonging to a particular rate class.
virtual double getLikelihoodForASiteForARateClass(size_t site, size_t rateClass) const =0
Get the likelihood for a site knowing its rate class.
virtual VVVdouble getLogLikelihoodForEachSiteForEachRateClassForEachState() const =0
Get the logarithm of the likelihood for each site and each rate class and each state.
virtual std::vector< size_t > getRateClassWithMaxPostProbOfEachSite() const =0
Get the posterior rate class (the one with maximum posterior probability) for each site...
virtual ParameterList getRateDistributionParameters() const =0
Get the parameters associated to the rate distirbution.
virtual Vdouble getRateWithMaxPostProbOfEachSite() const =0
Get the posterior rate (the one with maximum posterior probability) for each site.
Interface for rate across sites (RAS) implementation.
virtual VVdouble getLogLikelihoodForEachSiteForEachRateClass() const =0
Get the logarithm of the likelihood for each site and each rate class.
virtual double getLogLikelihoodForASiteForARateClass(size_t site, size_t rateClass) const =0
Get the logarithm of the likelihood for a site knowing its rate class.
virtual VVVdouble getLikelihoodForEachSiteForEachRateClassForEachState() const =0
Get the likelihood for each site and each rate class and each state.
virtual const DiscreteDistribution * getRateDistribution() const =0
Get the rate distribution used for the computation.
virtual Vdouble getPosteriorRateOfEachSite() const =0
Get the posterior rate, i.e. averaged over all classes and weighted with posterior probabilities...
virtual VVVdouble getTransitionProbabilitiesPerRateClass(int nodeId, size_t siteIndex) const =0
Retrieves all Pij(t) for a particular branch, defined by the upper node.