stateprobs_g {LaMa} | R Documentation |
Calculate conditional local state probabilities for inhomogeneous HMMs
Description
Computes
\Pr(S_t = j \mid X_1, ..., X_T)
for inhomogeneous HMMs
Usage
stateprobs_g(delta, Gamma, allprobs, trackID = NULL, mod = NULL)
Arguments
delta |
initial or stationary distribution of length N, or matrix of dimension c(k,N) for k independent tracks, if |
Gamma |
array of transition probability matrices of dimension c(N,N,n-1), as in a time series of length n, there are only n-1 transitions If an array of dimension c(N,N,n) for a single track is provided, the first slice will be ignored. If |
allprobs |
matrix of state-dependent probabilities/ density values of dimension c(n, N) |
trackID |
optional vector of k track IDs, if multiple tracks need to be decoded separately |
mod |
optional model object containing initial distribution If you are using automatic differentiation either with |
Value
matrix of conditional state probabilities of dimension c(n,N)
See Also
Other decoding functions:
stateprobs()
,
stateprobs_p()
,
viterbi()
,
viterbi_g()
,
viterbi_p()
Examples
Gamma = tpm_g(runif(10), matrix(c(-1,-1,1,-2), nrow = 2, byrow = TRUE))
delta = c(0.5, 0.5)
allprobs = matrix(runif(20), nrow = 10, ncol = 2)
probs = stateprobs_g(delta, Gamma[,,-1], allprobs)