One of my sources is Ziheng Yang's Computational Molecular Evolution. According to him (and wikipedia), this model can be represented by a substitution-rate matrix which is usually called Q:
Yang uses λ in place of the often-used α. For this post we'll follow along with him.
As I posted about the other day, we need to have equations that will give us the probabilities for any time t. These should be recognizable:
Yang calls these
p0(t)
and p1(t)
.The corresponding transition-probability matrix is designated P(t) and it is:
And if we had P for one unit of evolutionary time, then we could do matrix multiplication (see here) to generate P for any time.
Now, Yang (and other sources) also says that:
And I've been trying to wrap my head around that, i.e. matrix exponentiation. Luckily, I've been getting into Gilbert Strang's MIT lectures on linear algebra (here). So I can appreciate what the inverse of a matrix is, such that:
where I is just the identity matrix of the same size and shape as Q. Now, suppose we can diagonalize Q. That is, we can find an invertible matrix U and a diagonal matrix Λ such that:
A diagonal matrix means that the matrix has non-zero values only on the diagonal, e.g.:
And that means that
Λ Λ
is simply:Look what happens when we do something like:
We only have to deal with Λ, and it's straightforward. Now for the real magic. I am reliably informed that this trick works for any function. For example:
where we have:
And, most impressive of all, U and U-1 are the right and left eigenvectors of Q, and the coefficients of Λ are its eigenvalues! We've looked at that in detail previously(here).