Relative Content

Tag Archive for rmodelinghidden-markov-modelsjagsrjags

How to output sequence of hidden states on rjags after training the HMM model?

I am totally new in HMM and JAGS. My question is how can I get the hidden state sequence based on the trained model structure and parameters.
Specifically, I have trained a hidden Markov model by using rjags, and saved the sample results of model parameters, which contains 59 parameters with the lengths of 1000 (30000 iters, thining = 30).
So right now, I have the model structure which has been correctly written in the manner of JAGS, and the updated parameters(30000 burn-in, 30000 sample iters with 30 thinning). The question is, how can I get the corresponding hidden states?
I’ve been working on machine learning for a while, so my thought is loading the structure and parameters at first, then inputting a test sequence of observable states, then I will get what I want. But it seems different.
So far, I didn’t find any samples of this question, even in JAGS’s document.
Dose anyone know something about this? Thanks a lot.
My training code is as below: