<<

Advanced Computational Methods in : Lecture 5 Sequential Monte Carlo/Particle Filtering

Axel Gandy

Department of Mathematics Imperial College London http://www2.imperial.ac.uk/~agandy

London Taught Course Centre for PhD Students in the Mathematical Sciences Autumn 2015 Introduction Particle Filtering Improving the Algorithm Further Topics Summary

Outline Introduction Setup Examples Finitely Many States

Particle Filtering

Improving the Algorithm

Further Topics

Summary

Axel Gandy Particle Filtering 2 Introduction Particle Filtering Improving the Algorithm Further Topics Summary

Sequential Monte Carlo/Particle Filtering

I Particle filtering introduced in Gordon et al. (1993)

I Most of the material on particle filtering is based on Doucet et al. (2001) and on the tutorial Doucet & Johansen (2008). I Examples:

I Tracking of Objects I Robot Localisation I Financial Applications

Axel Gandy Particle Filtering 3 Setup - I x0, x1, x2, ... : unobserved - hidden states

I y1, y2,... : observations;

y1 y2 y3 y4

x0 x1 x2 x3 x4 ...

I y1, y2,... are conditionally independent given x0, x1,... I Model given by

I π(x0) - the initial distribution I f (xt |xt−1) for t ≥ 1 - the transition kernel of the Markov chain I g(yt |xt ) for t ≥ 1 - the distribution of the observations I Notation:

I x0:t = (x0,..., xt ) - hidden states up to time t I y1:t = (y1,..., yt ) - observations up to time t

I Interested in the posterior distribution p(x0:t |y1:t ) or in p(xt |y1:t ) Introduction Particle Filtering Improving the Algorithm Further Topics Summary

Some Remarks

I No explicit solution in the general case - only in special cases.

I Will focus on the time-homogeneous case, i.e. the transition densities f and the density of the observations g will be the same for each step. Extensions to inhomogeneous case straightforward.

I It is important that one is able to update quickly as new data becomes available, i.e. if yt+1 is observed want to be able to quickly compute p(xt+1|y1:t+1) based on p(xt |y1:t ) and yt+1.

Axel Gandy Particle Filtering 5 Example- Bearings Only Tracking I Gordon et al. (1993); Ship moving in the two-dimensional plane I Stationary observer sees only the angle to the ship. I Hidden states: position xt,1, xt,2, speed xt,3, xt,4. I Speed changes randomly 2 2 xt,3 ∼ N(xt−1,3, σ ), xt,4 ∼ N(xt−1,4, σ )

I Position changes accordingly

xt,1 = xt−1,1 + xt−1,3, xt,2 = xt−1,2 + xt−1,4 −1 2 I Observations: yt ∼ N(tan (xt,1/xt,2), η )

●●

1.0 ● ●● ● ● ●● ●● ● ● ● ● ● ● ●

0.8 ● ● ● ● ● ●● ● ● ●● ●● ● ● ● ● ● ● ●

0.6 ● ● ● ● ● ● ● ● ● ● ●

0.4 ● ● ● ● ● ● ● ● ● ● 0.2 ● ● ● ● ● ● ● ●

0.0 ● ● ● −1.0 −0.8● −0.6 −0.4 −0.2 0.0 Introduction Particle Filtering Improving the Algorithm Further Topics Summary

Example- Stochastic Volatility 2 I Returns: yt ∼ N(0, β exp(xt )) (observable from price data) σ2 σ2 I Volatility: xt ∼ N(αxt−1, (1−α)2 ), x1 ∼ N(0, (1−α)2 ), I σ = 1, β = 0.5, α = 0.95

● ● ● ● Volatility xt ● Returns yt ● ● 10 ● ●

● ● ● ● 5 ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ●● ● ● ● ● ● ● ● ●● ● ● ● ● ●● ● ● ●● ● ● ● ● ● ● ● ●● ●● ●●● ●● ●●●●● ● ●● ● ● ● ● ● ● ● ● ●● ● ● ● ● ●●●● ● ●● ●● ● ● ●● ● ● ● ● ●●●●●●●● ● ●●● ● ●● ● ●● ●●●●●●●●●●●●●●●●●●●●●●●● ●●● ●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●● ●●●● ● ●● ● ●●● ● ●●●● ● ● ●● ●● 0 ● ● ● ●●● ●●● ●●●●● ●● ● ●●●● ●●● ●●● ● ●●●●●● ● ● ●●●●●●●● ● ●● ●●●● ● ●● ●●● ●● ●● ● ● ● ● ●●● ●●●● ●●● ● ● ● ●●● ● ●● ● ●● ● ●● ● ● ●● ● ● ● ●● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ●● ●● ● ●

−5 ● ● ● ●

0 50 100 150 200 250 300 350 t

Axel Gandy Particle Filtering 7 Introduction Particle Filtering Improving the Algorithm Further Topics Summary

Hidden Markov Chain with finitely many states

I If the hidden process xt takes only finitely many values then p(xt+1|y1:t+1) can be computed recursively via X p(xt+1|y1:t+1) ∝ g(yt+1|xt+1) f (xt+1|xt )p(xt |y0:t ) xt

I May not be practicable if there are too many states!

Axel Gandy Particle Filtering 8 Kalman Filter I Kalman (1960) I Linear Gaussian state space model:

I x0 ∼ N(xˆ0, P0) I xt = Axt−1 + wt I yt = Hxt + vt I wt ∼ N(0, Q) iid, vt ∼ N(0, R) iid I A, H deterministic matrices; xˆ0, P0, A, H, Q, R known

I Explicit computation and updating of the posterior possible:

Posterior: xt |y1,..., yt ∼ N(ˆxt , Pt )

ˆx0, P0

Measurement Update Time Update − 0 − 0 −1 − Kt = Pt H (HPt H + R) ˆxt = Aˆxt−1 − − − 0 ˆxt = ˆxt + Kt (yt − Hˆxt ) Pt = APt−1A + Q − Pt = (I − Kt H)Pt Kalman Filter - Simple Example

I x0 ∼ N(0, 1) I xt = 0.9xt−1 + wt I yt = 2xt + vt I wt ∼ N(0, 1) iid, vt ∼ N(0, 1) iid

yt 5 0 −5 −10 −15

0 20 40 60 80 100 t

5 true xt xt|y1,...,yt 95% 0 −5

0 20 40 60 80 100 t Introduction Particle Filtering Improving the Algorithm Further Topics Summary

Kalman Filter - RemarksI

I Updating very easy - only involves linear algebra.

I Very widely used

I A, H, Q and R can change with time

I A linear control input can be incorporated, i.e. the hidden state can evolve according to

xt = Axt−1 + But−1 + wt−1

where ut can be controlled. I Normal prior/updating/observations can be replaced through appropriate conjugate distributions.

I Continuous Time Version: Kalman-Bucy filter See Øksendal (2003) for a nice introduction.

Axel Gandy Particle Filtering 11 Introduction Particle Filtering Improving the Algorithm Further Topics Summary

Kalman Filter - RemarksII

I extension to nonlinear dynamics:

I xt = f (xt−1, ut−1, wt−1) I yt = g(xt , vt ). where f and g are nonlinear functions. The extended Kalman filter linearises the nonlinear dynamics around the current mean and covariance. To do so it uses the Jacobian matrices, i.e. the matrices of partial derivatives of f and g with respect to its components. The extended Kalman filter does no longer compute precise posterior distributions.

Axel Gandy Particle Filtering 12 Introduction Particle Filtering Improving the Algorithm Further Topics Summary

Outline Introduction

Particle Filtering Introduction Bootstrap Filter Example-Tracking Example-Stochastic Volatility Example-Football Theoretical Results

Improving the Algorithm

Further Topics

Summary

Axel Gandy Particle Filtering 13 What to do if there were no observations...

y1 y2 y3 y4

x0 x1 x2 x3 x4 ...

Without observations yi the following simple approach would work: I Sample N particles following the initial distribution

(1) (N) x0 ,..., x0 ∼ π(x0)

I For every step propagate each particle according to the transition kernel of the Markov chain:

(j) (j) xi+1 ∼ f (·|xi ), j = 1,..., N

I After each step there are N particles that approximate the distribution of xi . I Note: very easy to update to the next step. Introduction Particle Filtering Improving the Algorithm Further Topics Summary

Importance

I Cannot sample from x0:t |y1:t directly. I Main idea: Change the density we are sampling from. R I Interested in E(φ(x0:t )|y1:t ) = φ(x0:t )p(x0:t |y1:t )dx0:t I For any density h, Z p(x0:t |y1:t ) E(φ(x0:t )|y1:t ) = φ(x0:t ) h(x0:t )dx0:t , h(x0:t )

I Thus an unbiased of E(φ(x0:t )|y1:t ) is N 1 X ˆI = φ(xi )w i , N 0:t t i=1

i i p(x0:t |y1:t ) 1 N where wt = i and x0:t ,..., x0:t ∼ h iid. h(x0:t ) i I How to evaluate p(x0:t |y1:t )? I How to choose h? Can be done recursively?

Axel Gandy Particle Filtering 15 Introduction Particle Filtering Improving the Algorithm Further Topics Summary

Sequential Importance Sampling I

I Recursive definition and sampling of the importance : h(x0:t ) = h(xt |x0:t−1)h(x0:t−1)

I Can the weights be computed recursively? By Bayes’ Theorem:

p(x0:t |y1:t ) p(y1:t |x0:t )p(x0:t ) wt = = h(x0:t ) h(x0:t )p(y1:t ) Hence,

g(yt |xt )p(y1:t−1|x0:t−1)f (xt |xt−1)p(x0:t−1) wt = h(xt |x0:t−1)h(x0:t−1)p(y1:t ) Thus, g(yt |xt )f (xt |xt−1) p(y1:t−1) wt = wt−1 h(xt |x0:t−1) p(y1:t )

Axel Gandy Particle Filtering 16 Introduction Particle Filtering Improving the Algorithm Further Topics Summary

Sequential Importance Sampling I

I Recursive definition and sampling of the importance sampling distribution: h(x0:t ) = h(xt |x0:t−1)h(x0:t−1)

I Can the weights be computed recursively? By Bayes’ Theorem:

p(x0:t |y1:t ) p(y1:t |x0:t )p(x0:t ) wt = = h(x0:t ) h(x0:t )p(y1:t ) Hence,

g(yt |xt )p(y1:t−1|x0:t−1)f (xt |xt−1)p(x0:t−1) wt = h(xt |x0:t−1)h(x0:t−1)p(y1:t ) Thus, g(yt |xt )f (xt |xt−1) p(y1:t−1) wt = wt−1 h(xt |x0:t−1) p(y1:t )

Axel Gandy Particle Filtering 16 Introduction Particle Filtering Improving the Algorithm Further Topics Summary

Sequential Importance Sampling I

I Recursive definition and sampling of the importance sampling distribution: h(x0:t ) = h(xt |x0:t−1)h(x0:t−1)

I Can the weights be computed recursively? By Bayes’ Theorem:

p(x0:t |y1:t ) p(y1:t |x0:t )p(x0:t ) wt = = h(x0:t ) h(x0:t )p(y1:t ) Hence,

g(yt |xt )p(y1:t−1|x0:t−1)f (xt |xt−1)p(x0:t−1) wt = h(xt |x0:t−1)h(x0:t−1)p(y1:t ) Thus, g(yt |xt )f (xt |xt−1) p(y1:t−1) wt = wt−1 h(xt |x0:t−1) p(y1:t )

Axel Gandy Particle Filtering 16 Introduction Particle Filtering Improving the Algorithm Further Topics Summary

Sequential Importance Sampling II i i wt I Can work with normalised weights:w ˜t = P j ; then one gets j wt the recursion

i i i i i g(yt |xt )f (xt |xt−1) w˜t ∝ w˜t−1 i i h(xt |x0:t−1)

I If one uses uses the prior distribution h(x0) = π(x0) and h(xt |x0:t−1) = f (xt |xt−1) as importance sampling distribution then the recursion is simply

i i i w˜t ∝ w˜t−1g(yt |xt )

Axel Gandy Particle Filtering 17 Introduction Particle Filtering Improving the Algorithm Further Topics Summary

Failure of Sequential Importance Sampling

I Weights degenerate as t increases. I Example: x0 ∼ N(0, 1), xt+1 ∼ N(xt , 1), yt ∼ N(xt , 1).

I N = 100 particles 1 N I Plot of the empirical cdfs of the normalised weightsw ˜t ,..., wt

t= 1 t= 10 t= 20 t= 40

● ● ● ● ● ● ● ● ● ● ● ● 1.0 ● 1.0 ● 1.0 ● 1.0 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 0.8 ● 0.8 ● 0.8 ● ● 0.8 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● 0.6 ● 0.6 ● 0.6 ● ● 0.6 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●

Fn(x) ● Fn(x) ● ● Fn(x) ● Fn(x) ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 0.4 ● ● 0.4 ● 0.4 ● 0.4 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● 0.2 ● 0.2 ● ● 0.2 0.2 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 0.0 0.0 0.0 0.0

1e−52 1e−41 1e−30 1e−19 1e−08 1e−52 1e−41 1e−30 1e−19 1e−08 1e−52 1e−41 1e−30 1e−19 1e−08 1e−52 1e−41 1e−30 1e−19 1e−08 x x x x Note the log-scale on the x-axis. I Most weights get very small.

Axel Gandy Particle Filtering 18 Introduction Particle Filtering Improving the Algorithm Further Topics Summary

Resampling

I Goal: Eliminate particles with very low weights.

I Suppose N X i Q = w˜ δ i t xt i=1

is the current approximation to the distribution of xt . I Then one can obtain a new approximation as follows: i I Sample N iid particles ˜xt from Q I The new approximation is

N ˜ X 1 Q = δ˜xi N t i=1

Axel Gandy Particle Filtering 19 Introduction Particle Filtering Improving the Algorithm Further Topics Summary

The Bootstrap Filter (i) 1. Sample x0 ∼ π(x0) and set t = 1 2. Importance Sampling Step For i = 1,..., N: (i) (i) (i) (i) (i) I Sample ˜xt ∼ f (xt |xt−1) and set ˜x0:t = (x0:t−1, ˜xt ) (i) (i) I Evaluate the importance weightsw ˜t = g(yt |˜xt ). 3. Selection Step: (i) I Resample with replacement N particles (x0:t ; i = 1,..., N) from (1) (1) the set {˜x0:t ,..., ˜x0:t } according to the normalised importance (i) w˜t weights PN (j) . j=1 w˜t I t:=t+1; go to step 2.

Axel Gandy Particle Filtering 20 Illustration of the Bootstrap Filter N=10 particles

● ● ● ● ● ● ● ● ● ●

g(y1|x) ● ● ● ● ● ● ● ● ● ●

● ● ● ● ● ● ●

●● ●● ● ● ● ●● ●

g(y2|x)

● ● ●● ● ● ● ●● ● ● ●● ● ● ●

●● ● ● ● ● ●● ●

g(y3|x) ●● ● ● ● ● ●● ● ● ● ● ● ● ●●

−2 −1 0 1 2 Introduction Particle Filtering Improving the Algorithm Further Topics Summary

Example- Bearings Only Tracking

I N = 10000 particles

● ●●● 1.0 ●● ● ●●● ●● ●● ●● ●● ●● ●●● ●● ●● ●●● ● ●● ● ●● ● ● ● ● ●● ●●

0.5 ● ●● ●● ●● ●● ●● ●● ● ● ● ● ● ● ● ● ● true position ● ● 0.0 ● ● estimated position ● ● ● ●● observer ● ●● ●● ●● ●● ●● ● ● ● ● ●● −0.5 ● ●● ●● ● ●●

−1.2 −1.0 −0.8 −0.6 −0.4 −0.2 0.0

Axel Gandy Particle Filtering 22 Introduction Particle Filtering Improving the Algorithm Further Topics Summary

Example- Stochastic Volatility

I Bootstrap Particle Filter with N = 1000

true volatility mean posterior volatility

5 95% credible interval 0 xtrue −5

0 50 100 150 200 250 300 350 t

Axel Gandy Particle Filtering 23 Introduction Particle Filtering Improving the Algorithm Further Topics Summary

Example: Football

I Data: Premier League 2007/08 I xt,j “strength” of the jth team at time t, j = 1,..., 20 I yt result of the games on date t I Note: not time-homogeneous (different teams playing one-another - different time intervals between games). I Model: I Initial distribution of the strength: xt,j ∼ N(0, 1) 1/2 I Evolution of strength: xt,j ∼ N((1 − ∆/β) xt−∆,j , ∆/β) will use β = 50 I Result of games conditional on strength: Match between team H of strength xH (at home) against team A of strength xA. Goals scored by the home team ∼ Poisson(λH exp(xH − xA)) Goals scored by the away team ∼ Poisson(λA exp(xA − xH )) λH and λA constants chosen based on the average number of goals scored at home/away.

Axel Gandy Particle Filtering 24 Mean Team Strength 1.0 Arsenal Aston Villa Birmingham Blackburn 0.5 Bolton Chelsea Derby Everton

0.0 Fulham Liverpool −0.5 −1.0 0 50 100 150 200 250 300 350 t 1.0 Man City Man United Middlesbrough Newcastle 0.5 Portsmouth Reading Sunderland Tottenham

0.0 West Ham Wigan −0.5 −1.0 0 50 100 150 200 250 300 350 t (based on N = 100000 particle) League Table at the end of 2007/08 1 Man Utd 87 2 Chelsea 85 3 Arsenal 83 4 Liverpool 76 5 Everton 65 6 Aston Villa 60 7 Blackburn 58 8 Portsmouth 57 9 Manchester City 55 10 West Ham Utd 49 11 Tottenham 46 12 Newcastle 43 13 Middlesbrough 42 14 Wigan Athletic 40 15 Sunderland 39 16 Bolton 37 17 Fulham 36 18 Reading 36 19 Birmingham 35 20 Derby County 11 Influence of the Number N of Particles

N=100 1.0 Arsenal Aston Villa

0.5 Birmingham Blackburn Bolton

0.0 Chelsea Derby Everton

−0.5 Fulham Liverpool −1.0 0 50 100 150 200 250 300 350 N=1000 1.0 Arsenal Aston Villa

0.5 Birmingham Blackburn Bolton

0.0 Chelsea Derby Everton

−0.5 Fulham Liverpool −1.0 0 50 100 150 200 250 300 350 N=10000 1.0 Arsenal Aston Villa

0.5 Birmingham Blackburn Bolton

0.0 Chelsea Derby Everton

−0.5 Fulham Liverpool −1.0 0 50 100 150 200 250 300 350 N=100000 1.0 Arsenal Aston Villa

0.5 Birmingham Blackburn Bolton

0.0 Chelsea Derby Everton

−0.5 Fulham Liverpool −1.0 0 50 100 150 200 250 300 350 Introduction Particle Filtering Improving the Algorithm Further Topics Summary

Theoretical Results

I Convergence results are as N → ∞

I Laws of Large Numbers

I Central limit theorems see e.g. Chopin (2004)

I The central limit theorems yield an asymptotic . This asymptotic variance can be used for theoretical comparisons of algorithms.

Axel Gandy Particle Filtering 28 Introduction Particle Filtering Improving the Algorithm Further Topics Summary

Outline Introduction

Particle Filtering

Improving the Algorithm General Proposal Distribution Improving

Further Topics

Summary

Axel Gandy Particle Filtering 29 Introduction Particle Filtering Improving the Algorithm Further Topics Summary

General Proposal Distribution Algorithm with a general proposal distribution h: (i) 1. Sample x0 ∼ π(x0) and set t = 1 2. Importance Sampling Step For i = 1,..., N: (i) (i) (i) (i) (i) I Sample ˜xt ∼ ht (xt |xt−1) and set ˜x0:t = (x0:t−1, ˜xt ) (i) (i) (i) (i) g(yt |˜xt )f (˜xt |xt−1) I Evaluate the importance weightsw ˜t = (i) (i) . ht (˜xt |xt−1) 3. Selection Step: (i) I Resample with replacement N particles (x0:t ; i = 1,..., N) from (1) (1) the set {˜x0:t ,..., ˜x0:t } according to the normalised importance (i) w˜t weights PN (j) . j=1 w˜t I t:=t+1; go to step 2. Optimal proposal distribution depends on quantity to be estimated. generic choice: choose proposal to minimise the variance of the normalised weights.

Axel Gandy Particle Filtering 30 Introduction Particle Filtering Improving the Algorithm Further Topics Summary

Improving Resampling

I Resampling was introduced to remove particles with low weights

I Downside: adds variance

Axel Gandy Particle Filtering 31 Other Types of Resampling I Goal: Reduce additional variance in the resampling step 1 N I Standardised weights W ,..., W ; i I N - number of ‘offspring’ of the ith element. i i I Need E N = W N for all i.

I Want to minimise the resulting variance of the weights. Multinomial Resampling - resampling with replacement

Systematic Resampling I Sample U1 ∼ U(0, 1/N). Let i−1 Ui = U1 + N , i = 2,..., N i Pi−1 k Pi k I N = |{j : k=1 W ≤ Uj ≤ k=1 W | i i Residual Resampling I Idea: Guarantee at least N˜ = bW Nc offspring of the ith element; 1 n P i I N¯ ,..., N¯ : Multinomial sample of N − N˜ items with weights W¯ i ∝ W i − N˜ i /N. i i i I Set N = N˜ + N¯ . Adaptive Resampling I Resampling was introduced to remove particles with low weights. I However, resampling introduces additional randomness to the algorithm. I Idea: Only resample when weights are “too uneven”. I Can be assessed by computing the variance of the weights and comparing it to a threshold. I Equivalently, one can compute the “effective sample size” (ESS): n !−1 X i 2 ESS = (wt ) . i=1 1 n (wt ,..., wt are the normalised weights) I Intuitively the effective sample size describes how many samples from the target distribution would be roughly equivalent to i importance sampling with the weights wt . I Thus one could decide to resample only if ESS < k where k can be chosen e.g. as k = N/2. Introduction Particle Filtering Improving the Algorithm Further Topics Summary

Outline Introduction

Particle Filtering

Improving the Algorithm

Further Topics Path Degeneracy Smoothing Parameter Estimates

Summary

Axel Gandy Particle Filtering 34 Introduction Particle Filtering Improving the Algorithm Further Topics Summary

Path Degeneracy

Let s ∈ N. i #{x0:s : i = 1,..., N} → 1 (as # of steps t → infty)

Example

x0 ∼ N(0, 1), xt+1 ∼ N(xt , 1), yt ∼ N(xt , 1). N = 100 particles.

t=20 t=40 t=80 8 8 8 6 6 6 4 4 4 2 2 2 0 0 0 −2 −2 −2 −4 −4 −4

0 20 40 60 80 0 20 40 60 80 0 20 40 60 80

Axel Gandy Particle Filtering 35 Introduction Particle Filtering Improving the Algorithm Further Topics Summary

Particle Smoothing

I Estimate the distribution of the state xt given all the observations y1,..., yτ up to some late point τ > t. I Intuitively, a better estimation should be possible than with filtering (where only information up to τ = t is available).

I Trajectory estimates tend to be smoother than those obtained by filtering.

I More sophisticated algorithms are needed.

Axel Gandy Particle Filtering 36 Introduction Particle Filtering Improving the Algorithm Further Topics Summary

Filtering and Parameter Estimates

I Recall that the model is given by I π(x0) - the initial distribution I f (xt |xt−1) for t ≥ 1 - the transition kernel of the Markov chain I g(yt |xt ) for t ≥ 1 - the distribution of the observations I In practical applications these distributions will not be known explicitly - they will depend on unknown parameters themselves. I Two different starting points

I Bayesian point of view: parameters have some prior distribution I Frequentist point of view: parameters are unknown constants. I Examples: σ2 σ2 Stoch. Volatility: xt ∼ N(αxt−1, (1−α)2 ), x1 ∼ N(0, (1−α)2 ), 2 yt ∼ N(0, β exp(xt )) Unknown parameters: σ, β, α Football: Unknown Parameters: β, λH , λA. I How to estimate these unknown parameters?

Axel Gandy Particle Filtering 37 Introduction Particle Filtering Improving the Algorithm Further Topics Summary

Maximum Likelihood Approach

I Let θ ∈ Θ contain all unknown parameters in the model.

I Would need marginal density pθ(y1:t ). I Can be estiamted by running the particle filter for each θ of interest and by muliplying the unnormalised weights, see the slides Sequential Importance Sampling I/II earlier in the lecture for some intuition.

Axel Gandy Particle Filtering 38 Introduction Particle Filtering Improving the Algorithm Further Topics Summary

Artificial(?) Dynamics

I Allow the parameters to change with time - give them some dynamic. I More precisely:

I Suppose we have a parameter vector θ I Allow it to depend on time (θt ), I assign a dynamic to it, i.e. a prior distribution and some transition probability from θt−1 to θt I incorporate θt in the state vector xt

I May be reasonable in the Stoch. Volatility and Football Example

Axel Gandy Particle Filtering 39 Introduction Particle Filtering Improving the Algorithm Further Topics Summary

Bayesian Parameters

I Prior on θ

I Want: Posterior p(θ|y1,..., yt ). I Naive Approach:

I Incorporate θ into xt ; transition for these components is just the identity I Resampling will lead to θ degenerating - after a moderate number of steps only few (or even one) θ will be left I New approaches:

I Particle filter within an MCMC algorithm, Andrieu et al. (2010) - computationally very expensive. 2 I SMC by Chopin, Jacob, Papaspiliopoulos, arXiv:1101.1528.

Axel Gandy Particle Filtering 40 Introduction Particle Filtering Improving the Algorithm Further Topics Summary

Outline Introduction

Particle Filtering

Improving the Algorithm

Further Topics

Summary Concluding Remarks

Axel Gandy Particle Filtering 41 Introduction Particle Filtering Improving the Algorithm Further Topics Summary

Concluding Remarks

I Active research area

I A collection of references/resources regarding SMC http: //www.stats.ox.ac.uk/~doucet/smc_resources.html I Collection of application-oriented articles: Doucet et al. (2001)

I Brief introduction to SMC: (Robert & Casella, 2004, Chapter 14)

I R-package implementing several methods: pomp http://pomp.r-forge.r-project.org/

Axel Gandy Particle Filtering 42 References Part I

Appendix

Axel Gandy Particle Filtering 43 References

ReferencesI

Andrieu, C., Doucet, A. & Holenstein, R. (2010). Particle methods. Journal of the Royal Statistical Society: Series B (Statistical Methodology) 72, 269–342. Chopin, N. (2004). for sequential Monte Carlo methods and its application to . Ann. Statist. 32, 2385–2411. Doucet, A., Freitas, N. D. & Gordon, N. (eds.) (2001). Sequential Monte Carlo Methods in Practice. Springer. Doucet, A. & Johansen, A. M. (2008). A tutorial on particle filtering and smoothing: Fifteen years later. Available at http://www.cs.ubc.ca/~arnaud/doucet_johansen_tutorialPF.pdf. Gordon, N., Salmond, D. & Smith, A. (1993). Novel approach to nonlinear/non-gaussian bayesian state estimation. Radar and , IEE Proceedings F 140, 107–113. Kalman, R. (1960). A new approach to linear filtering and prediction problems. Journal of Basic 82, 35–45.

Axel Gandy Particle Filtering 44 References

ReferencesII Øksendal, B. (2003). Stochastic Differential Equations: An Introduction With Applications. Springer. Robert, C. & Casella, G. (2004). Monte Carlo Statistical Methods. Second ed., Springer.

Axel Gandy Particle Filtering 45