stateprobs {LaMa} | R Documentation |
Calculate conditional local state probabilities for homogeneous HMMs
Description
Computes
\Pr(S_t = j \mid X_1, ..., X_T)
for homogeneous HMMs
Usage
stateprobs(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 |
transition probability matrix of dimension c(N,N), or array of k transition probability matrices of dimension c(N,N,k), if |
allprobs |
matrix of state-dependent probabilities/ density values of dimension c(n, N) |
trackID |
optional vector of length n containing IDs If provided, the total log-likelihood will be the sum of each track's likelihood contribution.
In this case, |
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_g()
,
stateprobs_p()
,
viterbi()
,
viterbi_g()
,
viterbi_p()
Examples
Gamma = tpm(c(-1,-2))
delta = stationary(Gamma)
allprobs = matrix(runif(10), nrow = 10, ncol = 2)
probs = stateprobs(delta, Gamma, allprobs)