powered by
Computes \(\Pr(S_t = j \mid X_1, ..., X_T)\)
stateprobs_g(delta, Gamma, allprobs)
Matrix of conditional state probabilities of dimension c(n,N)
Initial distribution of length N
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.
Matrix of state-dependent probabilities/ density values of dimension c(n, N)
Gamma = tpm_g(runif(99), matrix(c(-1,-1,1,-2), nrow = 2, byrow = TRUE)) delta = c(0.5, 0.5) allprobs = matrix(runif(200), nrow = 100, ncol = 2) probs = stateprobs_g(delta, Gamma, allprobs)
Run the code above in your browser using DataLab