18 shared_ptr<const NucleicAlphabet> alphabet,
38 double f = gamma + lambda + delta + kappa;
50 double kappaP =
kappa_ / thetaR;
51 double gammaP =
gamma_ / (1 - thetaR);
81 gamma_ = gammaP * (1 - thetaR);
86 double thetaY = 1 - thetaR;
129 for (
size_t i = 0; i < 4; i++)
203 for (
unsigned int i = 0; i <
size_; ++i)
205 for (
unsigned int j = 0; j <
size_; ++j)
216 auto thetaR = (freqs[0] + freqs[2]) / (freqs[0] + freqs[1] + freqs[2] + freqs[3]);
Specialisation abstract class for nucleotide substitution model.
void addParameter_(Parameter *parameter)
void setParameterValue(const std::string &name, double value) override
double getParameterValue(const std::string &name) const override
RowMatrix< double > generator_
The generator matrix of the model.
bool isDiagonalizable_
boolean value for diagonalizability in R of the generator_
bool isNonSingular_
boolean value for non-singularity of rightEigenVectors_
std::vector< RowMatrix< double > > vPowGen_
vector of the powers of generator_ for Taylor development (if rightEigenVectors_ is singular).
Vdouble eigenValues_
The vector of eigen values.
bool computeFrequencies() const
RowMatrix< double > exchangeability_
The exchangeability matrix of the model, defined as . When the model is reversible,...
RowMatrix< double > leftEigenVectors_
The matrix made of left eigen vectors (by row) if rightEigenVectors_ is non-singular.
virtual bool isScalable() const
returns if model is scalable
RowMatrix< double > rightEigenVectors_
The matrix made of right eigen vectors (by column).
void setScale(double scale)
Multiplies the current generator by the given scale.
size_t size_
The number of states.
Vdouble freq_
The vector of equilibrium frequencies.
This class implements a state map where all resolved states are modeled.
static const std::shared_ptr< IntervalConstraint > PROP_CONSTRAINT_EX
static const std::shared_ptr< IntervalConstraint > R_PLUS_STAR
void setFreq(std::map< int, double > &) override
Set equilibrium frequencies.
RN95(std::shared_ptr< const NucleicAlphabet > alphabet, double alpha=1, double beta=1, double gamma=0.25, double delta=0.25, double epsilon=1, double kappa=0.25, double lambda=0.25, double sigma=1)
void updateMatrices_() override
Diagonalize the matrix, and fill the eigenValues_, iEigenValues_, leftEigenVectors_ and rightEigenVe...
Defines the basic types of data flow nodes.
ExtendedFloat abs(const ExtendedFloat &ef)