Solved – How does JAGS deal with state space models

I am trying to use JAGS to deal with the following multivariate state space model.

$Y_t=X_ttheta_t+epsilon_t$

$theta_t=theta_{t-1}+nu_t$

JAGS code is neat but JAGS is running too slow when I am monitoring several hundred variables in the model. I decide to use forward filtering backward sampling algorithm (FFBS) to write my own code. I am wondering how JAGS deals with state space model and whether FFBS is more effcient than JAGS.

Section 6 of the Stan reference guide (https://github.com/stan-dev/stan/releases/download/v2.4.0/stan-reference-2.4.0.pdf) describes coding various time-series models. Stan is pretty similar to JAGS. I have used JAGS for Hidden Markov Models with mixed results–pretty slow and I'm not 100% sure of what is "going on under the hood" at times. Given I haven't really done any state space modeling in Stan I can't vouch for it. But they've got some incredible people working on it (Gelman, Carpenter, etc.) so I'm hopeful. Anyways, hope this helps.

Depending on the complexity of your model, you could use the dlm package in R. It's pretty user-friendly for standard linear Gaussian state space models (i.e., dynamic linear models). It also allows for both MLE and Bayesian MCMC, which is nice.

Similar Posts:

Rate this post

Leave a Comment