generator {LaMa} | R Documentation |
Build the generator matrix of a continuous-time Markov chain
Description
This function builds the infinitesimal generator matrix for a continuous-time Markov chain from an unconstrained parameter vector.
Usage
generator(param, byrow = FALSE, report = TRUE)
Arguments
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 |
Value
infinitesimal generator matrix of dimension c(N,N)
See Also
Other transition probability matrix functions:
tpm()
,
tpm_cont()
,
tpm_emb()
,
tpm_emb_g()
,
tpm_g()
,
tpm_p()
Examples
# 2 states: 2 free off-diagonal elements
generator(rep(-1, 2))
# 3 states: 6 free off-diagonal elements
generator(rep(-2, 6))
[Package LaMa version 2.0.5 Index]