Gurjinder Mohan writes:

I was wondering if you had any advice specific to state space models when attempting model validation and calibration. I was planning on conducting a graphical posterior predictive check.

I’d also recommend fake-data simulation. Beyond that, I’d need to know more about the example.

I’m posting here because this seems like a topic that some commenters could help on (and could supply the 3 things promised by the above title).

Three things? I see… zero. Was the post cut off?

Nick:

Nah, I was just going for a buzzfeed-style title. I added a parenthetical to explain the joke.

He asked about state space model validation. What happened next blew my mind.

+1

Well I just started playing around with these kinds of models for work. I stumbled across:

https://github.com/sinhrks/stan-statespace

Which moved the models from An Introduction to State Space Time Series Analysis in Stan in R. The R scripts contain some checks.

And I took a stab at a graphical approach for this in pystan here:

https://github.com/bioinfonm/pystan_musings/blob/master/beginners_excercise/three_cent_wheat_linear_state_space/pystan_three_cent_english_grain_data_linear_state_space.ipynb

The state space model is down at the bottom of the notebook. Oh and no fake data yet. I’ll add that in tomorrow.

My priors are likely off. Still working on understanding this whole Bayesian modelling thing.