# Statisfaction

## SMC^2 algorithm for state-space models

Posted in Statistics by Pierre Jacob on 28 February 2011

Hi again,

With Nicolas Chopin and Omiros Papaspiliopoulos, we’ve just submitted a paper called SMC^2: a sequential Monte Carlo algorithm with particle Markov chain Monte Carlo updates. You can read the article online on arXiv here.

This algorithm allows to estimate the parameters in a state space models, without any assumptions of linearity or gaussianity. Usually in this context, parameter estimation was done by EM algorithms, which give point estimates, or by the Gibbs sampling, which is likely to converge veeeryyy slowly considering the dimension of the hidden states. However the recent Particle Markov Chain Monte Carlo method of Andrieu, Doucet and Holenstein allows to do exact Bayesian inference for these models, as well as state filtering, using a clever mix of SMC and MCMC.

Our algorithm adds a few things compared to the PMCMC by “making it fully SMC”: it allows for sequential estimation, ie if you get new data you can update your previous estimates without having to restart the algorithm from the beginning, it is more likely to capture multiple modes in case the posterior distribution is multimodal, and it allows the sequential estimation of the model evidence, which can be used  for model selection. On top of that it allows sequential filtering and smoothing of the hidden states, all of which under parameter uncertainty.

Since the first arXival in January we’ve changed quite a lot of things, including a new numerical section. The former examples are still available in supplementary material, that I’ll put online soon. Our new examples include a quite sophisticated multi factor stochastic volatility model with leverage, that we applied on the S&P 500 data set, and a state-space model for extreme values that we apply to athletics records, in order to compute the probability of beating a previous world record, ie assessing the likelihood of a rare event.

The code used to produce the numerical results is available as a python package on google code:

This package has a few dependencies, incluging python, numpy, scipy, and a C compiler like gcc. To plot the figures you need R and the ggplot2 library. All of those are free software and in the repositories of common GNU/Linux distributions like Ubuntu or Fedora.

Enjoy!

UPDATE: I’ve uploaded the slides I’ve presented this morning in an internal seminar, here they are: