Calculate conditional local state probabilities for inhomogeneous HMMs
stateprobs_g.RdComputes $$\Pr(\text{State}_t = j \mid X_1, ..., X_T)$$ for inhomogeneous HMMs
Arguments
- delta
initial distribution; either
a vector of length
nStates, ora matrix of dimension
c(nTracks, nStates)iftrackIDis provided
- Gamma
array of transition probability matrices of dimension
c(nStates, nStates, nObs), where the first slice of each track is ignored as there is no transition into the start of a track. For a single track, an array of dimensionc(nStates, nStates, nObs-1)is also accepted.- allprobs
matrix of state-dependent probabilities or density values of dimension
c(nObs, nStates)- trackID
optional vector of length
nObscontainingnTracksunique IDs that separate tracks- mod
optional model object containing
delta,Gamma,allprobs, and optionallytrackID. When usingRTMB::MakeADFunorqremlwithforward_gin the likelihood, these are reported automatically after model fitting and the object returned byRTMB::report()orqremlcan be passed directly.- forecast
logical, indicating if forecast probabilities \(\Pr(\text{State}_t = j \mid X_1, ..., X_t)\) should be calculated instead.
See also
Other decoding functions:
stateprobs(),
stateprobs_p(),
viterbi(),
viterbi_g(),
viterbi_p()