Build the transition probability matrix from unconstrained parameter vector
tpm.RdMarkov chains are parametrised in terms of a transition probability matrix \(\Gamma\), for which each row contains a conditional probability distribution of the next state given the current state. Hence, each row has entries between 0 and 1 that need to sum to one.
For numerical optimisation, we parameterise in terms of unconstrained parameters, thus this function computes said matrix from an unconstrained parameter vector via the inverse multinomial logistic link (also known as softmax) applied to each row.
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
Defaults to
FALSE, but should be set toTRUEif one wants to work with a matrix of beta parameters returned by popular HMM packages likemoveHMM,momentuHMM, orhmmTMB.- ref
Optional integer vector of length N giving, for each row, the column index of the reference state (its predictor is fixed to 0). Defaults to the diagonal (
ref = 1:N).
See also
Other transition probability matrix functions:
generator(),
tpm_cont(),
tpm_emb(),
tpm_emb_g(),
tpm_g(),
tpm_g2(),
tpm_p()