This branch fixes the mkv_model_gamma_discretized_multistate.Rev script included with the Discrete Morphology tutorial. The script contains an implementation of the Site-Heterogeneous Discrete Morphology (SHDM) model, which extends Wright et al.'s (2016) beta prior approach to relaxing the assumption of equal state frequencies to multistate characters. The previous implementation contained several bugs, which are now fixed here:
The script attempted to make pi and rev_pi into local variables, which are not allowed in RevBayes (cf. PR #251). As a result, these were overwritten with the value that was assigned to them in the last iteration of the loop.
To generate several mutually different vectors of equilibrium state frequencies, the original script simply redrew the free parameter of the beta distribution (beta_scale) from the prior at every step, and deterministically derived the vector from each of the drawn values. This made little sense given that it also attempted to estimate beta_scale from the data. Here, the state frequency vectors are instead randomly drawn from a Dirichlet distribution, whose concentration parameter can in turn be meaningfully estimated.
This branch fixes the
mkv_model_gamma_discretized_multistate.Rev
script included with the Discrete Morphology tutorial. The script contains an implementation of the Site-Heterogeneous Discrete Morphology (SHDM) model, which extends Wright et al.'s (2016) beta prior approach to relaxing the assumption of equal state frequencies to multistate characters. The previous implementation contained several bugs, which are now fixed here:pi
andrev_pi
into local variables, which are not allowed in RevBayes (cf. PR #251). As a result, these were overwritten with the value that was assigned to them in the last iteration of the loop.beta_scale
) from the prior at every step, and deterministically derived the vector from each of the drawn values. This made little sense given that it also attempted to estimatebeta_scale
from the data. Here, the state frequency vectors are instead randomly drawn from a Dirichlet distribution, whose concentration parameter can in turn be meaningfully estimated.