bpp-phyl  2.2.0
HKY85.cpp
Go to the documentation of this file.
1 //
2 // File: HKY85.cpp
3 // Created by: Julien Dutheil
4 // Created on: Thu Jan 22 16:17:39 2004
5 //
6 
7 /*
8  Copyright or © or Copr. Bio++ Development Team, (November 16, 2004)
9 
10  This software is a computer program whose purpose is to provide classes
11  for phylogenetic data analysis.
12 
13  This software is governed by the CeCILL license under French law and
14  abiding by the rules of distribution of free software. You can use,
15  modify and/ or redistribute the software under the terms of the CeCILL
16  license as circulated by CEA, CNRS and INRIA at the following URL
17  "http://www.cecill.info".
18 
19  As a counterpart to the access to the source code and rights to copy,
20  modify and redistribute granted by the license, users are provided only
21  with a limited warranty and the software's author, the holder of the
22  economic rights, and the successive licensors have only limited
23  liability.
24 
25  In this respect, the user's attention is drawn to the risks associated
26  with loading, using, modifying and/or developing or reproducing the
27  software by the user in light of its specific status of free software,
28  that may mean that it is complicated to manipulate, and that also
29  therefore means that it is reserved for developers and experienced
30  professionals having in-depth computer knowledge. Users are therefore
31  encouraged to load and test the software's suitability as regards their
32  requirements in conditions enabling the security of their systems and/or
33  data to be ensured and, more generally, to use and operate it in the
34  same conditions as regards security.
35 
36  The fact that you are presently reading this means that you have had
37  knowledge of the CeCILL license and that you accept its terms.
38 */
39 
40 #include "HKY85.h"
41 #include "../FrequenciesSet/NucleotideFrequenciesSet.h"
42 
43 #include <Bpp/Numeric/Matrix/MatrixTools.h>
44 
45 // From SeqLib:
46 #include <Bpp/Seq/Container/SequenceContainerTools.h>
47 
48 using namespace bpp;
49 
50 // From the STL:
51 #include <cmath>
52 
53 using namespace std;
54 
55 /******************************************************************************/
56 
58  const NucleicAlphabet* alpha,
59  double kappa,
60  double piA,
61  double piC,
62  double piG,
63  double piT):
64  AbstractParameterAliasable("HKY85."),
65  AbstractReversibleSubstitutionModel(alpha, new CanonicalStateMap(alpha, false), "HKY85."),
66  kappa_(kappa), k1_(), k2_(), r_(),
67  piA_(piA), piC_(piC), piG_(piG), piT_(piT), piY_(), piR_(),
68  theta_(piG + piC), theta1_(piA / (1. - theta_)), theta2_(piG / theta_),
69  exp1_(), exp21_(), exp22_(), l_(), p_(size_, size_)
70 {
71  addParameter_(new Parameter("HKY85.kappa", kappa, &Parameter::R_PLUS_STAR));
72  addParameter_(new Parameter("HKY85.theta" , theta_, &FrequenciesSet::FREQUENCE_CONSTRAINT_SMALL));
73  addParameter_(new Parameter("HKY85.theta1", theta1_, &FrequenciesSet::FREQUENCE_CONSTRAINT_SMALL));
74  addParameter_(new Parameter("HKY85.theta2", theta2_, &FrequenciesSet::FREQUENCE_CONSTRAINT_SMALL));
76 }
77 
78 /******************************************************************************/
79 
81 {
82  kappa_ = getParameterValue("kappa");
83  theta_ = getParameterValue("theta");
84  theta1_ = getParameterValue("theta1");
85  theta2_ = getParameterValue("theta2");
86  piA_ = theta1_ * (1. - theta_);
87  piC_ = (1. - theta2_) * theta_;
88  piG_ = theta2_ * theta_;
89  piT_ = (1. - theta1_) * (1. - theta_);
90  piR_ = piA_ + piG_;
91  piY_ = piT_ + piC_;
92  k1_ = kappa_ * piY_ + piR_;
93  k2_ = kappa_ * piR_ + piY_;
94 
95  freq_[0] = piA_;
96  freq_[1] = piC_;
97  freq_[2] = piG_;
98  freq_[3] = piT_;
99 
100  generator_(0, 0) = -( piC_ + kappa_*piG_ + piT_);
101  generator_(1, 1) = -( piA_ + piG_ + kappa_*piT_);
102  generator_(2, 2) = -(kappa_*piA_ + piC_ + piT_);
103  generator_(3, 3) = -( piA_ + kappa_*piC_ + piG_ );
104 
105  generator_(1, 0) = piA_;
106  generator_(3, 0) = piA_;
107  generator_(0, 1) = piC_;
108  generator_(2, 1) = piC_;
109  generator_(1, 2) = piG_;
110  generator_(3, 2) = piG_;
111  generator_(0, 3) = piT_;
112  generator_(2, 3) = piT_;
113 
114  generator_(2, 0) = kappa_ * piA_;
115  generator_(3, 1) = kappa_ * piC_;
116  generator_(0, 2) = kappa_ * piG_;
117  generator_(1, 3) = kappa_ * piT_;
118 
119  // Normalization:
120  r_ = 1. / (2. * (piA_ * piC_ + piC_ * piG_ + piA_ * piT_ + piG_ * piT_ + kappa_ * (piC_ * piT_ + piA_ * piG_)));
121  MatrixTools::scale(generator_, r_);
122 
123  // Exchangeability:
124  exchangeability_(0,0) = generator_(0,0) / piA_;
125  exchangeability_(0,1) = generator_(0,1) / piC_;
126  exchangeability_(0,2) = generator_(0,2) / piG_;
127  exchangeability_(0,3) = generator_(0,3) / piT_;
128 
129  exchangeability_(1,0) = generator_(1,0) / piA_;
130  exchangeability_(1,1) = generator_(1,1) / piC_;
131  exchangeability_(1,2) = generator_(1,2) / piG_;
132  exchangeability_(1,3) = generator_(1,3) / piT_;
133 
134  exchangeability_(2,0) = generator_(2,0) / piA_;
135  exchangeability_(2,1) = generator_(2,1) / piC_;
136  exchangeability_(2,2) = generator_(2,2) / piG_;
137  exchangeability_(2,3) = generator_(2,3) / piT_;
138 
139  exchangeability_(3,0) = generator_(3,0) / piA_;
140  exchangeability_(3,1) = generator_(3,1) / piC_;
141  exchangeability_(3,2) = generator_(3,2) / piG_;
142  exchangeability_(3,3) = generator_(3,3) / piT_;
143 
144  // Eigen values:
145  eigenValues_[0] = 0;
146  eigenValues_[1] = -r_ * (kappa_ * piY_ + piR_);
147  eigenValues_[2] = -r_ * (kappa_ * piR_ + piY_);
148  eigenValues_[3] = -r_;
149 
150  // Eigen vectors:
151  leftEigenVectors_(0,0) = piA_;
152  leftEigenVectors_(0,1) = piC_;
153  leftEigenVectors_(0,2) = piG_;
154  leftEigenVectors_(0,3) = piT_;
155 
156  leftEigenVectors_(1,0) = 0.;
157  leftEigenVectors_(1,1) = piT_ / piY_;
158  leftEigenVectors_(1,2) = 0.;
159  leftEigenVectors_(1,3) = -piT_ / piY_;
160 
161  leftEigenVectors_(2,0) = piG_ / piR_;
162  leftEigenVectors_(2,1) = 0.;
163  leftEigenVectors_(2,2) = -piG_ / piR_;
164  leftEigenVectors_(2,3) = 0.;
165 
166  leftEigenVectors_(3,0) = piA_*piY_ / piR_;
167  leftEigenVectors_(3,1) = -piC_;
168  leftEigenVectors_(3,2) = piG_*piY_ / piR_;
169  leftEigenVectors_(3,3) = -piT_;
170 
171  rightEigenVectors_(0,0) = 1.;
172  rightEigenVectors_(0,1) = 0.;
173  rightEigenVectors_(0,2) = 1.;
174  rightEigenVectors_(0,3) = 1.;
175 
176  rightEigenVectors_(1,0) = 1.;
177  rightEigenVectors_(1,1) = 1.;
178  rightEigenVectors_(1,2) = 0.;;
179  rightEigenVectors_(1,3) = -piR_ / piY_;
180 
181  rightEigenVectors_(2,0) = 1.;
182  rightEigenVectors_(2,1) = 0.;
183  rightEigenVectors_(2,2) = -piA_ / piG_;
184  rightEigenVectors_(2,3) = 1.;
185 
186  rightEigenVectors_(3,0) = 1.;
187  rightEigenVectors_(3,1) = -piC_ / piT_;
188  rightEigenVectors_(3,2) = 0.;
189  rightEigenVectors_(3,3) = -piR_ / piY_;
190 }
191 
192 /******************************************************************************/
193 
194 double HKY85::Pij_t(size_t i, size_t j, double d) const
195 {
196  l_ = rate_ * r_ * d;
197  exp1_ = exp(-l_);
198  exp22_ = exp(-k2_ * l_);
199  exp21_ = exp(-k1_ * l_);
200 
201  switch(i)
202  {
203  //A
204  case 0 : {
205  switch(j) {
206  case 0 : return piA_ * (1. + (piY_/piR_) * exp1_) + (piG_/piR_) * exp22_; //A
207  case 1 : return piC_ * (1. - exp1_); //C
208  case 2 : return piG_ * (1. + (piY_/piR_) * exp1_) - (piG_/piR_) * exp22_; //G
209  case 3 : return piT_ * (1. - exp1_); //T, U
210  }
211  }
212  //C
213  case 1 : {
214  switch(j) {
215  case 0 : return piA_ * (1. - exp1_); //A
216  case 1 : return piC_ * (1. + (piR_/piY_) * exp1_) + (piT_/piY_) * exp21_; //C
217  case 2 : return piG_ * (1. - exp1_); //G
218  case 3 : return piT_ * (1. + (piR_/piY_) * exp1_) - (piT_/piY_) * exp21_; //T, U
219  }
220  }
221  //G
222  case 2 : {
223  switch(j) {
224  case 0 : return piA_ * (1. + (piY_/piR_) * exp1_) - (piA_/piR_) * exp22_; //A
225  case 1 : return piC_ * (1. - exp1_); //C
226  case 2 : return piG_ * (1. + (piY_/piR_) * exp1_) + (piA_/piR_) * exp22_; //G
227  case 3 : return piT_ * (1. - exp1_); //T, U
228  }
229  }
230  //T, U
231  case 3 : {
232  switch(j) {
233  case 0 : return piA_ * (1. - exp1_); //A
234  case 1 : return piC_ * (1. + (piR_/piY_) * exp1_) - (piC_/piY_) * exp21_; //C
235  case 2 : return piG_ * (1. - exp1_); //G
236  case 3 : return piT_ * (1. + (piR_/piY_) * exp1_) + (piC_/piY_) * exp21_; //T, U
237  }
238  }
239  }
240  return 0;
241 }
242 
243 /******************************************************************************/
244 
245 double HKY85::dPij_dt(size_t i, size_t j, double d) const
246 {
247  l_ = rate_ * r_ * d;
248  exp1_ = exp(-l_);
249  exp22_ = exp(-k2_ * l_);
250  exp21_ = exp(-k1_ * l_);
251 
252  switch(i)
253  {
254  //A
255  case 0 : {
256  switch(j) {
257  case 0 : return rate_ * r_ * (piA_ * -(piY_/piR_) * exp1_ - (piG_/piR_) * k2_ * exp22_); //A
258  case 1 : return rate_ * r_ * (piC_ * exp1_); //C
259  case 2 : return rate_ * r_ * (piG_ * -(piY_/piR_) * exp1_ + (piG_/piR_) * k2_ * exp22_); //G
260  case 3 : return rate_ * r_ * (piT_ * exp1_); //T, U
261  }
262  }
263  //C
264  case 1 : {
265  switch(j) {
266  case 0 : return rate_ * r_ * (piA_ * exp1_); //A
267  case 1 : return rate_ * r_ * (piC_ * -(piR_/piY_) * exp1_ - (piT_/piY_) * k1_ * exp21_); //C
268  case 2 : return rate_ * r_ * (piG_ * exp1_); //G
269  case 3 : return rate_ * r_ * (piT_ * -(piR_/piY_) * exp1_ + (piT_/piY_) * k1_ * exp21_); //T, U
270  }
271  }
272  //G
273  case 2 : {
274  switch(j) {
275  case 0 : return rate_ * r_ * (piA_ * -(piY_/piR_) * exp1_ + (piA_/piR_) * k2_ * exp22_); //A
276  case 1 : return rate_ * r_ * (piC_ * exp1_); //C
277  case 2 : return rate_ * r_ * (piG_ * -(piY_/piR_) * exp1_ - (piA_/piR_) * k2_ * exp22_); //G
278  case 3 : return rate_ * r_ * (piT_ * exp1_); //T, U
279  }
280  }
281  //T, U
282  case 3 : {
283  switch(j) {
284  case 0 : return rate_ * r_ * (piA_ * exp1_); //A
285  case 1 : return rate_ * r_ * (piC_ * -(piR_/piY_) * exp1_ + (piC_/piY_) * k1_ * exp21_); //C
286  case 2 : return rate_ * r_ * (piG_ * exp1_); //G
287  case 3 : return rate_ * r_ * (piT_ * -(piR_/piY_) * exp1_ - (piC_/piY_) * k1_ * exp21_); //T, U
288  }
289  }
290  }
291  return 0;
292 }
293 
294 /******************************************************************************/
295 
296 double HKY85::d2Pij_dt2(size_t i, size_t j, double d) const
297 {
298  double r_2 = rate_ * rate_ * r_ * r_;
299  l_ = rate_ * r_ * d;
300  double k1_2 = k1_ * k1_;
301  double k2_2 = k2_ * k2_;
302  exp1_ = exp(-l_);
303  exp22_ = exp(-k2_ * l_);
304  exp21_ = exp(-k1_ * l_);
305 
306  switch(i)
307  {
308  //A
309  case 0 : {
310  switch(j) {
311  case 0 : return r_2 * (piA_ * (piY_/piR_) * exp1_ + (piG_/piR_) * k2_2 * exp22_); //A
312  case 1 : return r_2 * (piC_ * - exp1_); //C
313  case 2 : return r_2 * (piG_ * (piY_/piR_) * exp1_ - (piG_/piR_) * k2_2 * exp22_); //G
314  case 3 : return r_2 * (piT_ * - exp1_); //T, U
315  }
316  }
317  //C
318  case 1 : {
319  switch(j) {
320  case 0 : return r_2 * (piA_ * - exp1_); //A
321  case 1 : return r_2 * (piC_ * (piR_/piY_) * exp1_ + (piT_/piY_) * k1_2 * exp21_); //C
322  case 2 : return r_2 * (piG_ * - exp1_); //G
323  case 3 : return r_2 * (piT_ * (piR_/piY_) * exp1_ - (piT_/piY_) * k1_2 * exp21_); //T, U
324  }
325  }
326  //G
327  case 2 : {
328  switch(j) {
329  case 0 : return r_2 * (piA_ * (piY_/piR_) * exp1_ - (piA_/piR_) * k2_2 * exp22_); //A
330  case 1 : return r_2 * (piC_ * - exp1_); //C
331  case 2 : return r_2 * (piG_ * (piY_/piR_) * exp1_ + (piA_/piR_) * k2_2 * exp22_); //G
332  case 3 : return r_2 * (piT_ * - exp1_); //T, U
333  }
334  }
335  //T, U
336  case 3 : {
337  switch(j) {
338  case 0 : return r_2 * (piA_ * - exp1_); //A
339  case 1 : return r_2 * (piC_ * (piR_/piY_) * exp1_ - (piC_/piY_) * k1_2 * exp21_); //C
340  case 2 : return r_2 * (piG_ * - exp1_); //G
341  case 3 : return r_2 * (piT_ * (piR_/piY_) * exp1_ + (piC_/piY_) * k1_2 * exp21_); //T, U
342  }
343  }
344  }
345  return 0;
346 }
347 
348 /******************************************************************************/
349 
350 const Matrix<double> & HKY85::getPij_t(double d) const
351 {
352  l_ = rate_ * r_ * d;
353  exp1_ = exp(-l_);
354  exp22_ = exp(-k2_ * l_);
355  exp21_ = exp(-k1_ * l_);
356 
357  //A
358  p_(0, 0) = piA_ * (1. + (piY_/piR_) * exp1_) + (piG_/piR_) * exp22_; //A
359  p_(0, 1) = piC_ * (1. - exp1_); //C
360  p_(0, 2) = piG_ * (1. + (piY_/piR_) * exp1_) - (piG_/piR_) * exp22_; //G
361  p_(0, 3) = piT_ * (1. - exp1_); //T, U
362 
363  //C
364  p_(1, 0) = piA_ * (1. - exp1_); //A
365  p_(1, 1) = piC_ * (1. + (piR_/piY_) * exp1_) + (piT_/piY_) * exp21_; //C
366  p_(1, 2) = piG_ * (1. - exp1_); //G
367  p_(1, 3) = piT_ * (1. + (piR_/piY_) * exp1_) - (piT_/piY_) * exp21_; //T, U
368 
369  //G
370  p_(2, 0) = piA_ * (1. + (piY_/piR_) * exp1_) - (piA_/piR_) * exp22_; //A
371  p_(2, 1) = piC_ * (1. - exp1_); //C
372  p_(2, 2) = piG_ * (1. + (piY_/piR_) * exp1_) + (piA_/piR_) * exp22_; //G
373  p_(2, 3) = piT_ * (1. - exp1_); //T, U
374 
375  //T, U
376  p_(3, 0) = piA_ * (1. - exp1_); //A
377  p_(3, 1) = piC_ * (1. + (piR_/piY_) * exp1_) - (piC_/piY_) * exp21_; //C
378  p_(3, 2) = piG_ * (1. - exp1_); //G
379  p_(3, 3) = piT_ * (1. + (piR_/piY_) * exp1_) + (piC_/piY_) * exp21_; //T, U
380 
381  return p_;
382 }
383 
384 const Matrix<double> & HKY85::getdPij_dt(double d) const
385 {
386  l_ = rate_ * r_ * d;
387  exp1_ = exp(-l_);
388  exp22_ = exp(-k2_ * l_);
389  exp21_ = exp(-k1_ * l_);
390 
391  //A
392  p_(0, 0) = rate_ * r_ * (piA_ * -(piY_/piR_) * exp1_ - (piG_/piR_) * k2_ * exp22_); //A
393  p_(0, 1) = rate_ * r_ * (piC_ * exp1_); //C
394  p_(0, 2) = rate_ * r_ * (piG_ * -(piY_/piR_) * exp1_ + (piG_/piR_) * k2_ * exp22_); //G
395  p_(0, 3) = rate_ * r_ * (piT_ * exp1_); //T, U
396 
397  //C
398  p_(1, 0) = rate_ * r_ * (piA_ * exp1_); //A
399  p_(1, 1) = rate_ * r_ * (piC_ * -(piR_/piY_) * exp1_ - (piT_/piY_) * k1_ * exp21_); //C
400  p_(1, 2) = rate_ * r_ * (piG_ * exp1_); //G
401  p_(1, 3) = rate_ * r_ * (piT_ * -(piR_/piY_) * exp1_ + (piT_/piY_) * k1_ * exp21_); //T, U
402 
403  //G
404  p_(2, 0) = rate_ * r_ * (piA_ * -(piY_/piR_) * exp1_ + (piA_/piR_) * k2_ * exp22_); //A
405  p_(2, 1) = rate_ * r_ * (piC_ * exp1_); //C
406  p_(2, 2) = rate_ * r_ * (piG_ * -(piY_/piR_) * exp1_ - (piA_/piR_) * k2_ * exp22_); //G
407  p_(2, 3) = rate_ * r_ * (piT_ * exp1_); //T, U
408 
409  //T, U
410  p_(3, 0) = rate_ * r_ * (piA_ * exp1_); //A
411  p_(3, 1) = rate_ * r_ * (piC_ * -(piR_/piY_) * exp1_ + (piC_/piY_) * k1_ * exp21_); //C
412  p_(3, 2) = rate_ * r_ * (piG_ * exp1_); //G
413  p_(3, 3) = rate_ * r_ * (piT_ * -(piR_/piY_) * exp1_ - (piC_/piY_) * k1_ * exp21_); //T, U
414 
415  return p_;
416 }
417 
418 const Matrix<double> & HKY85::getd2Pij_dt2(double d) const
419 {
420  double r_2 = rate_ * rate_ * r_ * r_;
421  l_ = rate_ * r_ * d;
422  double k1_2 = k1_ * k1_;
423  double k2_2 = k2_ * k2_;
424  exp1_ = exp(-l_);
425  exp22_ = exp(-k2_ * l_);
426  exp21_ = exp(-k1_ * l_);
427 
428  //A
429  p_(0, 0) = r_2 * (piA_ * (piY_/piR_) * exp1_ + (piG_/piR_) * k2_2 * exp22_); //A
430  p_(0, 1) = r_2 * (piC_ * - exp1_); //C
431  p_(0, 2) = r_2 * (piG_ * (piY_/piR_) * exp1_ - (piG_/piR_) * k2_2 * exp22_); //G
432  p_(0, 3) = r_2 * (piT_ * - exp1_); //T, U
433 
434  //C
435  p_(1, 0) = r_2 * (piA_ * - exp1_); //A
436  p_(1, 1) = r_2 * (piC_ * (piR_/piY_) * exp1_ + (piT_/piY_) * k1_2 * exp21_); //C
437  p_(1, 2) = r_2 * (piG_ * - exp1_); //G
438  p_(1, 3) = r_2 * (piT_ * (piR_/piY_) * exp1_ - (piT_/piY_) * k1_2 * exp21_); //T, U
439 
440  //G
441  p_(2, 0) = r_2 * (piA_ * (piY_/piR_) * exp1_ - (piA_/piR_) * k2_2 * exp22_); //A
442  p_(2, 1) = r_2 * (piC_ * - exp1_); //C
443  p_(2, 2) = r_2 * (piG_ * (piY_/piR_) * exp1_ + (piA_/piR_) * k2_2 * exp22_); //G
444  p_(2, 3) = r_2 * (piT_ * - exp1_); //T, U
445 
446  //T, U
447  p_(3, 0) = r_2 * (piA_ * - exp1_); //A
448  p_(3, 1) = r_2 * (piC_ * (piR_/piY_) * exp1_ - (piC_/piY_) * k1_2 * exp21_); //C
449  p_(3, 2) = r_2 * (piG_ * - exp1_); //G
450  p_(3, 3) = r_2 * (piT_ * (piR_/piY_) * exp1_ + (piC_/piY_) * k1_2 * exp21_); //T, U
451 
452  return p_;
453 }
454 
455 /******************************************************************************/
456 
457 void HKY85::setFreq(std::map<int, double>& freqs)
458 {
459  piA_ = freqs[0];
460  piC_ = freqs[1];
461  piG_ = freqs[2];
462  piT_ = freqs[3];
463  vector<string> thetas(3);
464  thetas[0] = getNamespace() + "theta";
465  thetas[1] = getNamespace() + "theta1";
466  thetas[2] = getNamespace() + "theta2";
467  ParameterList pl = getParameters().subList(thetas);
468  pl[0].setValue(piC_ + piG_);
469  pl[1].setValue(piA_ / (piA_ + piT_));
470  pl[2].setValue(piG_ / (piC_ + piG_));
471  setParametersValues(pl);
472 }
473 
474 /******************************************************************************/
475 
RowMatrix< double > exchangeability_
The exchangeability matrix of the model, defined as . When the model is reversible, this matrix is symetric.
double k1_
Definition: HKY85.h:184
double exp22_
Definition: HKY85.h:185
double kappa_
Definition: HKY85.h:184
void updateMatrices()
Compute and diagonalize the matrix, and fill the eigenValues_, leftEigenVectors_ and rightEigenVecto...
Definition: HKY85.cpp:80
double dPij_dt(size_t i, size_t j, double d) const
Definition: HKY85.cpp:245
This class implements a state map where all resolved states are modeled.
Definition: StateMap.h:161
RowMatrix< double > rightEigenVectors_
The matrix made of right eigen vectors (by column).
double r_
Definition: HKY85.h:184
double exp1_
Definition: HKY85.h:185
Vdouble eigenValues_
The vector of eigen values.
void setFreq(std::map< int, double > &freqs)
This method is redefined to actualize the corresponding parameters piA, piT, piG and piC too...
Definition: HKY85.cpp:457
STL namespace.
Vdouble freq_
The vector of equilibrium frequencies.
const Matrix< double > & getdPij_dt(double d) const
Definition: HKY85.cpp:384
double theta2_
Definition: HKY85.h:184
double theta_
Definition: HKY85.h:184
double exp21_
Definition: HKY85.h:185
double theta1_
Definition: HKY85.h:184
double d2Pij_dt2(size_t i, size_t j, double d) const
Definition: HKY85.cpp:296
HKY85(const NucleicAlphabet *alpha, double kappa=1., double piA=0.25, double piC=0.25, double piG=0.25, double piT=0.25)
Definition: HKY85.cpp:57
Partial implementation of the ReversibleSubstitutionModel interface.
static IntervalConstraint FREQUENCE_CONSTRAINT_SMALL
double l_
Definition: HKY85.h:185
double piC_
Definition: HKY85.h:184
double piG_
Definition: HKY85.h:184
double piY_
Definition: HKY85.h:184
RowMatrix< double > leftEigenVectors_
The matrix made of left eigen vectors (by row) if rightEigenVectors_ is non-singular.
const Matrix< double > & getPij_t(double d) const
Definition: HKY85.cpp:350
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...
RowMatrix< double > p_
Definition: HKY85.h:186
double k2_
Definition: HKY85.h:184
const Matrix< double > & getd2Pij_dt2(double d) const
Definition: HKY85.cpp:418
double piT_
Definition: HKY85.h:184
double piA_
Definition: HKY85.h:184
double Pij_t(size_t i, size_t j, double d) const
Definition: HKY85.cpp:194
double piR_
Definition: HKY85.h:184