Bayesian estimation of a small state space model


I am working with a small state space model of the Australian economy. The model consists of three measurement equations:


The starred variable are latent states that I would like to estimate with the Kalman filter.


The authors of the original paper use the following priors

I’ve cast the model into state space form, and have been able to estimate it via maximum likelihood. However, it is a bit fiddly as the state variable y* is sum of two I(1) variables and suffers from the pile up problem (as does the variable z which enters in the r* equation).

I’d like to compare these results with a Bayesian estimation. Can Stan implement this kind of model? If so, could someone please point me to an example where something similar has been done (namely a model with multiple measurement and state equations).



Since nobody else answered, I will give it a try:
In general, if you can write a simulator that creates new data according to the model using for loops, basic math operations and sampling from non-exotic probability distributions, and you don’t have discrete latent variables, you should be able to express the model in Stan without much hassle.

Without deeply understanding either economic context or the model you want to use, it looks quite plausible Stan would work with it. Whether the proposed priors are sensible or whether the model has well behaved posterior geometry to allow for reliable inference is difficult to say, but at least Stan will likely let you know if there are problems. Note that it is not uncommon that when reimplementing a complex model previously fit with Metropolis-Hasting or Gibbs to Stan, Stan will signal convergence problems. In most cases those problems turn out to have been present even in the original fit, but weren’t diagnosed.


Thanks for your reply! I’ve had a look at some of the work Jim Savage has done - here he creates a dynamic factor model . This looks like one possible approach. When you say “discrete latent states” what exactly do you mean? Are you referring to their probability distribution?

1 Like

Yes - Stan cannot (directly) handle unknown parameters that are discrete. There are workarounds, but if I understand your model correctly, you will not need this.