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



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.

  • 3
    $\begingroup$ You might want to try STAN, from Andrew Gelman's lab - for many types of problems, it's far faster than BUGS or JAGS. $\endgroup$ – jbowman Sep 28 '13 at 13:29

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.

  • $\begingroup$ Correction: time-series models are covered in section II.6 $\endgroup$ – Brash Equilibrium Aug 31 '15 at 18:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.