Data is \(D\), a \(n\times L\) matrix
\(D_{ij}\) is value of \(j\)th residue in \(i\) sequence
Want to calculate \(\mathcal L(T) = P(D|T,\mu)\) where \(T\) is binary trees with \(n\) leaves and sequence–a row of \(D\)–associated with each leaf. \(\mu\) are paramters of mutation model.
\(P(D|T) = \prod_{i= 1}^L P(D_{:,i}|T)\) since sites independent
To find \(P(D_{:,i}|T)\) need to have unknown ancestral values, \(A_{:,i}\)
Don't know \(A_{:,i}\) so sum over all possible vallue: \(P(D_{:,i}|T) = \sum_{A_{:,i}} P(D_{:,i}, A_{:,i} |T)\)
Can do this sum using dynamic programming (see Felsenstein 1973, 1981)