Sequential Monte Carlo
- Dr. Jarad Niemi
STAT 615 - Iowa State University
October 20, 2017
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 1 / 72
Sequential Monte Carlo Dr. Jarad Niemi STAT 615 - Iowa State - - PowerPoint PPT Presentation
Sequential Monte Carlo Dr. Jarad Niemi STAT 615 - Iowa State University October 20, 2017 Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 1 / 72 Overview Outline Outline 1. State-space models 3. State and parameter
STAT 615 - Iowa State University
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 1 / 72
Overview Outline
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 2 / 72
Overview Bayesian inference
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 3 / 72
State-space models Definition
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 4 / 72
State-space models Graphical representation
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 5 / 72
State-space models Interpretation
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 6 / 72
State-space models Examples
volatility 250 500 750 1000 −10 −5 5 10 −10 −5 5 10
time value Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 7 / 72
State-space models Examples
state 250 500 750 1000 −1 1 2 3 −1 1 2 3
time value Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 8 / 72
State-space models Inference
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 9 / 72
State-space models Inference
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 10 / 72
State-space models Filtering
Goal: p(θt|y1:t) (filtered distribution) Recursive procedure: Assume p(θt−1|y1:t−1) Prior for θt p(θt|y1:t−1) =
=
=
One-step ahead predictive distribution for yt p(yt|y1:t−1) =
=
=
Filtered distribution for θt p(θt|y1:t) = p(yt|θt, y1:t−1)p(θt|y1:t−1) p(yt|y1:t−1) = p(yt|θt)p(θt|y1:t−1) p(yt|y1:t−1)
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 11 / 72
State-space models Smoothing
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 12 / 72
State-space models Forecasting
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 13 / 72
State inference
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 14 / 72
State inference Exact inference
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 15 / 72
State inference Exact inference
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 16 / 72
State inference Exact inference
p
ai p
i=1 ai . Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 17 / 72
State inference Exact inference
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 18 / 72
State inference Exact inference
t + Wt.
t + Vt.
tQ−1 t et,
tQ−1 t FtRt,
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 19 / 72
State inference The model
ind
ind
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 20 / 72
State inference The model
Sequential Monte Carlo October 20, 2017 21 / 72
State inference The model
Data Mean 95% Interval Data Mean 95% Interval Data Mean 95% Interval Data Mean 95% Interval Data Mean 95% Interval Data Mean 95% Interval Data Mean 95% Interval Data Mean 95% Interval Data Mean 95% Interval Data Mean 95% Interval Data Mean 95% Interval
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 22 / 72
State inference The model
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 23 / 72
State inference Approximate inference
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 24 / 72
State inference Monte Carlo sampling
n=100
−3 −2 −1 1 2 3 0.0 0.1 0.2 0.3 0.4 0.5
n=1,000
−3 −2 −1 1 2 3 0.0 0.1 0.2 0.3 0.4 0.5
n=10,000
−3 −2 −1 1 2 3 0.0 0.1 0.2 0.3 0.4 0.5
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 25 / 72
State inference Monte Carlo sampling
ind
J
2 3 4 5 0.10 0.11 0.12 0.13 0.14 0.15 0.16 Log_10 of number of samples P(Z>1) Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 26 / 72
State inference MCMC
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 27 / 72
State inference Importance sampling
ind
g(θi).
Cauchy−Normal Normal−Cauchy Normal−t_15 −5.0 −2.5 0.0 2.5 5.0 −5.0 −2.5 0.0 2.5 5.0 −5.0 −2.5 0.0 2.5 5.0 0.0 0.5 1.0 1.5 2.0
x density variable
target proposal ratio
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 28 / 72
State inference Importance sampling
t2(θi) N(θi;0,0.52) to each sample.
5 10 15 20 −3 −2 −1 1 2 3 i E[X]
E[X] weights
Sequential Monte Carlo October 20, 2017 29 / 72
State inference Importance sampling
J
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 30 / 72
State inference Importance sampling
J
2 3 4 5 3.0 3.1 3.2 3.3 3.4 3.5 Log_10 of number of samples P(Z>4.5) [x10^−6] Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 31 / 72
State inference Importance sampling
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 32 / 72
State inference Sequential importance sampling
t−1
t
t−1)
t
t )
J
t δθ(i)
t
t , θ(i) t
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 33 / 72
State inference Sequential importance sampling
J
t−1δθ(i)
t−1.
t
t−1)
t
t−1p(yt|θ(i) t )
J
t δθ(i)
t . Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 34 / 72
State inference Sequential importance sampling
2 4 6 8 10 −0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 t xt
Truth Particles 2 4 6 8 10 −0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 t xt
Truth Particles
4 6 8 10 −0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 t xt
Truth Particles
4 6 8 10 −0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 t xt
Truth Particles
4 6 8 10 −0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 t xt
Truth Particles
4 6 8 10 −0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 t xt
Truth Particles
4 6 8 10 −0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 t xt
Truth Particles
4 6 8 10 −0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 t xt
Truth Particles
4 6 8 10 −0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 t xt
Truth Particles
4 6 8 10 −0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 t xt
Truth Particles
Sequential Monte Carlo October 20, 2017 35 / 72
State inference Sequential importance sampling
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 36 / 72
State inference Sequential importance sampling with resampling
t−1:
t−1
t−1
t−1
t−1
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 37 / 72
State inference Sequential importance sampling with resampling
(Gordon, Salmond, and Smith 1993)
J
t−1δθ(i)
t−1.
t−1
t
t−1)
t
t )
J
t δθ(i)
t . Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 38 / 72
State inference Sequential importance sampling with resampling
2 4 6 8 10 1 2 3 t xt
Truth Particles Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 39 / 72
State inference Resampling (Douc, Capp´ e, and Moulines 2005)
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 40 / 72
State inference Resampling
ind
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 41 / 72
State inference Resampling
j=1 nj particles with
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 42 / 72
State inference Stratified sampling
ind
J , j J
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 43 / 72
State inference Systematic sampling
J for j = 1, 2, . . . , J
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 44 / 72
State inference When to resample
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 45 / 72
State inference When to resample
J
J
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 46 / 72
State inference When to resample
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 47 / 72
25 50 75 100 5 10 15 20
time Effective sample size
State inference Avoiding resampling
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 48 / 72
State inference Avoiding resampling
J
t−1.
t−1)
t
t−1)
J
t .
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 49 / 72
State inference Avoiding resampling
J
t−1δθ(i)
t−1.
t−1p(yt|µ(j) t )
t
t−1)
t
t
) p(yt|µ(j)
t
)
J
t δθ(i)
t .
t
t , usually µ(j) t
t−1].
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 50 / 72
State inference Avoiding resampling
2 4 6 8 10 1 2 3 t xt
Truth Particles Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 51 / 72
State inference Summary
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 52 / 72
State and parameter inference
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 53 / 72
State and parameter inference
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 54 / 72
State and parameter inference
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 55 / 72
State and parameter inference Resampling with fixed parameters
J
t−1δ(θt−1,ψ)(i).
t−1.
t
t−1, ψ(i)).
t
t , ψ(i)).
J
t δ(θt,ψ)(i).
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 56 / 72
State and parameter inference Resampling with fixed parameters
ind
ind
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 57 / 72
State and parameter inference Resampling with fixed parameters
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 58 / 72
2 4 6 8 10 −0.6 0.0 t 2 4 6 8 10 0.8 1.2 t 2 4 6 8 10 0.03 0.06 0.09 t 2 4 6 8 10 0.04 0.08 t
State and parameter inference Kernel density estimation
J
t−1δψ(i)
J
t−1N(aψ(i) + (1 − a)ψ, h2V )
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 59 / 72
State and parameter inference Kernel density estimation
0.99
Sequential Monte Carlo October 20, 2017 60 / 72
State and parameter inference Sufficient statistics
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 61 / 72
State and parameter inference Sufficient statistics
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 62 / 72
State and parameter inference Sufficient statistics Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 63 / 72
State and parameter inference Sufficient statistics Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 64 / 72
State and parameter inference MCMC kernels
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 65 / 72
State and parameter inference Summary
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 66 / 72
Advanced SMC
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 67 / 72
Advanced SMC Marginal likelihood calculations
T
J
t
t
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 68 / 72
Advanced SMC Theoretical results
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 69 / 72
Advanced SMC SMC-MCMC
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 70 / 72
Summary
Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 71 / 72
Summary References References Gordon, N. J., Salmond, D. J., and Smith, A. F. M. (1993), Novel approach to nonlinear/non-Gaussian Bayesian state estimation, IEEE Proceedings Part F: Communications, Radar and Signal Processing, 140, 107113. Pitt, M. K. and Shephard, N. (1999), Filtering via simulation: auxiliary particle filters, Journal of the American Statistical Association, 94, 590599. Liu, J. and West, M. (2001), Combined parameter and state estimation in simulation-based filtering, in Sequential Monte Carlo Methods in Practice, eds. A. Doucet, J. F. G. De Freitas, and N. J. Gordon, pp. 197217, Springer-Verlag, New York. Doucet, A., De Freitas, N., and Gordon, N. (2001), Sequential Monte Carlo Methods in Practice, Springer-Verlag, New York. Gilks, W. R. and Berzuini, C. (2001) “Following a Moving Target-Monte Carlo Inference for Dynamic Bayesian Models,” Journal of the Royal Statistical Society. Series B (Statistical Methodology), Vol. 63, No. 1, 127-146 Fearnhead, P. (2002), Markov chain Monte Carlo, sufficient statistics, and particle filters, Journal of Computational and Graphical Statistics, 11, 848862. Storvik, G. (2002), Particle filters in state space models with the presence of unknown static parameters, IEEE Transactions on Signal Processing, 50, 281289.
International Symposium on Image and Signal Processing and Analysis (ISPA), Zagreb Computation R::KFAS R::dlm R::pomp R::SMC (not updated sinced 2011-12-11) R::smcUtils LiBbi libbi.org/ (RBi https://github.com/pierrejacob/RBi) Jarad Niemi (STAT615@ISU) Sequential Monte Carlo October 20, 2017 72 / 72