|
bpp-phyl
2.2.0
|
A container for paired-site likelihoods (likelihoods over the same sites for different models, especially topologies). An instance of this class is, roughly, a list of models, each of them having a name (stored in the modelNames attribute) and a set of site likelihoods (stored in the logLikelihoods attribute). More...
#include <Bpp/Phyl/Likelihood/PairedSiteLikelihoods.h>
Collaboration diagram for bpp::PairedSiteLikelihoods:Public Member Functions | |
| PairedSiteLikelihoods () | |
| PairedSiteLikelihoods (const std::vector< std::vector< double > > &siteLogLikelihoods, const std::vector< std::string > &modelNames=std::vector< std::string >()) throw (Exception) | |
| Build a new object from a site likelihoods array. More... | |
| ~PairedSiteLikelihoods () | |
| void | appendModel (const std::vector< double > &siteLogLikelihoods, const std::string &modelName="") throw (Exception) |
| Append a model. More... | |
| void | appendModel (const bpp::TreeLikelihood &treelikelihood) throw (Exception) |
| Append a model. More... | |
| void | appendModels (const PairedSiteLikelihoods &psl) throw (Exception) |
| Append models by concatenation. More... | |
| const std::vector< std::vector< double > > & | getLikelihoods () const |
| const std::vector< std::string > & | getModelNames () const |
| size_t | getNumberOfModels () const |
| Get the number of models in the container. More... | |
| std::size_t | getNumberOfSites () const throw (Exception) |
| void | setName (std::size_t pos, std::string &name) |
| Set the name of a model. More... | |
| std::pair< std::vector< std::string >, std::vector< double > > | computeExpectedLikelihoodWeights (int replicates=10000) const |
| Compute the Expected Likelihood Weights of the models. More... | |
Static Public Member Functions | |
| static std::vector< int > | bootstrap (std::size_t length, double scaling=1) |
| Draw a nonparametric pseudoreplicate. More... | |
Private Attributes | |
| std::vector< std::vector< double > > | logLikelihoods_ |
| std::vector< std::string > | modelNames_ |
A container for paired-site likelihoods (likelihoods over the same sites for different models, especially topologies). An instance of this class is, roughly, a list of models, each of them having a name (stored in the modelNames attribute) and a set of site likelihoods (stored in the logLikelihoods attribute).
Definition at line 60 of file PairedSiteLikelihoods.h.
| PairedSiteLikelihoods::PairedSiteLikelihoods | ( | ) |
Definition at line 56 of file PairedSiteLikelihoods.cpp.
| PairedSiteLikelihoods::PairedSiteLikelihoods | ( | const std::vector< std::vector< double > > & | siteLogLikelihoods, |
| const std::vector< std::string > & | modelNames = std::vector<std::string>() |
||
| ) | |||
| throw | ( | Exception | |
| ) | |||
Build a new object from a site likelihoods array.
| siteLogLikelihoods | An nmodels*nsites array of loglikelihoods. |
| modelNames | (Optional) The names of the models. |
| Exception | If the number of sites differ between the models, or if the number of names and site loglikelihood records differ. |
Definition at line 61 of file PairedSiteLikelihoods.cpp.
|
inline |
Definition at line 83 of file PairedSiteLikelihoods.h.
| void PairedSiteLikelihoods::appendModel | ( | const std::vector< double > & | siteLogLikelihoods, |
| const std::string & | modelName = "" |
||
| ) | |||
| throw | ( | Exception | |
| ) | |||
Append a model.
| siteLogLikelihoods | The loglikelihoods of the sites under this model. |
| modelName | The name of the model. |
| Exception | If the number of sites is not the same as in the container. |
Definition at line 87 of file PairedSiteLikelihoods.cpp.
Referenced by appendModel().
| void PairedSiteLikelihoods::appendModel | ( | const bpp::TreeLikelihood & | treelikelihood | ) | |
| throw | ( | Exception | |||
| ) | |||||
Append a model.
| treelikelihood | A TreeLikelihood record. |
| Exception | If the number of sites is not the same as in the container. |
Definition at line 99 of file PairedSiteLikelihoods.cpp.
References appendModel().
| void PairedSiteLikelihoods::appendModels | ( | const PairedSiteLikelihoods & | psl | ) | |
| throw | ( | Exception | |||
| ) | |||||
Append models by concatenation.
| psl | the PairedSiteLikelihoods object to append to the caller. |
| Exception | If the number of sites in the two object is not equal. |
Definition at line 107 of file PairedSiteLikelihoods.cpp.
|
static |
Draw a nonparametric pseudoreplicate.
| length | The length of the data. |
| scaling | The length of the pseudoreplicate, in fraction of the length of the data. |
Definition at line 178 of file PairedSiteLikelihoods.cpp.
Referenced by computeExpectedLikelihoodWeights().
| pair< vector< string >, vector< double > > PairedSiteLikelihoods::computeExpectedLikelihoodWeights | ( | int | replicates = 10000 | ) | const |
Compute the Expected Likelihood Weights of the models.
The weight
of a model is :
where
is the loglikelihood of model k for replicate b.
| replicates | The number of pseudoreplicates over which the weights are to be averaged. |
Definition at line 124 of file PairedSiteLikelihoods.cpp.
References bootstrap(), getNumberOfModels(), getNumberOfSites(), logLikelihoods_, and modelNames_.
|
inline |
Definition at line 118 of file PairedSiteLikelihoods.h.
References logLikelihoods_.
Referenced by bpp::IOTreepuzzlePairedSiteLikelihoods::write().
|
inline |
Definition at line 126 of file PairedSiteLikelihoods.h.
References modelNames_.
Referenced by bpp::IOTreepuzzlePairedSiteLikelihoods::write().
|
inline |
Get the number of models in the container.
Definition at line 132 of file PairedSiteLikelihoods.h.
References logLikelihoods_.
Referenced by computeExpectedLikelihoodWeights(), and bpp::IOTreepuzzlePairedSiteLikelihoods::write().
|
inline | |||||||||||||
| Exception | If the container is empty. |
Definition at line 141 of file PairedSiteLikelihoods.h.
References logLikelihoods_.
Referenced by computeExpectedLikelihoodWeights(), and bpp::IOTreepuzzlePairedSiteLikelihoods::write().
|
inline |
Set the name of a model.
| pos | The position of the target model. |
| name | The new name. |
Definition at line 159 of file PairedSiteLikelihoods.h.
References modelNames_.
|
private |
Definition at line 63 of file PairedSiteLikelihoods.h.
Referenced by computeExpectedLikelihoodWeights(), getLikelihoods(), getNumberOfModels(), and getNumberOfSites().
|
private |
Definition at line 64 of file PairedSiteLikelihoods.h.
Referenced by computeExpectedLikelihoodWeights(), getModelNames(), and setName().