Description Usage Arguments Value Examples
A helper function that formats hisse::MuHiSSE
's output into a matrix so transition rates between states can be easier to visualize.
1 | m_transition_matrix(model_fit, hidden_states = TRUE, states)
|
model_fit |
A muhisse fit object |
hidden_states |
Logical whether the model contains hidden states |
states |
A vector of state labels to replace hisse's 0/1 notation (see examples) |
The estimated transition rates formatted in a matrix
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | # The translation should follow the order of states in model_fit$solution.
# In this example, hisse's 00, 01, 10, and 11 states correspond to
# marine-plankton, marine-benthos, freshwater-plankton, and freshwater-benthos
States <- c("mp", "mb", "fp", "fb")
# muhisse model
data("diatoms")
m_transition_matrix(
model_fit = diatoms$muhisse,
hidden_states = TRUE,
states = States)
# CID8 model
# we have 8 hidden states, so the transition matrix is cumbersome
m_transition_matrix(
model_fit = diatoms$cid8,
hidden_states = TRUE,
states = States)
# musse model, no hidden states
m_transition_matrix(
model_fit = diatoms$musse,
hidden_states = FALSE,
states = c("mp", "mb", "fp", "fb"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.