41 #include "../FrequenciesSet/NucleotideFrequenciesSet.h" 43 #include <Bpp/Numeric/Matrix/MatrixTools.h> 46 #include <Bpp/Seq/Container/SequenceContainerTools.h> 57 T92::T92(
const NucleicAlphabet* alpha,
double kappa,
double theta) :
58 AbstractParameterAliasable(
"T92."),
64 piA_((1. - theta_) / 2.),
67 piT_((1. - theta_) / 2.),
73 addParameter_(
new Parameter(
"T92.kappa", kappa, &Parameter::R_PLUS_STAR));
83 kappa_ = getParameterValue(
"kappa");
84 theta_ = getParameterValue(
"theta");
300 double k2_ =
k_ *
k_;
459 double f = (freqs[1] + freqs[2]) / (freqs[0] + freqs[1] + freqs[2] + freqs[3]);
460 setParameterValue(
"theta", f);
const Matrix< double > & getd2Pij_dt2(double d) const
RowMatrix< double > exchangeability_
The exchangeability matrix of the model, defined as . When the model is reversible, this matrix is symetric.
This class implements a state map where all resolved states are modeled.
RowMatrix< double > rightEigenVectors_
The matrix made of right eigen vectors (by column).
Vdouble eigenValues_
The vector of eigen values.
const Matrix< double > & getPij_t(double d) const
Vdouble freq_
The vector of equilibrium frequencies.
double d2Pij_dt2(size_t i, size_t j, double d) const
Partial implementation of the ReversibleSubstitutionModel interface.
void updateMatrices()
Compute and diagonalize the matrix, and fill the eigenValues_, leftEigenVectors_ and rightEigenVecto...
static IntervalConstraint FREQUENCE_CONSTRAINT_SMALL
RowMatrix< double > leftEigenVectors_
The matrix made of left eigen vectors (by row) if rightEigenVectors_ is non-singular.
RowMatrix< double > generator_
The generator matrix of the model.
double Pij_t(size_t i, size_t j, double d) const
double rate_
The rate of the model (default: 1). The generator (and all its vectorial components) is independent o...
const Matrix< double > & getdPij_dt(double d) const
size_t size_
The size of the generator, i.e. the number of states.
double dPij_dt(size_t i, size_t j, double d) const
void setFreq(std::map< int, double > &freqs)
This method is over-defined to actualize the 'theta' parameter too.
T92(const NucleicAlphabet *alpha, double kappa=1., double theta=0.5)