fnFreeK - Free K Rate Matrix
| transition_rates : | RealPos[][] (pass by const reference) |
| Transition rates between states. | |
| rescaled : | Bool (pass by value) |
| Should the matrix be normalized? | |
| Default : TRUE | |
| matrixExponentialMethod : | String (pass by value) |
| The method used to compute the matrix exponential. | |
| Default : eigen | |
| Options : scalingAndSquaring|scalingAndSquaringPade|scalingAndSquaringTaylor|uniformization|eigen |
# Define vector to pass, this will create a 2-by-2 matrix
x <- v(0.5, 0,5)
# Use fnFreeK to create rate matrix
# Note the second argument is true in this case so rates will be normalized
fnFreeK(x)
[ [ -1.0000, 1.0000 ] ,
[ 1.0000, -1.0000 ] ]
# Case where rates are not normalized
x <- v(0.5, 0.5)
fnFreeK(x, false)
[ [ -0.5000, 0.5000 ] ,
[ 0.5000, -0.5000 ] ]
# Define matrix for 3-by-3 rate matrix object
x <- v([0, .6, .4], [.2, 0, .4], [.3, .3, 0])
# Create rate matrix object
fnFreeK(x)
[ [ -1.0000, 0.6000, 0.4000 ] ,
[ 0.2000, -0.6000, 0.4000 ] ,
[ 0.3000, 0.3000, -0.6000 ] ]