bpp-phyl  2.2.0
bpp::AbstractBiblioMixedSubstitutionModel Class Referenceabstract

Abstract class for mixture models based on the bibliography. More...

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

+ Inheritance diagram for bpp::AbstractBiblioMixedSubstitutionModel:
+ Collaboration diagram for bpp::AbstractBiblioMixedSubstitutionModel:

Public Member Functions

 AbstractBiblioMixedSubstitutionModel (const std::string &prefix)
 
 AbstractBiblioMixedSubstitutionModel (const AbstractBiblioMixedSubstitutionModel &model)
 
AbstractBiblioMixedSubstitutionModeloperator= (const AbstractBiblioMixedSubstitutionModel &model)
 
virtual ~AbstractBiblioMixedSubstitutionModel ()
 
virtual AbstractBiblioMixedSubstitutionModelclone () const =0
 
virtual const MixedSubstitutionModelgetMixedModel () const =0
 
const SubstitutionModelgetNModel (size_t i) const
 Returns a specific model from the mixture. More...
 
SubstitutionModelgetNModel (size_t i)
 
double getNProbability (size_t i) const
 Returns the probability of a specific model from the mixture. More...
 
const std::vector< double > & getProbabilities () const
 Returns the vector of the probabilities of the submodels of the mixture. More...
 
void setNProbability (size_t i, double prob)
 Sets the probabilities of the submodels of the mixture. More...
 
size_t getNumberOfModels () const
 Returns the number of submodels. More...
 
void setVRates (const Vdouble &vd)
 sets the rates of the submodels. More...
 
void normalizeVRates ()
 normalizes the rates of the submodels. More...
 
const std::vector< double > & getVRates () const
 Returns the vector of all the rates of the mixture. More...
 
double getNRate (size_t i) const
 Returns the rate of a specific model from the mixture. More...
 
Vint getSubmodelNumbers (std::string &desc) const
 
virtual std::string getName () const =0
 Get the name of the model. More...
 
virtual const std::vector< int > & getAlphabetStates () const =0
 
virtual const StateMapgetStateMap () const =0
 
virtual std::vector< size_t > getModelStates (int code) const =0
 Get the state in the model corresponding to a particular state in the alphabet. More...
 
virtual std::vector< size_t > getModelStates (const std::string &code) const =0
 Get the state in the model corresponding to a particular state in the alphabet. More...
 
virtual int getAlphabetStateAsInt (size_t index) const =0
 
virtual std::string getAlphabetStateAsChar (size_t index) const =0
 
virtual double freq (size_t i) const =0
 
virtual double Qij (size_t i, size_t j) const =0
 
virtual double Pij_t (size_t i, size_t j, double t) const =0
 
virtual double dPij_dt (size_t i, size_t j, double t) const =0
 
virtual double d2Pij_dt2 (size_t i, size_t j, double t) const =0
 
virtual const Vdouble & getFrequencies () const =0
 
virtual const Matrix< double > & getGenerator () const =0
 
virtual const Matrix< double > & getExchangeabilityMatrix () const =0
 
virtual double Sij (size_t i, size_t j) const =0
 
virtual const Matrix< double > & getPij_t (double t) const =0
 
virtual const Matrix< double > & getdPij_dt (double t) const =0
 
virtual const Matrix< double > & getd2Pij_dt2 (double t) const =0
 
virtual void enableEigenDecomposition (bool yn)=0
 Set if eigenValues and Vectors must be computed. More...
 
virtual bool enableEigenDecomposition ()=0
 Tell if eigenValues and Vectors must be computed. More...
 
virtual const Vdouble & getEigenValues () const =0
 
virtual const Vdouble & getIEigenValues () const =0
 
virtual bool isDiagonalizable () const =0
 
virtual bool isNonSingular () const =0
 
virtual const Matrix< double > & getRowLeftEigenVectors () const =0
 
virtual const Matrix< double > & getColumnRightEigenVectors () const =0
 
virtual const Alphabet * getAlphabet () const =0
 
virtual size_t getNumberOfStates () const =0
 Get the number of states. More...
 
virtual double getInitValue (size_t i, int state) const =0 throw (IndexOutOfBoundsException, BadIntException)
 
virtual double getScale () const =0
 Get the scalar product of diagonal elements of the generator and the frequencies vector. If the generator is normalized, then scale=1. Otherwise each element must be multiplied by 1/scale. More...
 
virtual void setScale (double scale)=0
 Multiplies the current generator by the given scale. More...
 
virtual double getRate () const =0
 Get the rate. More...
 
virtual void setRate (double rate)=0
 Set the rate of the model (must be positive). More...
 
virtual void addRateParameter ()=0
 
virtual void setFreqFromData (const SequenceContainer &data, double pseudoCount=0)=0
 Set equilibrium frequencies equal to the frequencies estimated from the data. More...
 
virtual void setFreq (std::map< int, double > &frequencies)
 Set equilibrium frequencies. More...
 
virtual const FrequenciesSetgetFrequenciesSet () const
 If the model owns a FrequenciesSet, returns a pointer to it, otherwise return 0. More...
 
virtual const SubstitutionModelgetModel () const =0
 
const std::vector< int > & getAlphabetStates () const
 
const StateMapgetStateMap () const
 
int getAlphabetStateAsInt (size_t i) const
 
std::string getAlphabetStateAsChar (size_t i) const
 
std::vector< size_t > getModelStates (int code) const
 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
 Get the state in the model corresponding to a particular state in the alphabet. More...
 
virtual double freq (size_t i) const
 
virtual double Qij (size_t i, size_t j) const
 
virtual double Pij_t (size_t i, size_t j, double t) const
 
virtual double dPij_dt (size_t i, size_t j, double t) const
 
virtual double d2Pij_dt2 (size_t i, size_t j, double t) const
 
virtual const Vdouble & getFrequencies () const
 
const Matrix< double > & getGenerator () const
 
const Matrix< double > & getExchangeabilityMatrix () const
 
double Sij (size_t i, size_t j) const
 
const Matrix< double > & getPij_t (double t) const
 
const Matrix< double > & getdPij_dt (double t) const
 
const Matrix< double > & getd2Pij_dt2 (double t) const
 
void enableEigenDecomposition (bool yn)
 Set if eigenValues and Vectors must be computed. More...
 
bool enableEigenDecomposition ()
 Tell if eigenValues and Vectors must be computed. More...
 
bool isDiagonalizable () const
 
bool isNonSingular () const
 
const Vdouble & getEigenValues () const
 
const Vdouble & getIEigenValues () const
 
const Matrix< double > & getRowLeftEigenVectors () const
 
const Matrix< double > & getColumnRightEigenVectors () const
 
double getRate () const
 Get the rate. More...
 
void setRate (double rate)
 Set the rate of the model (must be positive). More...
 
void addRateParameter ()
 
void setFreqFromData (const SequenceContainer &data, double pseudoCount=0)
 Set equilibrium frequencies equal to the frequencies estimated from the data. More...
 
void setFreq (std::map< int, double > &frequ)
 Set equilibrium frequencies. More...
 
const Alphabet * getAlphabet () const
 
size_t getNumberOfStates () const
 Get the number of states. More...
 
double getInitValue (size_t i, int state) const throw (BadIntException)
 
const FrequenciesSetgetFrequenciesSet () const
 If the model owns a FrequenciesSet, returns a pointer to it, otherwise return 0. More...
 
virtual void fireParameterChanged (const ParameterList &parameters)
 Tells the model that a parameter value has changed. More...
 
double getScale () const
 Get the scalar product of diagonal elements of the generator and the frequencies vector. If the generator is normalized, then scale=1. Otherwise each element must be multiplied by 1/scale. More...
 
void setScale (double scale)
 Multiplies the current generator by the given scale. More...
 

Protected Member Functions

virtual SubstitutionModelgetModel ()=0
 
virtual void updateMatrices ()
 

Protected Attributes

std::map< std::string, std::string > mapParNamesFromPmodel_
 Tools to make the link between the Parameters of the object and those of pmixmodel_. More...
 
ParameterList lParPmodel_
 

Private Member Functions

virtual MixedSubstitutionModelgetMixedModel ()=0
 

Detailed Description

Abstract class for mixture models based on the bibliography.

Author
Laurent Guéguen

Definition at line 53 of file AbstractBiblioMixedSubstitutionModel.h.

Constructor & Destructor Documentation

◆ AbstractBiblioMixedSubstitutionModel() [1/2]

AbstractBiblioMixedSubstitutionModel::AbstractBiblioMixedSubstitutionModel ( const std::string &  prefix)

Definition at line 46 of file AbstractBiblioMixedSubstitutionModel.cpp.

◆ AbstractBiblioMixedSubstitutionModel() [2/2]

AbstractBiblioMixedSubstitutionModel::AbstractBiblioMixedSubstitutionModel ( const AbstractBiblioMixedSubstitutionModel model)

Definition at line 50 of file AbstractBiblioMixedSubstitutionModel.cpp.

◆ ~AbstractBiblioMixedSubstitutionModel()

AbstractBiblioMixedSubstitutionModel::~AbstractBiblioMixedSubstitutionModel ( )
virtual

Definition at line 59 of file AbstractBiblioMixedSubstitutionModel.cpp.

Member Function Documentation

◆ addRateParameter() [1/2]

◆ addRateParameter() [2/2]

virtual void bpp::SubstitutionModel::addRateParameter ( )
pure virtualinherited

◆ clone()

◆ d2Pij_dt2() [1/2]

virtual double bpp::AbstractBiblioSubstitutionModel::d2Pij_dt2 ( size_t  i,
size_t  j,
double  t 
) const
inlinevirtualinherited
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::SubstitutionModel.

Definition at line 112 of file AbstractBiblioSubstitutionModel.h.

References bpp::SubstitutionModel::d2Pij_dt2(), and bpp::AbstractBiblioSubstitutionModel::getModel().

◆ d2Pij_dt2() [2/2]

virtual double bpp::SubstitutionModel::d2Pij_dt2 ( size_t  i,
size_t  j,
double  t 
) const
pure virtualinherited
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()

Implemented in bpp::AbstractSubstitutionModel, bpp::MarkovModulatedSubstitutionModel, bpp::F84, bpp::HKY85, bpp::JCprot, bpp::T92, bpp::K80, bpp::RN95, bpp::TN93, bpp::RE08, bpp::JCnuc, bpp::RN95s, bpp::BinarySubstitutionModel, and bpp::AbstractBiblioSubstitutionModel.

Referenced by bpp::AbstractBiblioSubstitutionModel::d2Pij_dt2().

◆ dPij_dt() [1/2]

virtual double bpp::AbstractBiblioSubstitutionModel::dPij_dt ( size_t  i,
size_t  j,
double  t 
) const
inlinevirtualinherited
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::SubstitutionModel.

Definition at line 111 of file AbstractBiblioSubstitutionModel.h.

References bpp::SubstitutionModel::dPij_dt(), and bpp::AbstractBiblioSubstitutionModel::getModel().

◆ dPij_dt() [2/2]

virtual double bpp::SubstitutionModel::dPij_dt ( size_t  i,
size_t  j,
double  t 
) const
pure virtualinherited
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()

Implemented in bpp::AbstractSubstitutionModel, bpp::MarkovModulatedSubstitutionModel, bpp::F84, bpp::HKY85, bpp::JCprot, bpp::T92, bpp::K80, bpp::RN95, bpp::TN93, bpp::RE08, bpp::JCnuc, bpp::RN95s, bpp::BinarySubstitutionModel, and bpp::AbstractBiblioSubstitutionModel.

Referenced by bpp::AbstractBiblioSubstitutionModel::dPij_dt().

◆ enableEigenDecomposition() [1/4]

void bpp::AbstractBiblioSubstitutionModel::enableEigenDecomposition ( bool  yn)
inlinevirtualinherited

Set if eigenValues and Vectors must be computed.

Implements bpp::SubstitutionModel.

Definition at line 128 of file AbstractBiblioSubstitutionModel.h.

References bpp::SubstitutionModel::enableEigenDecomposition(), and bpp::AbstractBiblioSubstitutionModel::getModel().

◆ enableEigenDecomposition() [2/4]

bool bpp::AbstractBiblioSubstitutionModel::enableEigenDecomposition ( )
inlinevirtualinherited

Tell if eigenValues and Vectors must be computed.

Implements bpp::SubstitutionModel.

Definition at line 130 of file AbstractBiblioSubstitutionModel.h.

References bpp::SubstitutionModel::enableEigenDecomposition(), and bpp::AbstractBiblioSubstitutionModel::getModel().

◆ enableEigenDecomposition() [3/4]

virtual void bpp::SubstitutionModel::enableEigenDecomposition ( bool  yn)
pure virtualinherited

◆ enableEigenDecomposition() [4/4]

virtual bool bpp::SubstitutionModel::enableEigenDecomposition ( )
pure virtualinherited

Tell if eigenValues and Vectors must be computed.

Implemented in bpp::AbstractSubstitutionModel, bpp::MarkovModulatedSubstitutionModel, and bpp::AbstractBiblioSubstitutionModel.

◆ fireParameterChanged()

virtual void bpp::AbstractBiblioSubstitutionModel::fireParameterChanged ( const ParameterList &  parameters)
inlinevirtualinherited

Tells the model that a parameter value has changed.

This updates the matrices consequently.

Definition at line 177 of file AbstractBiblioSubstitutionModel.h.

References bpp::AbstractBiblioSubstitutionModel::updateMatrices().

◆ freq() [1/2]

virtual double bpp::AbstractBiblioSubstitutionModel::freq ( size_t  i) const
inlinevirtualinherited
Returns
Equilibrium frequency associated to character i.
See also
getFrequencies(), getStates()

Implements bpp::SubstitutionModel.

Definition at line 106 of file AbstractBiblioSubstitutionModel.h.

References bpp::SubstitutionModel::freq(), and bpp::AbstractBiblioSubstitutionModel::getModel().

◆ freq() [2/2]

virtual double bpp::SubstitutionModel::freq ( size_t  i) const
pure virtualinherited

◆ getAlphabet() [1/2]

const Alphabet* bpp::AbstractBiblioSubstitutionModel::getAlphabet ( ) const
inlinevirtualinherited
Returns
Get the alphabet associated to this model.

Implements bpp::SubstitutionModel.

Definition at line 153 of file AbstractBiblioSubstitutionModel.h.

References bpp::SubstitutionModel::getAlphabet(), and bpp::AbstractBiblioSubstitutionModel::getModel().

◆ getAlphabet() [2/2]

virtual const Alphabet* bpp::SubstitutionModel::getAlphabet ( ) const
pure virtualinherited
Returns
Get the alphabet associated to this model.

Implemented in bpp::AbstractSubstitutionModel, bpp::MarkovModulatedSubstitutionModel, and bpp::AbstractBiblioSubstitutionModel.

Referenced by bpp::AAExteriorSubstitutionRegister::AAExteriorSubstitutionRegister(), bpp::AAInteriorSubstitutionRegister::AAInteriorSubstitutionRegister(), bpp::SubstitutionModelSet::addModel(), bpp::DecompositionReward::alphabetIndexHasChanged(), bpp::ComprehensiveSubstitutionRegister::ComprehensiveSubstitutionRegister(), bpp::DecompositionReward::DecompositionReward(), bpp::DecompositionSubstitutionCount::DecompositionSubstitutionCount(), bpp::AbstractMutationProcess::detailedEvolve(), bpp::LaplaceSubstitutionCount::getAllNumbersOfSubstitutions(), bpp::AbstractSubstitutionRegister::getAlphabet(), bpp::AbstractBiblioSubstitutionModel::getAlphabet(), bpp::MarkovModulatedSubstitutionModel::getAlphabet(), bpp::SubstitutionMappingTools::getNormalizationsPerBranch(), bpp::DnDsSubstitutionRegister::getType(), bpp::SelectedSubstitutionRegister::SelectedSubstitutionRegister(), bpp::CategorySubstitutionRegister::setCategories(), bpp::LaplaceSubstitutionCount::setSubstitutionModel(), bpp::UniformizationSubstitutionCount::setSubstitutionModel(), bpp::DecompositionSubstitutionCount::setSubstitutionModel(), bpp::DecompositionReward::setSubstitutionModel(), bpp::UniformizationSubstitutionCount::substitutionRegisterHasChanged(), bpp::DecompositionSubstitutionCount::substitutionRegisterHasChanged(), bpp::UniformizationSubstitutionCount::UniformizationSubstitutionCount(), bpp::YpR::updateMatrices(), and bpp::BppOSubstitutionModelFormat::writeMixed_().

◆ getAlphabetStateAsChar() [1/2]

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

Implements bpp::SubstitutionModel.

Definition at line 100 of file AbstractBiblioSubstitutionModel.h.

References bpp::SubstitutionModel::getAlphabetStateAsChar(), and bpp::AbstractBiblioSubstitutionModel::getModel().

◆ getAlphabetStateAsChar() [2/2]

virtual std::string bpp::SubstitutionModel::getAlphabetStateAsChar ( size_t  index) const
pure virtualinherited

◆ getAlphabetStateAsInt() [1/2]

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

Implements bpp::SubstitutionModel.

Definition at line 98 of file AbstractBiblioSubstitutionModel.h.

References bpp::SubstitutionModel::getAlphabetStateAsInt(), and bpp::AbstractBiblioSubstitutionModel::getModel().

◆ getAlphabetStateAsInt() [2/2]

◆ getAlphabetStates() [1/2]

const std::vector<int>& bpp::AbstractBiblioSubstitutionModel::getAlphabetStates ( ) const
inlinevirtualinherited
Returns
The alphabet states of each state of the model, as a vector of int codes.
See also
Alphabet

Implements bpp::SubstitutionModel.

Definition at line 94 of file AbstractBiblioSubstitutionModel.h.

References bpp::SubstitutionModel::getAlphabetStates(), and bpp::AbstractBiblioSubstitutionModel::getModel().

Referenced by bpp::YNGKP_M1::YNGKP_M1(), bpp::YNGKP_M2::YNGKP_M2(), bpp::YNGKP_M3::YNGKP_M3(), bpp::YNGKP_M7::YNGKP_M7(), and bpp::YNGKP_M8::YNGKP_M8().

◆ getAlphabetStates() [2/2]

◆ getColumnRightEigenVectors() [1/2]

const Matrix<double>& bpp::AbstractBiblioSubstitutionModel::getColumnRightEigenVectors ( ) const
inlinevirtualinherited
Returns
A matrix with right eigen vectors. Each column in the matrix stands for an eigen vector.

Implements bpp::SubstitutionModel.

Definition at line 141 of file AbstractBiblioSubstitutionModel.h.

References bpp::SubstitutionModel::getColumnRightEigenVectors(), and bpp::AbstractBiblioSubstitutionModel::getModel().

◆ getColumnRightEigenVectors() [2/2]

virtual const Matrix<double>& bpp::SubstitutionModel::getColumnRightEigenVectors ( ) const
pure virtualinherited

◆ getd2Pij_dt2() [1/2]

const Matrix<double>& bpp::AbstractBiblioSubstitutionModel::getd2Pij_dt2 ( double  t) const
inlinevirtualinherited
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::SubstitutionModel.

Definition at line 126 of file AbstractBiblioSubstitutionModel.h.

References bpp::SubstitutionModel::getd2Pij_dt2(), and bpp::AbstractBiblioSubstitutionModel::getModel().

◆ getd2Pij_dt2() [2/2]

◆ getdPij_dt() [1/2]

const Matrix<double>& bpp::AbstractBiblioSubstitutionModel::getdPij_dt ( double  t) const
inlinevirtualinherited
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::SubstitutionModel.

Definition at line 124 of file AbstractBiblioSubstitutionModel.h.

References bpp::SubstitutionModel::getdPij_dt(), and bpp::AbstractBiblioSubstitutionModel::getModel().

◆ getdPij_dt() [2/2]

◆ getEigenValues() [1/2]

const Vdouble& bpp::AbstractBiblioSubstitutionModel::getEigenValues ( ) const
inlinevirtualinherited
Returns
A vector with all real parts of the eigen values of the generator of this model;

Implements bpp::SubstitutionModel.

Definition at line 136 of file AbstractBiblioSubstitutionModel.h.

References bpp::SubstitutionModel::getEigenValues(), and bpp::AbstractBiblioSubstitutionModel::getModel().

◆ getEigenValues() [2/2]

virtual const Vdouble& bpp::SubstitutionModel::getEigenValues ( ) const
pure virtualinherited

◆ getExchangeabilityMatrix() [1/2]

const Matrix<double>& bpp::AbstractBiblioSubstitutionModel::getExchangeabilityMatrix ( ) const
inlinevirtualinherited
Returns
The matrix of exchangeability terms. It is recommended that exchangeability matrix be normalized so that the normalized generator be obtained directly by the dot product $S . \pi$.

Implements bpp::SubstitutionModel.

Definition at line 118 of file AbstractBiblioSubstitutionModel.h.

References bpp::SubstitutionModel::getExchangeabilityMatrix(), and bpp::AbstractBiblioSubstitutionModel::getModel().

◆ getExchangeabilityMatrix() [2/2]

virtual const Matrix<double>& bpp::SubstitutionModel::getExchangeabilityMatrix ( ) const
pure virtualinherited
Returns
The matrix of exchangeability terms. It is recommended that exchangeability matrix be normalized so that the normalized generator be obtained directly by the dot product $S . \pi$.

Implemented in bpp::AbstractSubstitutionModel, bpp::MarkovModulatedSubstitutionModel, and bpp::AbstractBiblioSubstitutionModel.

Referenced by bpp::Coala::Coala(), bpp::AbstractBiblioSubstitutionModel::getExchangeabilityMatrix(), and bpp::MarkovModulatedSubstitutionModel::updateMatrices().

◆ getFrequencies() [1/2]

virtual const Vdouble& bpp::AbstractBiblioSubstitutionModel::getFrequencies ( ) const
inlinevirtualinherited
Returns
A vector of all equilibrium frequencies.
See also
freq()

Implements bpp::SubstitutionModel.

Definition at line 114 of file AbstractBiblioSubstitutionModel.h.

References bpp::SubstitutionModel::getFrequencies(), and bpp::AbstractBiblioSubstitutionModel::getModel().

◆ getFrequencies() [2/2]

◆ getFrequenciesSet() [1/2]

const FrequenciesSet* bpp::AbstractBiblioSubstitutionModel::getFrequenciesSet ( ) const
inlinevirtualinherited

If the model owns a FrequenciesSet, returns a pointer to it, otherwise return 0.

Reimplemented from bpp::SubstitutionModel.

Reimplemented in bpp::YNGKP_M1, bpp::YNGKP_M8, bpp::YNGKP_M7, bpp::YNGKP_M3, and bpp::YNGKP_M2.

Definition at line 159 of file AbstractBiblioSubstitutionModel.h.

References bpp::SubstitutionModel::getFrequenciesSet(), and bpp::AbstractBiblioSubstitutionModel::getModel().

◆ getFrequenciesSet() [2/2]

◆ getGenerator() [1/2]

const Matrix<double>& bpp::AbstractBiblioSubstitutionModel::getGenerator ( ) const
inlinevirtualinherited
Returns
The normalized Markov generator matrix, i.e. all normalized rates of changes from state i to state j. The generator is normalized so that (i) $ \forall i; \sum_j Q_{i,j} = 0 $, meaning that $ $ \forall i; Q_{i,i} = -\sum_{j \neq i}Q_{i,j}$, and (ii) $ \sum_i Q_{i,i} \times \pi_i = -1$. This means that, under normalization, the mean rate of replacement at equilibrium is 1 and that time $t$ are measured in units of expected number of changes per site. Additionnaly, the rate_ attibute provides the possibility to increase or decrease this mean rate.

See Kosiol and Goldman (2005), Molecular Biology And Evolution 22(2) 193-9.

See also
Qij()

Implements bpp::SubstitutionModel.

Definition at line 116 of file AbstractBiblioSubstitutionModel.h.

References bpp::SubstitutionModel::getGenerator(), and bpp::AbstractBiblioSubstitutionModel::getModel().

◆ getGenerator() [2/2]

virtual const Matrix<double>& bpp::SubstitutionModel::getGenerator ( ) const
pure virtualinherited
Returns
The normalized Markov generator matrix, i.e. all normalized rates of changes from state i to state j. The generator is normalized so that (i) $ \forall i; \sum_j Q_{i,j} = 0 $, meaning that $ $ \forall i; Q_{i,i} = -\sum_{j \neq i}Q_{i,j}$, and (ii) $ \sum_i Q_{i,i} \times \pi_i = -1$. This means that, under normalization, the mean rate of replacement at equilibrium is 1 and that time $t$ are measured in units of expected number of changes per site. Additionnaly, the rate_ attibute provides the possibility to increase or decrease this mean rate.

See Kosiol and Goldman (2005), Molecular Biology And Evolution 22(2) 193-9.

See also
Qij()

Implemented in bpp::AbstractSubstitutionModel, bpp::MarkovModulatedSubstitutionModel, and bpp::AbstractBiblioSubstitutionModel.

Referenced by bpp::LaplaceSubstitutionCount::computeCounts(), bpp::UniformizationSubstitutionCount::computeCounts_(), bpp::AbstractBiblioSubstitutionModel::getGenerator(), bpp::SimpleMutationProcess::SimpleMutationProcess(), and bpp::MarkovModulatedSubstitutionModel::updateMatrices().

◆ getIEigenValues() [1/2]

const Vdouble& bpp::AbstractBiblioSubstitutionModel::getIEigenValues ( ) const
inlinevirtualinherited
Returns
A vector with all imaginary parts of the eigen values of the generator of this model;

Implements bpp::SubstitutionModel.

Definition at line 138 of file AbstractBiblioSubstitutionModel.h.

References bpp::SubstitutionModel::getIEigenValues(), and bpp::AbstractBiblioSubstitutionModel::getModel().

◆ getIEigenValues() [2/2]

virtual const Vdouble& bpp::SubstitutionModel::getIEigenValues ( ) const
pure virtualinherited
Returns
A vector with all imaginary parts of the eigen values of the generator of this model;

Implemented in bpp::AbstractSubstitutionModel, bpp::MarkovModulatedSubstitutionModel, and bpp::AbstractBiblioSubstitutionModel.

Referenced by bpp::AbstractBiblioSubstitutionModel::getIEigenValues().

◆ getInitValue() [1/2]

double bpp::AbstractBiblioSubstitutionModel::getInitValue ( size_t  i,
int  state 
) const
throw (BadIntException
)
inlinevirtualinherited

This method is used to initialize likelihoods in reccursions. 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::SubstitutionModel.

Definition at line 157 of file AbstractBiblioSubstitutionModel.h.

References bpp::SubstitutionModel::getInitValue(), and bpp::AbstractBiblioSubstitutionModel::getModel().

◆ getInitValue() [2/2]

virtual double bpp::SubstitutionModel::getInitValue ( size_t  i,
int  state 
) const
throw (IndexOutOfBoundsException,
BadIntException
)
pure virtualinherited

This method is used to initialize likelihoods in reccursions. 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();

Implemented in bpp::AbstractSubstitutionModel, bpp::MarkovModulatedSubstitutionModel, bpp::RE08, and bpp::AbstractBiblioSubstitutionModel.

Referenced by bpp::AbstractBiblioSubstitutionModel::getInitValue().

◆ getMixedModel() [1/2]

◆ getMixedModel() [2/2]

virtual MixedSubstitutionModel& bpp::AbstractBiblioMixedSubstitutionModel::getMixedModel ( )
privatepure virtual

◆ getModel() [1/2]

virtual const SubstitutionModel& bpp::AbstractBiblioSubstitutionModel::getModel ( ) const
pure virtualinherited

Implemented in bpp::LLG08_EX3, bpp::LLG08_EHO, bpp::LLG08_UL3, bpp::LG10_EX_EHO, bpp::LGL08_CAT, bpp::LLG08_EX2, bpp::LLG08_UL2, bpp::GY94, bpp::YN98, bpp::YNGKP_M1, bpp::YNGKP_M8, bpp::MG94, bpp::YNGKP_M7, bpp::YNGKP_M3, and bpp::YNGKP_M2.

Referenced by bpp::AbstractBiblioSubstitutionModel::addRateParameter(), bpp::AbstractBiblioSubstitutionModel::d2Pij_dt2(), bpp::AbstractBiblioSubstitutionModel::dPij_dt(), bpp::AbstractBiblioSubstitutionModel::enableEigenDecomposition(), bpp::AbstractBiblioSubstitutionModel::freq(), bpp::AbstractBiblioSubstitutionModel::getAlphabet(), bpp::AbstractBiblioSubstitutionModel::getAlphabetStateAsChar(), bpp::AbstractBiblioSubstitutionModel::getAlphabetStateAsInt(), bpp::AbstractBiblioSubstitutionModel::getAlphabetStates(), bpp::AbstractBiblioSubstitutionModel::getColumnRightEigenVectors(), bpp::AbstractBiblioSubstitutionModel::getd2Pij_dt2(), bpp::AbstractBiblioSubstitutionModel::getdPij_dt(), bpp::AbstractBiblioSubstitutionModel::getEigenValues(), bpp::AbstractBiblioSubstitutionModel::getExchangeabilityMatrix(), bpp::AbstractBiblioSubstitutionModel::getFrequencies(), bpp::AbstractBiblioSubstitutionModel::getFrequenciesSet(), bpp::AbstractBiblioSubstitutionModel::getGenerator(), bpp::AbstractBiblioSubstitutionModel::getIEigenValues(), bpp::AbstractBiblioSubstitutionModel::getInitValue(), bpp::AbstractBiblioSubstitutionModel::getModelStates(), bpp::AbstractBiblioSubstitutionModel::getNumberOfStates(), bpp::AbstractBiblioSubstitutionModel::getPij_t(), bpp::AbstractBiblioSubstitutionModel::getRate(), bpp::AbstractBiblioSubstitutionModel::getRowLeftEigenVectors(), bpp::AbstractBiblioSubstitutionModel::getScale(), bpp::AbstractBiblioSubstitutionModel::getStateMap(), bpp::AbstractBiblioSubstitutionModel::isDiagonalizable(), bpp::AbstractBiblioSubstitutionModel::isNonSingular(), bpp::AbstractBiblioSubstitutionModel::Pij_t(), bpp::AbstractBiblioSubstitutionModel::Qij(), bpp::AbstractBiblioSubstitutionModel::setFreq(), bpp::AbstractBiblioSubstitutionModel::setFreqFromData(), bpp::AbstractBiblioSubstitutionModel::setRate(), bpp::AbstractBiblioSubstitutionModel::setScale(), bpp::AbstractBiblioSubstitutionModel::Sij(), and bpp::AbstractBiblioSubstitutionModel::updateMatrices().

◆ getModel() [2/2]

virtual SubstitutionModel& bpp::AbstractBiblioSubstitutionModel::getModel ( )
protectedpure virtualinherited

◆ getModelStates() [1/4]

std::vector<size_t> bpp::AbstractBiblioSubstitutionModel::getModelStates ( int  code) const
inlinevirtualinherited

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::SubstitutionModel.

Definition at line 102 of file AbstractBiblioSubstitutionModel.h.

References bpp::AbstractBiblioSubstitutionModel::getModel(), and bpp::SubstitutionModel::getModelStates().

◆ getModelStates() [2/4]

std::vector<size_t> bpp::AbstractBiblioSubstitutionModel::getModelStates ( const std::string &  code) const
inlinevirtualinherited

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::SubstitutionModel.

Definition at line 104 of file AbstractBiblioSubstitutionModel.h.

References bpp::AbstractBiblioSubstitutionModel::getModel(), and bpp::SubstitutionModel::getModelStates().

◆ getModelStates() [3/4]

virtual std::vector<size_t> bpp::SubstitutionModel::getModelStates ( int  code) const
pure virtualinherited

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.

Implemented in bpp::AbstractSubstitutionModel, bpp::MarkovModulatedSubstitutionModel, and bpp::AbstractBiblioSubstitutionModel.

Referenced by bpp::AbstractBiblioSubstitutionModel::getModelStates(), bpp::SubstitutionModelSet::getModelStates(), and bpp::MarginalAncestralStateReconstruction::recursiveMarginalAncestralStates().

◆ getModelStates() [4/4]

virtual std::vector<size_t> bpp::SubstitutionModel::getModelStates ( const std::string &  code) const
pure virtualinherited

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.

Implemented in bpp::AbstractSubstitutionModel, bpp::MarkovModulatedSubstitutionModel, and bpp::AbstractBiblioSubstitutionModel.

◆ getName()

virtual std::string bpp::SubstitutionModel::getName ( ) const
pure virtualinherited

Get the name of the model.

Returns
The name of this model.

Implemented in bpp::YpR_Gen, bpp::YpR_Sym, bpp::F84, bpp::HKY85, bpp::JCprot, bpp::T92, bpp::K80, bpp::RN95, bpp::GTR, bpp::TN93, bpp::RE08, bpp::MixtureOfSubstitutionModels, bpp::JCnuc, bpp::RN95s, bpp::CodonDistanceFrequenciesSubstitutionModel, bpp::BinarySubstitutionModel, bpp::CodonDistancePhaseFrequenciesSubstitutionModel, bpp::UserProteinSubstitutionModel, bpp::CodonDistanceFitnessPhaseFrequenciesSubstitutionModel, bpp::MixtureOfASubstitutionModel, bpp::LLG08_EX3, bpp::WordSubstitutionModel, bpp::LLG08_EHO, bpp::LLG08_UL3, bpp::WAG01, bpp::SSR, bpp::LG10_EX_EHO, bpp::CodonDistanceSubstitutionModel, bpp::L95, bpp::LGL08_CAT, bpp::LLG08_EX2, bpp::LLG08_UL2, bpp::DSO78, bpp::JTT92, bpp::CodonRateFrequenciesSubstitutionModel, bpp::LG08, bpp::YNGKP_M1, bpp::G2001, bpp::gBGC, bpp::YNGKP_M8, bpp::GY94, bpp::YNGKP_M7, bpp::YN98, bpp::YNGKP_M3, bpp::TS98, bpp::TripletSubstitutionModel, bpp::YNGKP_M2, bpp::MG94, bpp::CodonRateSubstitutionModel, bpp::Coala, bpp::LLG08_EX3::EmbeddedModel, bpp::LLG08_EHO::EmbeddedModel, bpp::LLG08_UL3::EmbeddedModel, bpp::LG10_EX_EHO::EmbeddedModel, bpp::LGL08_CAT::EmbeddedModel, bpp::LLG08_EX2::EmbeddedModel, and bpp::LLG08_UL2::EmbeddedModel.

Referenced by bpp::AbstractCodonFitnessSubstitutionModel::AbstractCodonFitnessSubstitutionModel(), bpp::AbstractSubstitutionModel::fireParameterChanged(), bpp::MixtureOfSubstitutionModels::getSubmodelNumbers(), bpp::BppOSubstitutionModelFormat::readMixed_(), bpp::AbstractBiblioSubstitutionModel::updateMatrices(), and bpp::BppOSubstitutionModelFormat::write().

◆ getNModel() [1/2]

const SubstitutionModel* bpp::AbstractBiblioMixedSubstitutionModel::getNModel ( size_t  i) const
inlinevirtual

Returns a specific model from the mixture.

Implements bpp::MixedSubstitutionModel.

Definition at line 78 of file AbstractBiblioMixedSubstitutionModel.h.

References getMixedModel(), and bpp::MixedSubstitutionModel::getNModel().

◆ getNModel() [2/2]

SubstitutionModel* bpp::AbstractBiblioMixedSubstitutionModel::getNModel ( size_t  i)
inlinevirtual

◆ getNProbability()

double bpp::AbstractBiblioMixedSubstitutionModel::getNProbability ( size_t  i) const
inlinevirtual

Returns the probability of a specific model from the mixture.

Implements bpp::MixedSubstitutionModel.

Definition at line 91 of file AbstractBiblioMixedSubstitutionModel.h.

References getMixedModel(), and bpp::MixedSubstitutionModel::getNProbability().

◆ getNRate()

double bpp::AbstractBiblioMixedSubstitutionModel::getNRate ( size_t  i) const
inlinevirtual

Returns the rate of a specific model from the mixture.

Implements bpp::MixedSubstitutionModel.

Definition at line 155 of file AbstractBiblioMixedSubstitutionModel.h.

References getMixedModel(), and bpp::MixedSubstitutionModel::getNRate().

◆ getNumberOfModels()

size_t bpp::AbstractBiblioMixedSubstitutionModel::getNumberOfModels ( ) const
inlinevirtual

Returns the number of submodels.

Implements bpp::MixedSubstitutionModel.

Definition at line 120 of file AbstractBiblioMixedSubstitutionModel.h.

References getMixedModel(), and bpp::MixedSubstitutionModel::getNumberOfModels().

◆ getNumberOfStates() [1/2]

size_t bpp::AbstractBiblioSubstitutionModel::getNumberOfStates ( ) const
inlinevirtualinherited

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::SubstitutionModel.

Definition at line 155 of file AbstractBiblioSubstitutionModel.h.

References bpp::AbstractBiblioSubstitutionModel::getModel(), and bpp::SubstitutionModel::getNumberOfStates().

◆ getNumberOfStates() [2/2]

◆ getPij_t() [1/2]

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

Implements bpp::SubstitutionModel.

Definition at line 122 of file AbstractBiblioSubstitutionModel.h.

References bpp::AbstractBiblioSubstitutionModel::getModel(), and bpp::SubstitutionModel::getPij_t().

◆ getPij_t() [2/2]

◆ getProbabilities()

const std::vector<double>& bpp::AbstractBiblioMixedSubstitutionModel::getProbabilities ( ) const
inlinevirtual

Returns the vector of the probabilities of the submodels of the mixture.

Implements bpp::MixedSubstitutionModel.

Definition at line 102 of file AbstractBiblioMixedSubstitutionModel.h.

References getMixedModel(), and bpp::MixedSubstitutionModel::getProbabilities().

◆ getRate() [1/2]

◆ getRate() [2/2]

virtual double bpp::SubstitutionModel::getRate ( ) const
pure virtualinherited

◆ getRowLeftEigenVectors() [1/2]

const Matrix<double>& bpp::AbstractBiblioSubstitutionModel::getRowLeftEigenVectors ( ) const
inlinevirtualinherited
Returns
A matrix with left eigen vectors. Each row in the matrix stands for an eigen vector.

Implements bpp::SubstitutionModel.

Definition at line 140 of file AbstractBiblioSubstitutionModel.h.

References bpp::AbstractBiblioSubstitutionModel::getModel(), and bpp::SubstitutionModel::getRowLeftEigenVectors().

◆ getRowLeftEigenVectors() [2/2]

virtual const Matrix<double>& bpp::SubstitutionModel::getRowLeftEigenVectors ( ) const
pure virtualinherited

◆ getScale() [1/2]

double bpp::AbstractBiblioSubstitutionModel::getScale ( ) const
inlinevirtualinherited

Get the scalar product of diagonal elements of the generator and the frequencies vector. If the generator is normalized, then scale=1. Otherwise each element must be multiplied by 1/scale.

Returns
Minus the scalar product of diagonal elements and the frequencies vector.

Implements bpp::SubstitutionModel.

Definition at line 190 of file AbstractBiblioSubstitutionModel.h.

References bpp::AbstractBiblioSubstitutionModel::getModel(), and bpp::SubstitutionModel::getScale().

◆ getScale() [2/2]

virtual double bpp::SubstitutionModel::getScale ( ) const
pure virtualinherited

Get the scalar product of diagonal elements of the generator and the frequencies vector. If the generator is normalized, then scale=1. Otherwise each element must be multiplied by 1/scale.

Returns
Minus the scalar product of diagonal elements and the frequencies vector.

Implemented in bpp::AbstractSubstitutionModel, bpp::MarkovModulatedSubstitutionModel, and bpp::AbstractBiblioSubstitutionModel.

Referenced by bpp::AbstractBiblioSubstitutionModel::getScale().

◆ getStateMap() [1/2]

const StateMap& bpp::AbstractBiblioSubstitutionModel::getStateMap ( ) const
inlinevirtualinherited
Returns
The mapping of model states with alphabet states.

Implements bpp::SubstitutionModel.

Definition at line 96 of file AbstractBiblioSubstitutionModel.h.

References bpp::AbstractBiblioSubstitutionModel::getModel(), and bpp::SubstitutionModel::getStateMap().

◆ getStateMap() [2/2]

virtual const StateMap& bpp::SubstitutionModel::getStateMap ( ) const
pure virtualinherited

◆ getSubmodelNumbers()

Vint AbstractBiblioMixedSubstitutionModel::getSubmodelNumbers ( std::string &  desc) const
virtual

◆ getVRates()

const std::vector<double>& bpp::AbstractBiblioMixedSubstitutionModel::getVRates ( ) const
inlinevirtual

Returns the vector of all the rates of the mixture.

Implements bpp::MixedSubstitutionModel.

Definition at line 147 of file AbstractBiblioMixedSubstitutionModel.h.

References getMixedModel(), and bpp::MixedSubstitutionModel::getVRates().

◆ isDiagonalizable() [1/2]

bool bpp::AbstractBiblioSubstitutionModel::isDiagonalizable ( ) const
inlinevirtualinherited
Returns
True if the model is diagonalizable in R.

Implements bpp::SubstitutionModel.

Definition at line 132 of file AbstractBiblioSubstitutionModel.h.

References bpp::AbstractBiblioSubstitutionModel::getModel(), and bpp::SubstitutionModel::isDiagonalizable().

◆ isDiagonalizable() [2/2]

virtual bool bpp::SubstitutionModel::isDiagonalizable ( ) const
pure virtualinherited

◆ isNonSingular() [1/2]

bool bpp::AbstractBiblioSubstitutionModel::isNonSingular ( ) const
inlinevirtualinherited
Returns
True is the model is non-singular.

Implements bpp::SubstitutionModel.

Definition at line 134 of file AbstractBiblioSubstitutionModel.h.

References bpp::AbstractBiblioSubstitutionModel::getModel(), and bpp::SubstitutionModel::isNonSingular().

◆ isNonSingular() [2/2]

virtual bool bpp::SubstitutionModel::isNonSingular ( ) const
pure virtualinherited

◆ normalizeVRates()

void bpp::AbstractBiblioMixedSubstitutionModel::normalizeVRates ( )
inlinevirtual

normalizes the rates of the submodels.

Implements bpp::MixedSubstitutionModel.

Definition at line 138 of file AbstractBiblioMixedSubstitutionModel.h.

References getMixedModel(), and bpp::MixedSubstitutionModel::normalizeVRates().

◆ operator=()

◆ Pij_t() [1/2]

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

Implements bpp::SubstitutionModel.

Definition at line 110 of file AbstractBiblioSubstitutionModel.h.

References bpp::AbstractBiblioSubstitutionModel::getModel(), and bpp::SubstitutionModel::Pij_t().

◆ Pij_t() [2/2]

virtual double bpp::SubstitutionModel::Pij_t ( size_t  i,
size_t  j,
double  t 
) const
pure virtualinherited

◆ Qij() [1/2]

virtual double bpp::AbstractBiblioSubstitutionModel::Qij ( size_t  i,
size_t  j 
) const
inlinevirtualinherited
Returns
The rate in the generator of change from state i to state j.
See also
getStates();

Implements bpp::SubstitutionModel.

Definition at line 108 of file AbstractBiblioSubstitutionModel.h.

References bpp::AbstractBiblioSubstitutionModel::getModel(), and bpp::SubstitutionModel::Qij().

◆ Qij() [2/2]

◆ setFreq() [1/2]

void AbstractBiblioSubstitutionModel::setFreq ( std::map< int, double > &  frequencies)
virtualinherited

Set equilibrium frequencies.

Parameters
frequenciesThe map of the frequencies to use.

Reimplemented from bpp::SubstitutionModel.

Definition at line 95 of file AbstractBiblioSubstitutionModel.cpp.

References bpp::AbstractBiblioSubstitutionModel::getModel(), bpp::AbstractBiblioSubstitutionModel::mapParNamesFromPmodel_, and bpp::SubstitutionModel::setFreq().

◆ setFreq() [2/2]

◆ setFreqFromData() [1/2]

void AbstractBiblioSubstitutionModel::setFreqFromData ( const SequenceContainer &  data,
double  pseudoCount = 0 
)
virtualinherited

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::SubstitutionModel.

Definition at line 110 of file AbstractBiblioSubstitutionModel.cpp.

References bpp::AbstractBiblioSubstitutionModel::getModel(), bpp::AbstractBiblioSubstitutionModel::mapParNamesFromPmodel_, and bpp::SubstitutionModel::setFreqFromData().

◆ setFreqFromData() [2/2]

virtual void bpp::SubstitutionModel::setFreqFromData ( const SequenceContainer &  data,
double  pseudoCount = 0 
)
pure virtualinherited

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)} \]

Implemented in bpp::AbstractSubstitutionModel, bpp::MarkovModulatedSubstitutionModel, bpp::JCprot, bpp::K80, bpp::RE08, bpp::JCnuc, bpp::UserProteinSubstitutionModel, bpp::AbstractBiblioSubstitutionModel, bpp::WAG01, bpp::DSO78, bpp::JTT92, bpp::LG08, and bpp::Coala.

Referenced by bpp::BppOSubstitutionModelFormat::read(), bpp::AbstractBiblioSubstitutionModel::setFreqFromData(), and bpp::MarkovModulatedSubstitutionModel::setFreqFromData().

◆ setNProbability()

void bpp::AbstractBiblioMixedSubstitutionModel::setNProbability ( size_t  i,
double  prob 
)
inlinevirtual

Sets the probabilities of the submodels of the mixture.

Implements bpp::MixedSubstitutionModel.

Definition at line 111 of file AbstractBiblioMixedSubstitutionModel.h.

References getMixedModel(), and bpp::MixedSubstitutionModel::setNProbability().

◆ setRate() [1/2]

void bpp::AbstractBiblioSubstitutionModel::setRate ( double  rate)
inlinevirtualinherited

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

Parameters
ratemust be positive.

Implements bpp::SubstitutionModel.

Definition at line 145 of file AbstractBiblioSubstitutionModel.h.

References bpp::AbstractBiblioSubstitutionModel::getModel(), and bpp::SubstitutionModel::setRate().

◆ setRate() [2/2]

virtual void bpp::SubstitutionModel::setRate ( double  rate)
pure virtualinherited

◆ setScale() [1/2]

void bpp::AbstractBiblioSubstitutionModel::setScale ( double  scale)
inlinevirtualinherited

Multiplies the current generator by the given scale.

Parameters
scalethe scale by which the generator is multiplied.

Implements bpp::SubstitutionModel.

Definition at line 192 of file AbstractBiblioSubstitutionModel.h.

References bpp::AbstractBiblioSubstitutionModel::getModel(), and bpp::SubstitutionModel::setScale().

◆ setScale() [2/2]

virtual void bpp::SubstitutionModel::setScale ( double  scale)
pure virtualinherited

Multiplies the current generator by the given scale.

Parameters
scalethe scale by which the generator is multiplied.

Implemented in bpp::AbstractSubstitutionModel, bpp::MarkovModulatedSubstitutionModel, and bpp::AbstractBiblioSubstitutionModel.

Referenced by bpp::AbstractBiblioSubstitutionModel::setScale(), and bpp::MarkovModulatedSubstitutionModel::setScale().

◆ setVRates()

void bpp::AbstractBiblioMixedSubstitutionModel::setVRates ( const Vdouble &  vd)
inlinevirtual

sets the rates of the submodels.

Implements bpp::MixedSubstitutionModel.

Definition at line 129 of file AbstractBiblioMixedSubstitutionModel.h.

References getMixedModel(), and bpp::MixedSubstitutionModel::setVRates().

◆ Sij() [1/2]

double bpp::AbstractBiblioSubstitutionModel::Sij ( size_t  i,
size_t  j 
) const
inlinevirtualinherited
Returns
The exchangeability between state i and state j.

By definition Sij(i,j) = Sij(j,i).

Implements bpp::SubstitutionModel.

Definition at line 120 of file AbstractBiblioSubstitutionModel.h.

References bpp::AbstractBiblioSubstitutionModel::getModel(), and bpp::SubstitutionModel::Sij().

◆ Sij() [2/2]

virtual double bpp::SubstitutionModel::Sij ( size_t  i,
size_t  j 
) const
pure virtualinherited
Returns
The exchangeability between state i and state j.

By definition Sij(i,j) = Sij(j,i).

Implemented in bpp::AbstractSubstitutionModel, bpp::MarkovModulatedSubstitutionModel, and bpp::AbstractBiblioSubstitutionModel.

Referenced by bpp::AbstractBiblioSubstitutionModel::Sij().

◆ updateMatrices()

Member Data Documentation

◆ lParPmodel_

◆ mapParNamesFromPmodel_


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