nonRev — The General Non-Reversible rate matrix

Usage

nonRev(rates: Map<String,Double>, a: a) → CTMC<a>

Arguments

Underlined names in default expressions refer to other arguments. A default beginning with ~ specifies a prior distribution.

rates:

rate matrix

Default: ~SymmetricDirichletOn(ordered_letter_pairs(a),1)

a:

The alphabet

Default: The alphabet in the current context

Original default expressions
rates
~SymmetricDirichletOn(ordered_letter_pairs(@a),1)
a
get_state(alphabet)

Description

The general non-reversible rate matrix Q(i,j). Requires a rooted tree.

Non-reversible rate matrices create letter trajectories that have different probabilities in the forwards and backwards direction. This means that likelihoods under non-reversible models depend on the root location and can be used to estimate the root location.

At equilibrium, non-reversible models contain directional circular flow around paths of 3 or more letters. The direction of flow around these paths is what indicates that time is going forward or backward.

Also note that even reversible models are directional if they start out of equilibrium. Non-reversible models are directional even at equilibrium. This model assumes that the initial frequencies are the equilibrium frequencies.

The flux measures the degree of non-reversibility:

flux(i,j) = pi(i)Q(i,j) - pi(j)Q(j,i)

If flux(i,j) is positive then there is excess flow from i -> j at equilibrium. If it is negative then the flow is from j -> i.

The nonreversibility ranges between 0 and 1, and is given by the total flux over the total flow:

0.5*sum(abs(flux))/sum(abs(flow))

The 0.5 avoids overcounting the flux.

Since this model is nonreversible, it requires a rooted tree prior such as:

--tree='~UniformRootedTree(taxa)'

See also