get_ML_states_from_relprobs(relprobs, statenames, returnwhat = "states", if_ties = "takefirst")
ML_states
or ML_states_indices
, depending
on returnwhat
.
See http://blog.phytools.org/2013/03/marginal-ancestral-state-reconstruction.html for more discussion of marginal ancestral state reconstructions, versus mere scaled conditional likelihoods.
Revell and other sources (Felsenstein (2004)) advocate the "re-rooting" method for obtaining the marginal ancestral state reconstructions; however, re-rooting requires a time-reversible model and a tree with no root. In biogeography we have a non-reversible model, and typically a time-scaled chronogram. However, the same result can be obtained by modifying the scaled conditional likelihoods obtained from a downpass from the tips, via an doing an up-pass from the root scaled conditional likelihoods, being careful to transfer probabilities via the time-forward version of the Q-matrix and cladogenesis/speciation matrix.
Note: further notes as this is implemented (required!)
Felsenstein2004
Matzke_2012_IBS
get_ML_state_indices