Fitting parameters of stochastic models
An estimate of the marginal likelihood at one . We want the posterior over .
We already have an algorithm that explores a posterior using nothing but likelihood evaluations: Metropolis-Hastings.
So: propose , run a particle filter to get , and accept or reject as usual.
This is particle marginal Metropolis-Hastings (PMMH).
Same , same data, 400 runs of the filter — fed into an algorithm derived assuming the exact likelihood.
The estimate is unbiased:
The chain still targets the correct posterior — exactly, not approximately. The noise costs us efficiency, never correctness.
Andrieu et al. (2010) — derived in the appendix
A lucky high estimate sits in the denominator of every later acceptance ratio, so the chain rejects good proposals until something beats it.
Tune so the standard deviation of the log likelihood estimate is roughly 1 to 3 at a representative .
Measured here at the posterior mean. The estimator is noisier out in the tails of the posterior, which is why the practical uses 256 rather than the 128 this curve appears to license.
Pitt et al. (2012); Doucet et al. (2015)
Metropolis-Hastings survives the second because the estimate is unbiased. HMC does not.
So we use robust adaptive Metropolis, which learns the proposal covariance for us (Vihola 2012).
Everything from the deterministic part of the course now carries over to stochastic models:
And we get the latent trajectories for free: each accepted comes with a sampled state path, which is state estimation alongside parameter estimation.
Is temporary immunity better described by one compartment or four? No amount of sampling SEITL answers that: you have to fit both.
Both ask only for the likelihood of the whole series, which is what the filter returns. DIC is the criterion we can compute here, and a rough one: it approximates predictive accuracy less well than the criteria usually recommended, which need a likelihood term for each observation on its own.
The criterion that is appropriate for model comparison is determined by the structure of the model.
Deviance, so that smaller is a better fit: .
Lower is better, and only the difference between two models means anything.
In the practical you will
The filter is random only because it consumes random numbers. Collect all of them into one vector :
Write for their density. Because the propagation is a deterministic map applied to standard draws, does not depend on .
Given , the filter is a deterministic function:
Define a joint density over the pair :
Integrating out at fixed averages the estimator over its own randomness, which is exactly what unbiasedness controls:
This is the only place unbiasedness is used.
It follows that integrates to one, and that
The -marginal of the enlarged target is the posterior we wanted.
Propose from , then fresh random numbers . The Metropolis-Hastings ratio for under that proposal is
The two factors are reciprocals, so they cancel, leaving
This is the acceptance ratio we started from. The random numbers never appear in the implementation because their proposal density cancels against their target density.
The condition worth naming is that must be a proper density, so the estimator has to be non-negative and strictly positive wherever the posterior is. Particle filter estimates satisfy this.
Andrieu and Roberts (2009); Andrieu et al. (2010)
Particle MCMC