5#ifndef BPP_PHYL_MODEL_ABSTRACTMIXEDTRANSITIONMODEL_H
6#define BPP_PHYL_MODEL_ABSTRACTMIXEDTRANSITIONMODEL_H
64 std::shared_ptr<const Alphabet>,
65 std::shared_ptr<const StateMapInterface>
stateMap,
66 const std::string& prefix);
91 std::shared_ptr<const TransitionModelInterface>
getNModel(
size_t i)
const override
108 virtual void setRate(
double rate)
override;
188 sm->computeFrequencies(yn);
192 void setFreq(std::map<int, double>& frequ)
override
202 std::map<int, double> freqs;
Partial implementation for Mixed Transition models, defined as a mixture of "simple" substitution mod...
virtual const Matrix< double > & getdPij_dt(double t) const override
const TransitionModelInterface & nModel(size_t i) const override
Returns a specific model from the mixture.
void computeFrequencies(bool yn) override
Set if equilibrium frequencies should be computed.
AbstractMixedTransitionModel(std::shared_ptr< const Alphabet >, std::shared_ptr< const StateMapInterface > stateMap, const std::string &prefix)
virtual const std::vector< double > & getProbabilities() const override
Returns the vector of probabilities.
double getNRate(size_t i) const override
Returns the rate of a specific model from the mixture.
std::shared_ptr< const TransitionModelInterface > getNModel(size_t i) const override
std::vector< double > vProbas_
vector of the probabilities of the models
virtual size_t getNumberOfModels() const override
returns the number of models in the mixture
virtual void setRate(double rate) override
Set the rate of the model and the submodels.
virtual const Matrix< double > & getd2Pij_dt2(double t) const override
virtual void setVRates(const Vdouble &vd) override
Sets the rates of the submodels to be proportional to a given vector, with the constraint that the me...
bool computeFrequencies() const override
virtual void normalizeVRates() override
Normalizes the rates of the submodels so that the mean rate of the mixture equals rate_.
AbstractMixedTransitionModel & operator=(const AbstractMixedTransitionModel &)
virtual AbstractMixedTransitionModel * clone() const override=0
void setFreq(std::map< int, double > &frequ) override
Set equilibrium frequencies.
std::vector< double > vRates_
vector of the rates of the models.
TransitionModelInterface & nModel_(size_t i) override
void setFreqFromData(const SequenceDataInterface &data, double pseudoCount) override
Set equilibrium frequencies equal to the frequencies estimated from the data.
const std::vector< double > & getVRates() const override
Returns the vector of all the rates of the mixture.
virtual const Matrix< double > & getPij_t(double t) const override
From TransitionModel interface.
virtual void setNProbability(size_t i, double prob) override
Sets the probability of a specific model from the mixture.
virtual double getNProbability(size_t i) const override
Returns the probability of a specific model from the mixture.
std::vector< std::shared_ptr< TransitionModelInterface > > modelsContainer_
vector of pointers to TransitionModels.
Partial implementation of the TransitionModel interface.
const StateMapInterface & stateMap() const override
Interface for Transition models, defined as a mixture of "simple" transition models.
Interface for all transition models.
Defines the basic types of data flow nodes.
std::vector< double > Vdouble