41 #include "../FrequenciesSet/NucleotideFrequenciesSet.h" 43 #include <Bpp/Numeric/Matrix/MatrixTools.h> 44 #include <Bpp/Numeric/Matrix/EigenValue.h> 47 #include <Bpp/Seq/Container/SequenceContainerTools.h> 59 const NucleicAlphabet* alpha,
66 AbstractParameterAliasable(
"TN93."),
68 kappa1_(kappa1), kappa2_(kappa2),
69 piA_(piA), piC_(piC), piG_(piG), piT_(piT), piY_(), piR_(),
71 theta_(piG + piC), theta1_(piA / (1. - theta_)), theta2_(piG / theta_),
72 exp1_(), exp21_(), exp22_(), l_(), p_(size_, size_)
74 addParameter_(
new Parameter(
"TN93.kappa1", kappa1, &Parameter::R_PLUS_STAR));
75 addParameter_(
new Parameter(
"TN93.kappa2", kappa2, &Parameter::R_PLUS_STAR));
87 kappa1_ = getParameterValue(
"kappa1");
88 kappa2_ = getParameterValue(
"kappa2");
89 theta_ = getParameterValue(
"theta" );
90 theta1_ = getParameterValue(
"theta1");
91 theta2_ = getParameterValue(
"theta2");
435 vector<string> thetas(3);
436 thetas[0] = getNamespace() +
"theta";
437 thetas[1] = getNamespace() +
"theta1";
438 thetas[2] = getNamespace() +
"theta2";
439 ParameterList pl = getParameters().subList(thetas);
443 setParametersValues(pl);
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.
Vdouble freq_
The vector of equilibrium frequencies.
Partial implementation of the ReversibleSubstitutionModel interface.
void setFreq(std::map< int, double > &freqs)
This method is over-defined to actualize the corresponding parameters piA, piT, piG and piC too...
double d2Pij_dt2(size_t i, size_t j, double d) const
static IntervalConstraint FREQUENCE_CONSTRAINT_SMALL
double Pij_t(size_t i, size_t j, double d) const
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 rate_
The rate of the model (default: 1). The generator (and all its vectorial components) is independent o...
const Matrix< double > & getd2Pij_dt2(double d) const
const Matrix< double > & getPij_t(double d) const
size_t size_
The size of the generator, i.e. the number of states.
const Matrix< double > & getdPij_dt(double d) const
double dPij_dt(size_t i, size_t j, double d) const
void updateMatrices()
Compute and diagonalize the matrix, and fill the eigenValues_, leftEigenVectors_ and rightEigenVecto...