bpp-phyl3  3.0.0
bpp::AbstractTotallyWrappedTransitionModel Class Referenceabstract

#include <Bpp/Phyl/Model/AbstractWrappedModel.h>

+ Inheritance diagram for bpp::AbstractTotallyWrappedTransitionModel:
+ Collaboration diagram for bpp::AbstractTotallyWrappedTransitionModel:

Public Member Functions

 AbstractTotallyWrappedTransitionModel (const std::string &prefix)
 
virtual ~AbstractTotallyWrappedTransitionModel ()
 
const FrequencySetInterfacefrequencySet () const override
 
const BranchModelInterfacemodel () const override
 
virtual std::string getName () const override
 Get the name of the model. More...
 
void setNamespace (const std::string &prefix)
 
bool hasIndependentParameter (const std::string &name) const
 
const ParameterListgetIndependentParameters () const
 
size_t getNumberOfIndependentParameters () const
 
void aliasParameters (const std::string &p1, const std::string &p2)
 
void aliasParameters (std::map< std::string, std::string > &unparsedParams, bool verbose)
 
void unaliasParameters (const std::string &p1, const std::string &p2)
 
ParameterList getAliasedParameters (const ParameterList &pl) const
 
ParameterList getFromParameters (const ParameterList &pl) const
 
virtual std::vector< std::string > getAlias (const std::string &name) const
 
virtual std::map< std::string, std::string > getAliases () const
 
std::string getFrom (const std::string &name) const
 
bool hasParameter (const std::string &name) const override
 
const ParameterListgetParameters () const override
 
const Parameterparameter (const std::string &name) const override
 
const std::shared_ptr< Parameter > & getParameter (const std::string &name) const
 
double getParameterValue (const std::string &name) const override
 
void setAllParametersValues (const ParameterList &parameters) override
 
void setParameterValue (const std::string &name, double value) override
 
void setParametersValues (const ParameterList &parameters) override
 
bool matchParametersValues (const ParameterList &parameters) override
 
void removeConstraint (const std::string &name) override
 
void setConstraint (const std::string &name, std::shared_ptr< ConstraintInterface > constraint) override
 
size_t getNumberOfParameters () const override
 
std::string getNamespace () const override
 
std::string getParameterNameWithoutNamespace (const std::string &name) const override
 
virtual void fireParameterChanged (const ParameterList &parameters)
 
virtual Clonableclone () const=0
 
BranchModelInterfaceclone () const =0
 
TransitionModelInterfaceclone () const =0
 
virtual const Eigen::VectorXd & Lik_t (const Eigen::VectorXd &values, double t) const =0
 
const Eigen::VectorXd & Lik_t (const Eigen::VectorXd &values, double t) const override
 
virtual const Eigen::VectorXd & dLik_dt (const Eigen::VectorXd &values, double t) const =0
 
const Eigen::VectorXd & dLik_dt (const Eigen::VectorXd &values, double t) const override
 
virtual const Eigen::VectorXd & d2Lik_dt2 (const Eigen::VectorXd &values, double t) const =0
 
const Eigen::VectorXd & d2Lik_dt2 (const Eigen::VectorXd &values, double t) const override
 
virtual void addRateParameter ()=0
 
virtual const TransitionModelInterfacetransitionModel () const =0
 
double freq (size_t i) const override
 Methods to supersede TransitionModel methods. More...
 
double Pij_t (size_t i, size_t j, double t) const override
 
double dPij_dt (size_t i, size_t j, double t) const override
 
double d2Pij_dt2 (size_t i, size_t j, double t) const override
 
const VdoublegetFrequencies () const override
 
const Matrix< double > & getPij_t (double t) const override
 
const Matrix< double > & getdPij_dt (double t) const override
 
const Matrix< double > & getd2Pij_dt2 (double t) const override
 
double getInitValue (size_t i, int state) const override
 
double getRate () const override
 Get the rate. More...
 
void setRate (double rate) override
 Set the rate of the model (must be positive). More...
 
void setFreqFromData (const SequenceDataInterface &data, double pseudoCount=0) override
 Set equilibrium frequencies equal to the frequencies estimated from the data. More...
 
void setFreq (std::map< int, double > &frequencies) override
 Set equilibrium frequencies. More...
 
bool computeFrequencies () const override
 
void computeFrequencies (bool yn) override
 
const std::vector< int > & getAlphabetStates () const override
 
const StateMapInterfacestateMap () const override
 
std::shared_ptr< const StateMapInterfacegetStateMap () const override
 
int getAlphabetStateAsInt (size_t i) const override
 
std::string getAlphabetStateAsChar (size_t i) const override
 
std::vector< size_t > getModelStates (int code) const override
 Get the state in the model corresponding to a particular state in the alphabet. More...
 
std::vector< size_t > getModelStates (const std::string &code) const override
 Get the state in the model corresponding to a particular state in the alphabet. More...
 
const Alphabetalphabet () const override
 
std::shared_ptr< const AlphabetgetAlphabet () const override
 
size_t getNumberOfStates () const override
 Get the number of states. More...
 

Protected Member Functions

VdoublegetFrequencies_ () override
 
BranchModelInterfacemodel_ ()
 
virtual TransitionModelInterfacetransitionModel_ ()=0
 
const std::shared_ptr< Parameter > & getParameter (size_t i) const
 
std::shared_ptr< Parameter > & getParameter (size_t i)
 
void addParameter_ (Parameter *parameter)
 
void addParameters_ (const ParameterList &parameters)
 
void shareParameter_ (const std::shared_ptr< Parameter > &parameter)
 
void shareParameters_ (const ParameterList &parameters)
 
void includeParameters_ (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_ () override
 

Private Attributes

ParameterList independentParameters_
 
std::map< std::string, std::shared_ptr< AliasParameterListener > > aliasListenersRegister_
 
ParameterList parameters_
 
std::string prefix_
 
Eigen::VectorXd lik_
 

Detailed Description

Definition at line 105 of file AbstractWrappedModel.h.

Constructor & Destructor Documentation

◆ AbstractTotallyWrappedTransitionModel()

bpp::AbstractTotallyWrappedTransitionModel::AbstractTotallyWrappedTransitionModel ( const std::string &  prefix)
inline

Definition at line 109 of file AbstractWrappedModel.h.

◆ ~AbstractTotallyWrappedTransitionModel()

virtual bpp::AbstractTotallyWrappedTransitionModel::~AbstractTotallyWrappedTransitionModel ( )
inlinevirtual

Definition at line 112 of file AbstractWrappedModel.h.

Member Function Documentation

◆ addRateParameter()

◆ alphabet()

const Alphabet& bpp::AbstractWrappedModel::alphabet ( ) const
inlineoverridevirtualinherited

◆ clone() [1/2]

BranchModelInterface* bpp::BranchModelInterface::clone ( ) const
pure virtualinherited

Implements bpp::ParameterAliasable.

Implemented in bpp::ReversibleSubstitutionModelInterface, bpp::SubstitutionModelInterface, bpp::AbstractReversibleProteinSubstitutionModel, bpp::AbstractProteinSubstitutionModel, bpp::ProteinReversibleSubstitutionModelInterface, bpp::ProteinSubstitutionModelInterface, bpp::AbstractReversibleNucleotideSubstitutionModel, bpp::AbstractNucleotideSubstitutionModel, bpp::NucleotideReversibleSubstitutionModelInterface, bpp::NucleotideSubstitutionModelInterface, bpp::MixedTransitionModelInterface, bpp::MarkovModulatedSubstitutionModel, bpp::YNGP_M, bpp::CodonReversibleSubstitutionModelInterface, bpp::CodonSubstitutionModelInterface, bpp::AbstractKroneckerCodonSubstitutionModel, bpp::AbstractDFPSubstitutionModel, bpp::AbstractCodonSubstitutionModel, bpp::AbstractReversibleSubstitutionModel, bpp::AbstractMixedTransitionModel, bpp::WordSubstitutionModel, bpp::TS98, bpp::TransitionFromTransitionModel, bpp::RegisterRatesSubstitutionModel, bpp::RE08Codon, bpp::RE08Protein, bpp::RE08Nucleotide, bpp::RE08, bpp::WAG01, bpp::UserProteinSubstitutionModel, bpp::LLG08_UL3, bpp::LLG08_UL3::EmbeddedModel, bpp::LLG08_UL2, bpp::LLG08_UL2::EmbeddedModel, bpp::LLG08_EX3, bpp::LLG08_EX3::EmbeddedModel, bpp::LLG08_EX2, bpp::LLG08_EX2::EmbeddedModel, bpp::LLG08_EHO, bpp::LLG08_EHO::EmbeddedModel, bpp::LGL08_CAT, bpp::LGL08_CAT::EmbeddedModel, bpp::LG08, bpp::JTT92, bpp::JCprot, bpp::DSO78, bpp::Coala, bpp::POMO, bpp::OneChangeTransitionModel, bpp::OneChangeRegisterTransitionModel, bpp::YpR_Gen, bpp::YpR_Sym, bpp::TN93, bpp::T92, bpp::SSR, bpp::RN95s, bpp::RN95, bpp::L95, bpp::K80, bpp::JCnuc, bpp::GTR, bpp::gBGC, bpp::F81, bpp::MultinomialFromTransitionModel, bpp::MixtureOfTransitionModels, bpp::MixtureOfSubstitutionModels, bpp::MixtureOfATransitionModel, bpp::MixtureOfASubstitutionModel, bpp::KroneckerWordSubstitutionModel, bpp::InMixedSubstitutionModel, bpp::G2001, bpp::FromMixtureSubstitutionModel, bpp::EquiprobableSubstitutionModel, bpp::D1WalkSubstitutionModel, bpp::YNGP_M9, bpp::YNGP_M8, bpp::YNGP_M7, bpp::YNGP_M3, bpp::YNGP_M2, bpp::YNGP_M10, bpp::YNGP_M1, bpp::YN98, bpp::TripletSubstitutionModel, bpp::SENCA, bpp::RELAX, bpp::MG94, bpp::KroneckerCodonDistanceSubstitutionModel, bpp::KroneckerCodonDistanceFrequenciesSubstitutionModel, bpp::KCM, bpp::GY94, bpp::DFPDistanceFrequenciesSubstitutionModel, bpp::DFP07, bpp::CodonSameAARateSubstitutionModel, bpp::CodonDistancePhaseFrequenciesSubstitutionModel, bpp::CodonDistanceFrequenciesSubstitutionModel, bpp::CodonAdHocSubstitutionModel, bpp::AnonymousSubstitutionModel, bpp::TransitionModelInterface, bpp::TwoParameterBinarySubstitutionModel, bpp::LG10_EX_EHO, bpp::LG10_EX_EHO::EmbeddedModel, bpp::HKY85, bpp::F84, bpp::CodonDistanceSubstitutionModel, and bpp::BinarySubstitutionModel.

Referenced by bpp::SubstitutionProcessCollection::addOnePerBranchSubstitutionProcess(), and bpp::NonHomogeneousSubstitutionProcess::createNonHomogeneousSubstitutionProcess().

◆ clone() [2/2]

TransitionModelInterface* bpp::TransitionModelInterface::clone ( ) const
pure virtualinherited

Implements bpp::BranchModelInterface.

Implemented in bpp::ReversibleSubstitutionModelInterface, bpp::SubstitutionModelInterface, bpp::AbstractReversibleProteinSubstitutionModel, bpp::AbstractProteinSubstitutionModel, bpp::ProteinReversibleSubstitutionModelInterface, bpp::ProteinSubstitutionModelInterface, bpp::AbstractReversibleNucleotideSubstitutionModel, bpp::AbstractNucleotideSubstitutionModel, bpp::NucleotideReversibleSubstitutionModelInterface, bpp::NucleotideSubstitutionModelInterface, bpp::MixedTransitionModelInterface, bpp::MarkovModulatedSubstitutionModel, bpp::YNGP_M, bpp::CodonReversibleSubstitutionModelInterface, bpp::CodonSubstitutionModelInterface, bpp::AbstractKroneckerCodonSubstitutionModel, bpp::AbstractDFPSubstitutionModel, bpp::AbstractCodonSubstitutionModel, bpp::AbstractReversibleSubstitutionModel, bpp::AbstractMixedTransitionModel, bpp::WordSubstitutionModel, bpp::TS98, bpp::RegisterRatesSubstitutionModel, bpp::RE08Codon, bpp::RE08Protein, bpp::RE08Nucleotide, bpp::RE08, bpp::WAG01, bpp::UserProteinSubstitutionModel, bpp::LLG08_UL3, bpp::LLG08_UL3::EmbeddedModel, bpp::LLG08_UL2, bpp::LLG08_UL2::EmbeddedModel, bpp::LLG08_EX3, bpp::LLG08_EX3::EmbeddedModel, bpp::LLG08_EX2, bpp::LLG08_EX2::EmbeddedModel, bpp::LLG08_EHO, bpp::LLG08_EHO::EmbeddedModel, bpp::LGL08_CAT, bpp::LGL08_CAT::EmbeddedModel, bpp::LG08, bpp::JTT92, bpp::JCprot, bpp::DSO78, bpp::Coala, bpp::POMO, bpp::OneChangeTransitionModel, bpp::OneChangeRegisterTransitionModel, bpp::YpR_Gen, bpp::YpR_Sym, bpp::TN93, bpp::T92, bpp::SSR, bpp::RN95s, bpp::RN95, bpp::L95, bpp::K80, bpp::JCnuc, bpp::GTR, bpp::gBGC, bpp::F81, bpp::MixtureOfTransitionModels, bpp::MixtureOfSubstitutionModels, bpp::MixtureOfATransitionModel, bpp::MixtureOfASubstitutionModel, bpp::KroneckerWordSubstitutionModel, bpp::InMixedSubstitutionModel, bpp::G2001, bpp::FromMixtureSubstitutionModel, bpp::EquiprobableSubstitutionModel, bpp::D1WalkSubstitutionModel, bpp::YNGP_M9, bpp::YNGP_M8, bpp::YNGP_M7, bpp::YNGP_M3, bpp::YNGP_M2, bpp::YNGP_M10, bpp::YNGP_M1, bpp::YN98, bpp::TripletSubstitutionModel, bpp::SENCA, bpp::RELAX, bpp::MG94, bpp::KroneckerCodonDistanceSubstitutionModel, bpp::KroneckerCodonDistanceFrequenciesSubstitutionModel, bpp::KCM, bpp::GY94, bpp::DFPDistanceFrequenciesSubstitutionModel, bpp::DFP07, bpp::CodonSameAARateSubstitutionModel, bpp::CodonDistancePhaseFrequenciesSubstitutionModel, bpp::CodonDistanceFrequenciesSubstitutionModel, bpp::CodonAdHocSubstitutionModel, bpp::AnonymousSubstitutionModel, bpp::TwoParameterBinarySubstitutionModel, bpp::LG10_EX_EHO, bpp::LG10_EX_EHO::EmbeddedModel, bpp::HKY85, bpp::F84, bpp::CodonDistanceSubstitutionModel, and bpp::BinarySubstitutionModel.

Referenced by bpp::AbstractSinglePhyloSubstitutionMapping::addModel(), bpp::MixtureOfATransitionModel::MixtureOfATransitionModel(), and bpp::AbstractMixedTransitionModel::operator=().

◆ computeFrequencies() [1/2]

bool bpp::AbstractTotallyWrappedTransitionModel::computeFrequencies ( ) const
inlineoverridevirtual
Returns
Says if equilibrium frequencies should be computed

Implements bpp::TransitionModelInterface.

Definition at line 162 of file AbstractWrappedModel.h.

References bpp::TransitionModelInterface::computeFrequencies(), and bpp::WrappedTransitionModelInterface::transitionModel().

Referenced by bpp::DFP07::DFP07(), and bpp::YN98::YN98().

◆ computeFrequencies() [2/2]

void bpp::AbstractTotallyWrappedTransitionModel::computeFrequencies ( bool  yn)
inlineoverridevirtual
Returns
Set if equilibrium frequencies should be computed from the generator

Implements bpp::TransitionModelInterface.

Definition at line 171 of file AbstractWrappedModel.h.

References bpp::TransitionModelInterface::computeFrequencies(), and bpp::AbstractWrappedTransitionModel::transitionModel_().

◆ d2Lik_dt2() [1/2]

virtual const Eigen::VectorXd& bpp::BranchModelInterface::d2Lik_dt2 ( const Eigen::VectorXd &  values,
double  t 
) const
pure virtualinherited

◆ d2Lik_dt2() [2/2]

const Eigen::VectorXd& bpp::AbstractLkTransitionModel::d2Lik_dt2 ( const Eigen::VectorXd &  values,
double  t 
) const
inlineoverridevirtualinherited

◆ d2Pij_dt2()

double bpp::AbstractTotallyWrappedTransitionModel::d2Pij_dt2 ( size_t  i,
size_t  j,
double  t 
) const
inlineoverridevirtual
Returns
The second order derivative of the probability of change from state i to state j with respect to time t, at time t.
See also
getd2Pij_dt2(), getStates()

Implements bpp::TransitionModelInterface.

Definition at line 124 of file AbstractWrappedModel.h.

References bpp::TransitionModelInterface::d2Pij_dt2(), and bpp::WrappedTransitionModelInterface::transitionModel().

◆ dLik_dt() [1/2]

virtual const Eigen::VectorXd& bpp::BranchModelInterface::dLik_dt ( const Eigen::VectorXd &  values,
double  t 
) const
pure virtualinherited

◆ dLik_dt() [2/2]

const Eigen::VectorXd& bpp::AbstractLkTransitionModel::dLik_dt ( const Eigen::VectorXd &  values,
double  t 
) const
inlineoverridevirtualinherited

◆ dPij_dt()

double bpp::AbstractTotallyWrappedTransitionModel::dPij_dt ( size_t  i,
size_t  j,
double  t 
) const
inlineoverridevirtual
Returns
The first order derivative of the probability of change from state i to state j with respect to time t, at time t.
See also
getdPij_dt(), getStates()

Implements bpp::TransitionModelInterface.

Definition at line 123 of file AbstractWrappedModel.h.

References bpp::TransitionModelInterface::dPij_dt(), and bpp::WrappedTransitionModelInterface::transitionModel().

◆ freq()

double bpp::AbstractTotallyWrappedTransitionModel::freq ( size_t  i) const
inlineoverridevirtual

Methods to supersede TransitionModel methods.

Implements bpp::TransitionModelInterface.

Definition at line 120 of file AbstractWrappedModel.h.

References bpp::TransitionModelInterface::freq(), and bpp::WrappedTransitionModelInterface::transitionModel().

◆ frequencySet()

const FrequencySetInterface& bpp::AbstractWrappedTransitionModel::frequencySet ( ) const
inlineoverridevirtualinherited
Returns
Get the FrequencySet of equilibrium of this model.
Exceptions
Exceptionif no FrequenceSet is associated to this model.

Reimplemented from bpp::AbstractWrappedModel.

Reimplemented in bpp::RegisterRatesSubstitutionModel, bpp::OneChangeTransitionModel, bpp::OneChangeRegisterTransitionModel, and bpp::YN98.

Definition at line 93 of file AbstractWrappedModel.h.

References bpp::BranchModelInterface::frequencySet(), and bpp::WrappedTransitionModelInterface::transitionModel().

Referenced by bpp::RegisterRatesSubstitutionModel::frequencySet().

◆ getAlphabet()

std::shared_ptr<const Alphabet> bpp::AbstractWrappedModel::getAlphabet ( ) const
inlineoverridevirtualinherited

◆ getAlphabetStateAsChar()

std::string bpp::AbstractWrappedModel::getAlphabetStateAsChar ( size_t  index) const
inlineoverridevirtualinherited
Parameters
indexThe model state.
Returns
The corresponding alphabet state as character code.

Implements bpp::BranchModelInterface.

Reimplemented in bpp::RegisterRatesSubstitutionModel.

Definition at line 46 of file AbstractWrappedModel.h.

References bpp::BranchModelInterface::getAlphabetStateAsChar(), and bpp::WrappedModelInterface::model().

Referenced by bpp::RegisterRatesSubstitutionModel::getAlphabetStateAsChar().

◆ getAlphabetStateAsInt()

int bpp::AbstractWrappedModel::getAlphabetStateAsInt ( size_t  index) const
inlineoverridevirtualinherited
Parameters
indexThe model state.
Returns
The corresponding alphabet state as character code.

Implements bpp::BranchModelInterface.

Reimplemented in bpp::RegisterRatesSubstitutionModel.

Definition at line 44 of file AbstractWrappedModel.h.

References bpp::BranchModelInterface::getAlphabetStateAsInt(), and bpp::WrappedModelInterface::model().

Referenced by bpp::RegisterRatesSubstitutionModel::getAlphabetStateAsInt().

◆ getAlphabetStates()

const std::vector<int>& bpp::AbstractWrappedModel::getAlphabetStates ( ) const
inlineoverridevirtualinherited

@ brief Methods to supersede TransitionModel methods.

Implements bpp::BranchModelInterface.

Reimplemented in bpp::RegisterRatesSubstitutionModel.

Definition at line 38 of file AbstractWrappedModel.h.

References bpp::BranchModelInterface::getAlphabetStates(), and bpp::WrappedModelInterface::model().

Referenced by bpp::RegisterRatesSubstitutionModel::getAlphabetStates().

◆ getd2Pij_dt2()

const Matrix<double>& bpp::AbstractTotallyWrappedTransitionModel::getd2Pij_dt2 ( double  t) const
inlineoverridevirtual
Returns
All second order derivatives of the probability of change from state i to state j with respect to time t, at time t.
See also
d2Pij_dt2()

Implements bpp::TransitionModelInterface.

Definition at line 132 of file AbstractWrappedModel.h.

References bpp::TransitionModelInterface::getd2Pij_dt2(), and bpp::WrappedTransitionModelInterface::transitionModel().

◆ getdPij_dt()

const Matrix<double>& bpp::AbstractTotallyWrappedTransitionModel::getdPij_dt ( double  t) const
inlineoverridevirtual
Returns
Get all first order derivatives of the probability of change from state i to state j with respect to time t, at time t.
See also
dPij_dt()

Implements bpp::TransitionModelInterface.

Definition at line 130 of file AbstractWrappedModel.h.

References bpp::TransitionModelInterface::getdPij_dt(), and bpp::WrappedTransitionModelInterface::transitionModel().

◆ getFrequencies()

const Vdouble& bpp::AbstractTotallyWrappedTransitionModel::getFrequencies ( ) const
inlineoverridevirtual
Returns
A vector of all equilibrium frequencies.
See also
freq()

Implements bpp::TransitionModelInterface.

Definition at line 126 of file AbstractWrappedModel.h.

References bpp::TransitionModelInterface::getFrequencies(), and bpp::WrappedTransitionModelInterface::transitionModel().

◆ getFrequencies_()

Vdouble& bpp::AbstractTotallyWrappedTransitionModel::getFrequencies_ ( )
inlineoverrideprotectedvirtual

◆ getInitValue()

double bpp::AbstractTotallyWrappedTransitionModel::getInitValue ( size_t  i,
int  state 
) const
inlineoverridevirtual

This method is used to initialize likelihoods in recursions. It typically sends 1 if i = state, 0 otherwise, where i is one of the possible states of the alphabet allowed in the model and state is the observed state in the considered sequence/site.

Parameters
ithe index of the state in the model.
stateAn observed state in the sequence/site.
Returns
1 or 0 depending if the two states are compatible.
Exceptions
IndexOutOfBoundsExceptionif array position is out of range.
BadIntExceptionif states are not allowed in the associated alphabet.
See also
getStates();

Implements bpp::BranchModelInterface.

Definition at line 134 of file AbstractWrappedModel.h.

References bpp::BranchModelInterface::getInitValue(), and bpp::WrappedTransitionModelInterface::transitionModel().

◆ getModelStates() [1/2]

std::vector<size_t> bpp::AbstractWrappedModel::getModelStates ( const std::string &  code) const
inlineoverridevirtualinherited

Get the state in the model corresponding to a particular state in the alphabet.

Parameters
codeThe alphabet state to check.
Returns
A vector of indices of model states.

Implements bpp::BranchModelInterface.

Reimplemented in bpp::RegisterRatesSubstitutionModel.

Definition at line 50 of file AbstractWrappedModel.h.

References bpp::BranchModelInterface::getModelStates(), and bpp::WrappedModelInterface::model().

◆ getModelStates() [2/2]

std::vector<size_t> bpp::AbstractWrappedModel::getModelStates ( int  code) const
inlineoverridevirtualinherited

Get the state in the model corresponding to a particular state in the alphabet.

Parameters
codeThe alphabet state to check.
Returns
A vector of indices of model states.

Implements bpp::BranchModelInterface.

Reimplemented in bpp::RegisterRatesSubstitutionModel.

Definition at line 48 of file AbstractWrappedModel.h.

References bpp::BranchModelInterface::getModelStates(), and bpp::WrappedModelInterface::model().

Referenced by bpp::RegisterRatesSubstitutionModel::getModelStates().

◆ getName()

◆ getNumberOfStates()

size_t bpp::AbstractWrappedModel::getNumberOfStates ( ) const
inlineoverridevirtualinherited

Get the number of states.

For most models, this equals the size of the alphabet.

See also
getAlphabetChars for the list of supported states.
Returns
The number of different states in the model.

Implements bpp::BranchModelInterface.

Reimplemented in bpp::RegisterRatesSubstitutionModel.

Definition at line 57 of file AbstractWrappedModel.h.

References bpp::BranchModelInterface::getNumberOfStates(), and bpp::WrappedModelInterface::model().

◆ getPij_t()

const Matrix<double>& bpp::AbstractTotallyWrappedTransitionModel::getPij_t ( double  t) const
inlineoverridevirtual
Returns
All probabilities of change from state i to state j during time t.
See also
Pij_t()

Implements bpp::TransitionModelInterface.

Definition at line 128 of file AbstractWrappedModel.h.

References bpp::TransitionModelInterface::getPij_t(), and bpp::WrappedTransitionModelInterface::transitionModel().

◆ getRate()

double bpp::AbstractTotallyWrappedTransitionModel::getRate ( ) const
inlineoverridevirtual

◆ getStateMap()

std::shared_ptr<const StateMapInterface> bpp::AbstractWrappedModel::getStateMap ( ) const
inlineoverridevirtualinherited
Returns
A shared_ptr to the mapping of model states with alphabet states.

Implements bpp::BranchModelInterface.

Reimplemented in bpp::RegisterRatesSubstitutionModel.

Definition at line 42 of file AbstractWrappedModel.h.

References bpp::BranchModelInterface::getStateMap(), and bpp::WrappedModelInterface::model().

Referenced by bpp::RegisterRatesSubstitutionModel::getStateMap().

◆ Lik_t() [1/2]

virtual const Eigen::VectorXd& bpp::BranchModelInterface::Lik_t ( const Eigen::VectorXd &  values,
double  t 
) const
pure virtualinherited

This method is used to compute likelihoods in recursions. It computes the probability of a vector given a start state.

Parameters
valuesAn vector of states on the site.
ttime
Exceptions
IndexOutOfBoundsExceptionif array position is out of range.
BadIntExceptionif states are not allowed in the associated alphabet.

Implemented in bpp::AbstractLkTransitionModel, bpp::TransitionModelInterface, bpp::TransitionFromTransitionModel, and bpp::MultinomialFromTransitionModel.

◆ Lik_t() [2/2]

const Eigen::VectorXd& bpp::AbstractLkTransitionModel::Lik_t ( const Eigen::VectorXd &  values,
double  t 
) const
inlineoverridevirtualinherited

This method is used to compute likelihoods in recursions. It computes the probability of a vector given a start state.

Parameters
valuesAn vector of states on the site.
tthe branch length

Implements bpp::TransitionModelInterface.

Definition at line 30 of file AbstractSubstitutionModel.h.

References bpp::TransitionModelInterface::getPij_t(), and bpp::AbstractLkTransitionModel::lik_.

◆ model()

◆ model_()

◆ Pij_t()

double bpp::AbstractTotallyWrappedTransitionModel::Pij_t ( size_t  i,
size_t  j,
double  t 
) const
inlineoverridevirtual
Returns
The probability of change from state i to state j during time t.
See also
getPij_t(), getStates()

Implements bpp::TransitionModelInterface.

Definition at line 122 of file AbstractWrappedModel.h.

References bpp::TransitionModelInterface::Pij_t(), and bpp::WrappedTransitionModelInterface::transitionModel().

◆ setFreq()

void bpp::AbstractTotallyWrappedTransitionModel::setFreq ( std::map< int, double > &  frequencies)
inlineoverridevirtual

Set equilibrium frequencies.

Parameters
frequenciesThe map of the frequencies to use.

Implements bpp::TransitionModelInterface.

Reimplemented in bpp::YN98, bpp::MG94, and bpp::KCM.

Definition at line 157 of file AbstractWrappedModel.h.

References bpp::TransitionModelInterface::setFreq(), and bpp::AbstractWrappedTransitionModel::transitionModel_().

Referenced by bpp::AbstractBiblioTransitionModel::setFreq().

◆ setFreqFromData()

void bpp::AbstractTotallyWrappedTransitionModel::setFreqFromData ( const SequenceDataInterface data,
double  pseudoCount = 0 
)
inlineoverridevirtual

Set equilibrium frequencies equal to the frequencies estimated from the data.

Parameters
dataThe sequences to use.
pseudoCountA quantity $\psi$ to add to adjust the observed values in order to prevent issues due to missing states on small data set. The corrected frequencies shall be computed as

\[ \pi_i = \frac{n_i+\psi}{\sum_j (f_j+\psi)} \]

Implements bpp::TransitionModelInterface.

Definition at line 149 of file AbstractWrappedModel.h.

References bpp::SequenceContainerTools::getFrequencies(), bpp::TransitionModelInterface::setFreq(), and bpp::AbstractWrappedTransitionModel::transitionModel_().

◆ setRate()

void bpp::AbstractTotallyWrappedTransitionModel::setRate ( double  rate)
inlineoverridevirtual

Set the rate of the model (must be positive).

Parameters
ratemust be positive.

Implements bpp::BranchModelInterface.

Definition at line 144 of file AbstractWrappedModel.h.

References bpp::BranchModelInterface::setRate(), and bpp::AbstractWrappedTransitionModel::transitionModel_().

◆ stateMap()

const StateMapInterface& bpp::AbstractWrappedModel::stateMap ( ) const
inlineoverridevirtualinherited
Returns
The mapping of model states with alphabet states.

Implements bpp::BranchModelInterface.

Reimplemented in bpp::RegisterRatesSubstitutionModel.

Definition at line 40 of file AbstractWrappedModel.h.

References bpp::WrappedModelInterface::model(), and bpp::BranchModelInterface::stateMap().

Referenced by bpp::RegisterRatesSubstitutionModel::stateMap().

◆ transitionModel()

◆ transitionModel_()

Member Data Documentation

◆ lik_

Eigen::VectorXd bpp::AbstractLkTransitionModel::lik_
mutableprivateinherited

The documentation for this class was generated from the following file: