View source: R/tpm_functions.R
| generator | R Documentation |
This function builds the infinitesimal generator matrix for a continuous-time Markov chain from an unconstrained parameter vector.
generator(param, byrow = FALSE, report = TRUE)
param |
unconstrained parameter vector of length N*(N-1) where N is the number of states of the Markov chain |
byrow |
logical indicating if the transition probability matrix should be filled by row |
report |
logical, indicating whether the generator matrix Q should be reported from the fitted model. Defaults to |
infinitesimal generator matrix of dimension c(N,N)
Other transition probability matrix functions:
tpm(),
tpm_cont(),
tpm_emb(),
tpm_emb_g(),
tpm_g(),
tpm_g2(),
tpm_p()
# 2 states: 2 free off-diagonal elements
generator(rep(-1, 2))
# 3 states: 6 free off-diagonal elements
generator(rep(-2, 6))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.