Pages

Sunday, November 1, 2015

Stochastic mapping with an ordered character

Yesterday I received the following question:

I have three character states (1,2,3) and Iâ€™d like to create stochastic
maps for a situation where character change is constrained to go through
state 2, so that the 1->3 and 3->1 transitions are not allowed. In my
analyses so far Iâ€™ve just been using and ARD model, but I wondered if there
is a way to implement these constrained pathways so that the Q matrix only
allows certain specified transitions? I was also wondering if there is an
easy way to constrain the root state for the analysis?

Both of these things are pretty easy to do. Here, I'll demonstrate with
simulated data & tree:

First, let's make the model we want to fit. Here, I assume that there is
two rates - one of forward transition, and a second of backward transition-
but I could have also fit a model with a single rate, or one in which each
type of permitted change had a different rate. (This just depends on my
preference.)

Finally, it is also possible to use Bayesian MCMC to sample the parameters
of the transition process from their posterior distribution rather than
setting them to their ML values (as is the default). This otherwise is
done in a very similar way to the above. For instance:

No comments:

Post a Comment

About this blog

This web-log chronicles the development of new tools for phylogenetic analyses in the phytools R package. Unless you a reading a very recent page of the blog, I recommend that you install the latest CRAN version of phytools (or latest beta release) before attempting to replicate any of the analyses of this site. That is because the linked functions may be archived, and very likely have been replaced by newer versions.