Rev Language Reference


fnFreeBinary - Free Binary transition rate matrix

Constructs a transition rate matrix between two states.

Usage

fnFreeBinary(Real[] transition_rates, Bool rescaled)

Arguments

transition_rates : Real[] (pass by const reference)
The transition rates between the two states.
rescaled : Bool (pass by value)
Should the matrix be normalized?
Default : TRUE

Return Type

Details

This function enables the user to define the non-normalized off-diagonal elements of the matrix while also providing the option to normalize the matrix. Normalization ensures that the mean instantaneous rate equals 1. For example, a branch of length 1 in a non-clock tree corresponds to an expected 1 substitution per character. It takes in two arguments: (1) transition_rates (tr) - A vector of real numbers of length 2 that represents the rate of transition between states. (2) rescaled - A boolean value that indicates whether or not the matrix should be normalized. Takes on TRUE by default. 0 and 1 represent our 2 states: Q = [[-q_{01}, q_{01}],[q_{10}, -q_{10}]] When len(transition_rates) = 1, the single element will get recycled. When len(transition_rates) > 2, everything after the first two elements in the vector will be ignored.

Example

# Under the ERM model
rate_pr := phylogeny.treeLength() / 10
mu ~ dnExp(rate_pr)

moves.append( mvScale(mu, lambda=1, weight=2.0) )

rate := rep(mu, 2)

Q := fnFreeBinary(rate, rescaled=false)

See Also