hamilton particle filtersecodroit.univ-lemans.fr/img/pdf/frederic_karame_paper.pdf · 3 particle...

38
Hamilton Particle Filters: a Simulated Likelihood-based Approach for Estimating Markov-Switching Stochastic Volatility Models F. Karamé EPEE-TEPP, University Evry Val d’Essonne, FR n°3126, CNRS DYNARE Team (CEPREMAP) Centre d’Etudes de l’Emploi First version: March 2012 Abstract We propose a new particle filter to estimate the Markov-switching stochastic volatility model with leverage. Its structure is based on the Hamilton filter. We use a sequential importance sampling particle filter to approximate the unobserved log-volatility and calculate the conditional likelihood necessary for the regime probabilities update and parameters estimation. In order to easily update particles and implement likelihood-based inference, we propose to use the smooth resampling approach developed by Malik & Pitt (2011a). Our last contribution relies on the choice of the proposal distribution for the importance sampling step of the particle filter. After the description of our new approach and some simulation experiments, we present the estimation results for two real datasets: the IBOVESPA (for comparison with Carvalho & Lopes, 2007) and the CAC40. Keywords: stochastic volatility, Bayesian inference, Markov-switching regime, particle filter, Kalman filter, Hamilton filter, importance sampling, simulated likelihood, Monte-Carlo approximations, sparse grids, Gaussian- mixtures. JEL classification: C32, C52, C53. Corresponding author: F. Karamé, Bur. 346, Bat IDF, 4 bd. F. Mitterrand, 91025 Evry CEDEX, FRANCE. Mailing address: [email protected] . I remain responsible for errors and omissions. The author thanks V. Karamé for his research assistance.

Upload: tranduong

Post on 30-Jan-2018

228 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

Hamilton Particle Filters:

a Simulated Likelihood-based Approach for Estimating

Markov-Switching Stochastic Volatility Models

F. Karamé †

EPEE-TEPP, University Evry Val d’Essonne, FR n°3126, CNRS

DYNARE Team (CEPREMAP)

Centre d’Etudes de l’Emploi

First version: March 2012

Abstract

We propose a new particle filter to estimate the Markov-switching stochastic

volatility model with leverage. Its structure is based on the Hamilton filter.

We use a sequential importance sampling particle filter to approximate the

unobserved log-volatility and calculate the conditional likelihood necessary

for the regime probabilities update and parameters estimation. In order to

easily update particles and implement likelihood-based inference, we

propose to use the smooth resampling approach developed by Malik & Pitt

(2011a). Our last contribution relies on the choice of the proposal

distribution for the importance sampling step of the particle filter.

After the description of our new approach and some simulation experiments,

we present the estimation results for two real datasets: the IBOVESPA (for

comparison with Carvalho & Lopes, 2007) and the CAC40.

Keywords: stochastic volatility, Bayesian inference, Markov-switching

regime, particle filter, Kalman filter, Hamilton filter, importance sampling,

simulated likelihood, Monte-Carlo approximations, sparse grids, Gaussian-

mixtures.

JEL classification: C32, C52, C53.

† Corresponding author: F. Karamé, Bur. 346, Bat IDF, 4 bd. F. Mitterrand, 91025 Evry CEDEX, FRANCE. Mailing

address: [email protected]. I remain responsible for errors and omissions. The author thanks V.

Karamé for his research assistance.

Page 2: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

2

1 Introduction

Since the seminal work by Engle (1982), measures of volatility and risk are an

important stake in the financial literature. ARCH/GARCH models encountered a

huge development since in these representations volatility is assimilated to

squared returns, which renders estimation relatively feasible even in their

complicated versions. An alternative approach consists in using stochastic

volatility models (SV hereafter). These representations are flexible and more

general but display a major difficulty: it contains a non-linearity and at least one

unobserved variable.

A natural way for estimating this kind of models would then be using a particle

filtering approach because it can be viewed as the generalization of the Kalman

filter for nonlinear and/or non-gaussian representations with unobserved

variables. However, an important limit is that the resampling step, which is

necessary when the sample is large, renders impossible inference through

simulated maximum likelihood using standard techniques. Hence, the likelihood

estimator depends on both resampled particles and the unknown parameters.

This induces a discontinuity in the criterion that generates an undesired

volatility in the likelihood function. Several alternative methodologies have then

been proposed to estimate SV models: the Kalman filter on a linearized version of

the model with the quasi-maximum likelihood (Harvey, Ruiz & Shephard 1994);

the extended Kalman filter on an approximation of order 2 of the model

(Koopman & ??); simulation-based methods like indirect inference or the

Efficient Method of Moments (Gallant & Tauchen 1996, Gallant et al. 1997) or

the Monte-Carlo Markov Chain method (Jacquier et al. 1994, Chib et al. 2002 or

Johannes & Polson 2002 among many other).

Difficulties in estimation remain for more sophisticate versions of the SV model.

An extended version, the Markov-Switching SV model (MS-SV hereafter) allows

capturing volatility clusters using Markov-switching change in regimes. It

amounts to introduce an extra unobserved variable capturing the volatility

regime. In order to avoid estimation through maximum likelihood, So et al.

(1998) use a Gibbs-sampling approach for the S&P500. ??? et al. () employ the

Kim filter and quasi-maximum likelihood on a linearized version of the model.

Carvalho & Lopes (2007) propose an online estimation approach, i.e. to consider

unknown parameters as extra state variables. They combine the auxiliary

Page 3: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

3

particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001)

filter. However, an important limit is that unknown parameters are not state

variables and that we need a large number of particles and good initialization

conditions to reach accurate results.

A recent breakthrough in the context of particle filters is due to Malik & Pitt

(2011a). They propose a smooth resampling approach that produces a likelihood

estimator continuous in the unknown parameters. Parameter inference through

simulated maximum likelihood is then rendered possible. Another important

consequence is their approach can contribute to reduce the number of particles

and consequently the time required for estimation.

In this paper, we will pay particular attention to two stylized facts in the

financial literature: first, the leverage effect, i.e. the negative correlation between

the shocks on volatility and returns (or prices); second, the representation of the

volatility clusters. In what follows, this model will be called MS-SV model with

leverage (MS-SVL).

Our article proposes a new tool to estimate the MS-SVL model. The econometric

literature facing such kind of problem generally approximates the regime

variable with a swarm of particles, just like the log-volatility. However, Bayesian

inference equations can directly be implemented for this specific issue (see

Hamilton 1989). Our filtering structure will then primarily be based on the

Hamilton filter. Our filter requires the calculation of densities conditionally to

the regimes (i) to update the regime probabilities and (ii) to calculate the

likelihood necessary for estimation. However, the model remains nonlinear

conditionally to the regime and with an unobserved variable (namely the log-

volatility). To solve this issue, we use a sequential importance sampling particle

filter to approximate the unobserved log-volatility and calculate the conditional

likelihood. Our third contribution is to propose a simple modification of this

particle filter to easily update the log-volatility distribution. In order to do that

and also to implement likelihood-based inference, we resample particles using

the smooth approach developed by Malik & Pitt (2011a). Our last contribution

relies on the choice of the proposal distribution for the importance sampling step

of the particle filter. We first choose the state transition distribution as proposal.

This is the most usual choice in the literature since no distributional

assumption is made and it is easy to deal with. An important limit is that the

proposal does not incorporate current information on observables. That is the

Page 4: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

4

reason another proposal is built using a Gaussian Kalman filter (Julier &

Uhlmann 1997). Current information on observables is incorporated in the

proposal using the Kalman gain approach. It is implemented on the Gaussian-

mixture distributions approximating the distribution of the log-volatility and the

state and measurement shocks (van der Merwe & Wan 2003).

The paper is organised as follows. Section 2 presents the MS-SVL model. We

simulate a particular dataset that will be used to compare the existing

estimation methods. General Bayesian inference is presented in section 3, with a

particular attention to the online approach developed by Carvalho & Lopes

(2007) for estimating the MS-SV model. Section 4 presents our Hamilton particle

filters. Section 5 discusses the simulation experiments on the estimation

approaches. Section 6 discusses the estimation results on two real datasets: the

IBOVESPA index (for comparison with Carvalho & Lopes, 2007) and the CAC40

index. Section 7 concludes.

2 Stochastic volatility models

2.1 Presentation

The canonical stochastic volatility model is given by the following state-space

representation:

ttt

ttt

h)(h

)/hexp(y

ησ+φ+φ−µ=ε=

η+ 1

2

1

where '),( tt ηε are iid Gaussian N(0,1). { }Ttty 1= is the observed return and

{ }Ttth 1= the unobserved log-volatility. Unknown parameters are µ the drift, 2

ησ

the volatility of the log-volatility and φ the persistence parameter.

Several methodologies have been proposed to estimate SV models. The first one,

probably the simplest, consists in linearizing the measurement equation and

using a standard Kalman filter to implement quasi-maximum likelihood

estimation (see for instance Harvey, Ruiz & Shephard 1994). A second possibility

is to approximate the nonlinearity at a higher order (2 for instance) and use the

extended Kalman filter (see for instance Koopman & ??). However, it is now well-

known that such an approach displays efficiency problems and is sub-optimal.

Simulation-based methods have also been advocated (like indirect inference or

Page 5: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

5

the efficient method of moments by Gallant & Tauchen 1996, Gallant et al.

1997). At last, the MCMC method has been proposed to draw directly in the

posterior distributions of parameters and volatility (see Jacquier et al. 1994,

Chib et al. 2002 or Johannes & Polson 2002 among many other).

The basis model can be extended in several directions. First, we introduce the

leverage effect, i.e. the negative correlation between the shocks on volatility and

returns (or prices). The assumption that tε and tη are not correlated is then

relaxed and replaced by:

ρ=ηε ),(Cov tt

The leverage effect refers to the increase in future expected volatility following

bad news. Bad news tends to decrease price and thus lead to an increase in

debt-to-equity ratio. The firms are hence riskier, which translates into an

increase in expected future volatility captured by the negative relationship

between volatility and return shocks.

Second, Markov-switching regimes can be introduced to capture the volatility

clusters. In SV model, φ is dedicated to capture the volatility persistence and is

generally found high in the applied works. Lamoureux & Lastrapes (1990) argue

that this persistence can be overestimated if changes in regimes were ignored in

the volatility process. For instance, one can interpret the volatility clusters

observed in financial data as regimes of high and low volatility. A popular way to

capture these regimes is to allow a discrete shift in the drift of the volatility

process conducted through a Markovian process (see for instance Hamilton &

Susmel 1994 for an ARCH type model).

The MS-SVL model can then be defined as:

ρ=ηε≈ηε

ησ+φ+φ−µ=ε=

η+

),(Cov),,(N),(

h)(h

)/hexp(y

tttt

ttst

ttt

t

10

1

2

1

{ }S,...s t 1∈ is an unobserved one-order Markov chain of S regimes, with fixed

transition probabilities ijp)isjs(P),...ks,isjs(P ttttt ======= −−− 121 and

{ } 11

1

=∈∀ ∑=

S

j

ijp,S,...i . The transition probabilities capture the persistence of the

Page 6: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

6

volatility regimes more efficiently than the single parameter φ (see So et al.

1998).

2.2 A calibrated example

We simulate a time-series of 500 observations, from the MS-SVL model for the

following parameter values: 10950801403051121121

.p,.p,.,.,.,, ==−=ρ=σ=φ=µ=µ η

(see figure 1). Regime 2 is interpreted as the high volatility regime. In what

follows, this simulation will be used as a benchmark for the discussed

estimation methods.

3 Bayesian filtering methods

Particle filters appear to deal with non-linear and non-gaussian state-space

representations (Doucet et al. 2001, Arulampalam et al. 2002, Cappé et al. 2007,

Creal 2009 or Doucet & Johansen 2009 among many others). They are Bayesian

in the sense they use the current observed information to update their first

prediction on state variables (or priors) and to provide a filtered evaluation of

state variables (or posteriors) at each date. As no distribution assumption on

state variables is made, this approach is implemented on a discrete

approximation of this distribution through a large number of weighted particles.

3.1 Generalities

3.1.1 The standard framework

Assume that the state-space representation can be written:

);,x(gy

);,x(fx

ttt

ttt

θε=θη= −1

where { }Ttty 1= is the set of observed (measurement) variables, { }T

ttx 1= the set of

unobserved state variables, tε and tη are respectively the measurement and

state innovations and θ the set of parameters. The model is non-linear and non-

gaussian. Two assumptions are generally formulated to lead inference on this

representation. First, the transition density depends on the past only through

the last value of the state variables. Second, the measurement density is a

function of the current state variable.

Page 7: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

7

The interest of the Bayesian approach is to provide an expression for

);y|x(p t:t θ1 . For that matter, given θ and );y|x(p t:t θ−− 111 , we can build the

prediction density:

∫∫∫

−−−−

−−−−−

−−−−

⋅⋅=

⋅⋅=

⋅=

11111

1111111

111111

tt:ttt

tt:tt:tt

tt:ttt:t

dx);y|x(p);x|x(p

dx);y|x(p);y,x|x(p

dx);y|x,x(p);y|x(p

θθ

θθ

θθ

(1)

With the observation of ty , the prediction density can be updated:

);y|x(p);x|y(p

);y|y(p

);y|x(p);y,x|y(p

);y,y|x(p);y|x(p

t:ttt

t:t

t:tt:tt

t:ttt:t

θθθ

θθθθ

11

11

1111

111

−−

⋅∝

⋅=

=

(2)

At last, we can rewrite the unconditional distribution of ty as:

∫∫∫

⋅⋅=

⋅⋅=

⋅=

−−

−−

tt:ttt

tt:tt:tt

tt:ttt:t

dx);y|x(p);x|y(p

dx);y|x(p);y,x|y(p

dx);y|x,y(p);y|y(p

θθ

θθ

θθ

11

1111

1111

(3)

Two very famous filters can be derived analytically from these equations under

an extra assumption of linearity and/or gaussianity of the model. When state

variables are continuous, these expressions simplify into the Kalman filter. This

approach is particularly interesting since particles are replaced by the two first

moments of joint state Gaussian distributions. When state variables take a finite

number of discrete values and the model is linear conditionally to the regime,

these expressions provide the Hamilton filter. In this approach, integrations are

simply replaced by summations and particles on the regime by the probability of

regime occurrence.

In all other cases, we should rely on approximations.

Page 8: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

8

3.1.2 Monte-Carlo approximations

Assume now that );y|x(p t:t θ111 −− is approximated by Mi

)i(t

)i(t }w,x{

111 =−− , a set of M

particles )i(tx 1− each weighted by

)i(tw 1− (with 0

1≥−

)i(tw and 1

1

1=∑

=−

M

i

)i(tw ):

∑=

−−−−−

δ=θM

i

tx

)i(tt:t )x(w);y|x(p )i(

t1

111111

By replacing in equations (1) and (2), the prior and the filtered distributions can

then be approximated by:

=−−

−−−−−

⋅≈

⋅⋅=M

i

)i(tt

)i(t

tt:tttt:t

);x|x(pw

dx);y|x(p);x|x(p);y|x(p

1

11

1111111

θ

θθθ

∑=

−−

⋅⋅≈

⋅∝M

i

)i(tttt

)i(t

t:tttt:t

);x|x(p);x|y(pw

);y|x(p);x|y(p);y|x(p

1

11

111

θθ

θθθ

3.1.3 The importance sampling

The question is now how to draw particles for current state variables to estimate

the latter distributions. Suppose we use importance sampling, i.e. we randomly

draw the particles Mi

)i(t

)i(t }w~,x~{

1= for the current state variables in an easy-to-

sample proposal distribution q(.). The weights of these new particles are defined

such as:

);y|x(q

);y|x(pw

t:)i(t:

t:)i(t:)i(

t θ

θ

10

10=

to take into account they are not drawn in their original distribution (that is still

unknown). Besides, in order to obtain a recursive expression, the proposal is

supposed to verify:

);yx(q);y,xx(q);y|x(q t:t:tttt:t: θθθ1110110 −−− ⋅=

so the current weight can be derived as:

Page 9: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

9

)i(t

)i(t

t)i(

t)i(

t

)i(t

)i(t

)i(tt)i(

t

t:)i(t:

)i(t

)i(t:

)i(t

)i(tt:t

t:)i(t:

t:)i(t:

t:)i(t:

t:)i(t:)i(

t

w

);y,x|x~(q

);x|x~(p);x~|y(pw

);y,x|x~(q

);x|x~(p);x~,y|y(p

);y|x(q

);y|x(p

);y|x(q

);y|x(pw

α⋅=

θ

θ⋅θ⋅=

θ

θ⋅θ⋅

θ

θ=

θ

θ=

−−

−−

−−

−−

1

1

1

1

110

1011

1110

1110

10

10

(4)

The weight of a particle drawn in the proposal distribution then depends on its

past weight and on the incremental importance weight )i(tα .

Since we know );y|x(p t:t θ111 −− through Mi

)i(t

)i(t }w,x{

111 =−− and since we have a

proposal distribution Mi

)i(t }x~{

1= with normalized weights:

∑ =

=M

i

)i(t

)i(t)i(

t

w

ww~

1

(5)

for current state variables, we are able to calculate approximations for both prior

and filtered distributions of states. The unconditional distribution of ty can then

be approximated by:

∑=

− ≈M

i

)i(tt:t w);y|y(p

1

11θ (6)

3.1.4 The resampling step

It is now well-known that weights degenerate as t increases, up to the point

where all-but-one particles have negligible weights. This pattern essentially

concerns large samples like in finance. That is the reason why systematic

resampling was initially proposed in the literature (Gordon et al. 1993). It

consists in randomly drawing with replacement particles in their empirical

distribution Mi

)i(t

)i(t }w~,x~{

1= . It amounts to discard particles with low weights and

replicate particles with high weights to focus on interesting areas of the

distribution using a constant number of particles. A consequence is then all new

particles have the same weight afterwards Mi

)i(t

)i(t }

Mw,x{ 1

1== .

Resampling can be implemented with many algorithms. Four algorithms

currently dominate the literature: multinomial resampling (Gordon & al. 1993),

Page 10: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

10

stratified resampling (Kitagawa 1996), residual resampling (Liu & Chen 1998)

and systematic resampling (Carpenter & al. 1999). Douc & al. (2005) prove that

the stratified resampling algorithm and the residual resampling scheme should

be preferred because the Monte-Carlo variation introduced by these algorithms

is strictly smaller. Furthermore, they are also unbiased in the sense that the

expected number of times a particle is resampled is equal to its importance

weight. This condition is a maintained assumption in the consistency and

asymptotic normality proofs behind most particle filters.

While necessary, resampling can induce the ‘impoverishment’ of the particles

swarm. Besides, it can render a filter iteration relatively time-consuming.

Another important limit is that resampling renders impossible inference through

maximum likelihood using standard techniques. Hence, even when the seed for

random draws is fixed across the simulations, the traditional likelihood

estimator depends on both resampled particles and the unknown parameters.

This produces a discontinuity in the criterion that generates an undesired

volatility in the likelihood function. It explains why applied approaches depart

from the usual likelihood-based approach. An important breakthrough is due to

Malik & Pitt (2011a). They propose to use smooth resampling to produce a

likelihood estimator continuous in the parameters (see appendix A). Parameter

inference is then possible through simulated maximum likelihood using particle

filters. Another important consequence is this approach may contribute to

reduce the number of particles and consequently the time required for

estimation.

3.2 The online estimation alternative

Carvalho & Lopes (2007) propose an online methodology to deal with estimation

of the MS-SV model. In order to avoid the maximum likelihood approach, they

consider unknown parameters as surrogate state variables. They combine the

auxiliary particle filter introduced by Pitt & Shephard (2001) with the Liu & West

(2001) filter. This approach is now largely popularized for a large panel of models

and issues (see Bilio & Casarin 2011 for instance).

3.2.1 The auxiliary particle filter

The main difference of the auxiliary particle filter over the traditional approach is

to apply the selection resampling step on the past particles (i.e. before their

mutation into the prior density) and no more on the current particles (i.e. after

Page 11: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

11

the mutation of past particles into the prior density). Consequently, past

particles with low probability will not survive to the selection and only the most

promising particles will enter in the calculation of the current particle prior

distribution. Auxiliary particle filter uses an auxiliary variable lk to select the

most representative particles Mi

)i(t

)i(t }w,x{

111 =−− . This auxiliary variable is a random

particle index simulated from a distribution which contains and resumes the

information on the past particles set. This feature is due to the use of { }Mi

)i(tx 1=

that approximate the predictive density of past particles ( )];xx(p[Ex ttt θ1−= ) in

the measurement density );xy(p )i(tt θ . Hence, the weight:

)i(t

)i(ttt

)i(t w);xy(p)yi(p

11 −− ⋅θ∝=τ

combines the own past particle weight with its predictive capability. This

selection step then simply amounts to resample Mi

)i(t }x{

11 =− based on normalized

)i(t 1−τ .

As this selection/mutation step can be viewed as a particular proposal, current

particles Mi

)i(t }x~{

1= are drawn from );xx(p )k(tt

l

θ1− and their weights are calculated

through an importance sampling argument

M

i

)k(tt

)i(tt)i(

t);x|y(p

);x~|y(pw

l

1=

∝θ

θ. An extra

resampling step is optional (Doucet & Johansen 2009).

3.2.2 The Liu & West filter

Liu & West (2001) consider unknown parameters as extra states variables to

allow online evaluation. Their approach simply amounts to add an extra state

equation for the parameters in the model. For that purpose, they use a kernel

density estimation of the parameter posterior distribution as importance density:

)V²b,m(N)(p tttt 111 −−− =θθ (7)

This equation produces time-varying parameters and thus adds noise to the

parameter estimates. In order to reduce the effect of the artificial variability, the

authors adopt a kernel shrinkage technique. In practice, if among the past state

variables, we have { }Mi

)i(t 11 =−θ with weights { }M

i)i(

tw 11 =− , calculate

Page 12: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

12

∑ = −−− θ=θM

i

)i(t

)i(tt w

1111

'))((wV

M

i t)i(

tt)i(

t)i(

tt ∑ = −−−−−− θ−θθ−θ=1

111111.

The proposal for parameters consists in randomly drawing )i(t

~θ from

)Vb,)a(a(N tt)i(

t 1

2

111 −−− θ−+θ . The shrinkage technique (based on parameter a) is

used to produce slowly time-varying parameters and also to limit the variability.

δ is the key parameter of the approach since it conditions the shrinkage and the

smoothness parameters a and b:

2

2

2

131

δ−δ−=b and 2

1 ba −=

Along the authors recommendations, δ is generally chosen in the range

[0.95;0.99].

3.3 Application on the simulated dataset

Tables 1 and 2 summarize the steps for the traditional bootstrap filter and the

Carvalho & Lopes (2007) filter for the MS-SVL model. The state vector is now

composed of )s,h(x ttt = , for which the standard inference is implemented. Due

to the presence of st, the unobserved regime variable, the Markov chain is used

as an extra transition equation for the filter. We first use the traditional

bootstrap filter on the simulated dataset. Figures (2-a) and (2-b) display the

transversal cuts of the likelihood function as regard each parameter for both the

stratified and residual resampling techniques. We see that even with a relatively

large number of particles (M = 5 000), the recourse to resampling induces erratic

profiles with no clear maximum solution. A brute force approach would be to

increase the particles number but with no guaranty of success.

The online estimation approach is implemented on our simulated dataset. Figure

(3-a) provides the filtered components and figure (3-b) the evolution of the

parameters. We can notice that even using 5 000 particles and starting from the

true values, estimated parameters are volatile and results remain relatively

inaccurate (table 4).

Page 13: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

13

4 Hamilton particle filters

In this section, we propose a new filtering approach that will allow a likelihood-

based inference on the MS-SVL model. Four points should be highlighted.

First, the econometric literature facing such a problem generally approximates

the regime variable with a swarm of particles, just like log-volatility. However,

Bayesian inference equations (1) to (3) can directly be implemented for this

specific issue: it is the Hamilton filter. As the analytical treatment of part of the

state vector (called Rao-Blackwellization) will reduce the Monte-Carlo variation of

the resulting estimator and improve its numerical efficiency, our new filtering

structure will then primarily be based on the Hamilton filter.

Second, the filter requires the calculation of densities conditionally to the

regimes (i) to calculate the likelihood necessary for estimation and (ii) to update

regime probabilities. However, our model is still nonlinear and with an

unobserved variable (namely the log-volatility), even when expressed

conditionally to a particular regime. To solve this issue, we use a sequential

importance sampling particle filter to approximate the unobserved log-volatility

and calculate the conditional likelihood.

Our third contribution is to propose a simple modification of the resampling step

to easily update the log-volatility distribution. In order to do that and also to

implement likelihood-based inference, we stack and resample the conditional

particles using the smooth approach developed by Malik & Pitt (2011a).

Our last contribution relies on the choice of the proposal distribution for the

importance sampling step of the particle filter. Choosing the transition state

distribution as proposal will produce the ‘Hamilton Bootstrap Particle Filter’

(HBPF hereafter). Building the proposal distribution by implementing a

Gaussian Kalman filter (Julier & Uhlmann 1997) on a Gaussian-mixture

approximating the joint distribution of past particles, state and measurement

innovations (van der Merwe & Wan 2003) will produce the ‘Hamilton Gaussian-

Mixture Particle Filter’ (HGMPF hereafter). As we have also the possibility to

approximate state and measurement innovations, this approach allows

departing from the normality assumption and capturing heavy-tails

distributions.

Page 14: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

14

4.1 General overview

4.1.1 The Hamilton filter

In the case of a discrete unobserved variable, the equations described in section

(3.1) simplify as the Hamilton filter. We then only handle the S probabilities of

regimes and no more a large particles set approximating the regimes. Given

);ys(p tt θ11 −− and θ, four steps are needed:

Step 1: Prediction of regime probabilities:

∑=

−−−−−

⋅=S

s

t:tttt:t

t

);ys(p);ss(p);ys(p1

111111

1

θθθ

Step 2: Calculation of densities conditionally to the regime: );y,sy(p t:tt θ11 − .

Step 3: Unconditional density:

∑∑=

−−=

−− ⋅==S

s

t:tt:tt

S

s

t:ttt:t

tt

);ys(p);y,sy(p);ys,y(p);yy(p1

1111

1

1111 θθθθ

Step 4: Calculation of filtered probabilities through update:

∑=

−−

−−

−−

⋅===

S

s

t:tt:tt

t:tt:tt

t:t

t:tt

t:ttt:t

t

);ys(p);y,sy(p

);ys(p);y,sy(p

);yy(p

);ys,y(p);y,ys(p);ys(p

1

1111

1111

11

11

111

θθ

θθ

θ

θθθ

At last, as the filter provides unconditional density at each date, maximum

likelihood can be implemented to find unknown parameters using the output of

step 3:

∑∑=

−θ

θ=θ=θT

t

t:t

T

t

ttML );yy(plnmaxarg);y(lmaxargˆ

1

11

1

This will constitute the basic structure for our new filter. One extra advantage of

our approach is to provide easily smoothed inference on probabilities thanks to

the Kim backward smoother (see Nelson & Kim 1999): for t = T-1, … 1:

∑= +

++

+ θ

θθθ=θ

S

s t:t

ttt:tT:tT:t

t);ys(p

);ss(p);ys(p);ys(p);ys(p

1 11

1

1111

1

Page 15: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

15

However, one point is still at stake: how calculate the conditional densities in

step 2?

4.1.2 The calculation of conditional densities

This issue clearly depends on the model. Three categories can be viewed. In

traditional applied works, the conditional model is linear and without

unobserved variables by regime. See for instance Hamilton (1989), Engle &

Hamilton (1990), Kim & Nelson (1999), Krolzig (2003) among many others.

Writing the densities conditionally to the regime under standard normality

assumption is then straightforward. In more recent applications, the studied

conditional model can still be linear but with unobserved variables. In this case,

conditional densities can be calculated through one iteration of the Kalman

filter1. These particle filters are due to Chen & Liu (2000) who named them

mixture Kalman filters2. At last, the conditional model can be nonlinear with

unobserved variables. It is then natural to use a particle filter to provide both

conditional densities and approximations of the state variables. The idea here is

then to use a particle filter to feed the second step of the Hamilton filter,

contrarily to traditional Rao-Blackwellization where the analytical filter feeds the

particle filter.

Assume a set of particles M

i

)i(t

)i(t M

w,h1

11

1

=−−

= . Current particles are drawn in the

usual distribution that now depends on the current regime:

);y,s,h|h(qsh~

tt)i(

ttt)i(

t θ≈ −1

The associated weights will be calculated as

)s(wsw t)i(

t)i(

tt)i(

t α⋅∝ −1

The particle filter then provides the conditional densities to the second step of

the Hamilton filter:

1 See for instance Kim (1994), Kim & Nelson (1999), Frühwirth-Schnatter (2006), Creal (2009) or Waggoner & Zha (2011).

2 See also Doucet et al. (2001). de Freitas et al. (2004), Schön et al. (2005), and Bos & Shephard

(2006).

Page 16: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

16

∑=

− ≈θM

i

t)i(

tt:tt sw);y,sy(p1

11

The third step of the Hamilton filter can then be implemented.

4.1.3 Updating particles

At last, we have to explain how provide the approximated filtered density of

unobserved components (namely the log-volatility). The idea is quite simple. We

build a distribution of S×M particles { }S,...sM,...i

)s,i(t

t

th~

1

1

== by stacking conditional

particles whose weights depend on their respective weights from the conditional

density and the prior regime probability:

t)i(

tt:t)s,i(

t sw);ys(pw t ⋅θ≈ −11

This distribution can be interpreted as the joint distribution of particles and

regimes. Using the normalized weights, we resample only M particles

M

i

)i(t

)i(t

Mw,h

1

1

=

= from this joint distribution. As seen previously, it amounts to

discard particles with low weights and replicate particles with high weights to

focus on the interesting areas of the distribution. The smooth resampling

technique proposed by Malik & Pitt (2011a) is implemented, opening the route

for likelihood-based inference. Table 3 summarizes the steps of the filter.

4.2 The proposal distribution

Our last contribution consists in choosing the proposal distribution for current

particles. We examine here two alternatives.

4.2.1 The usual choice

For simplicity sake (and it will be our choice in this paper), a usual choice for the

proposal distribution in the literature is the state transition distribution:

);s,h|h(p);y,s,h|h(q ttttttt θ=θ −− 11

Consequently, the current weights simplify:

Page 17: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

17

);s,h~|y(pw

);y,s,h|h~(q

);s,h|h~(p);s,h

~|y(p

wsw

t)i(

tt)i(

t

tt)i(

t)i(

t

t)i(

t)i(

tt)i(

tt)i(tt

)i(t

θ⋅=

θ

θ⋅θ⋅=

−−

1

1

1

1

This will constitute the ‘Hamilton Bootstrap Particle Filter’. It is easy to implement

and the weight of a particle has a natural interpretation since it is proportional

to its contribution to the current observation likelihood. The limit generally

evoked is that the proposal is relatively blind since it does not depend on the

current information on the observables.

4.2.2 Approximating the optimal proposal distribution with a Gaussian

Kalman filter and Gaussian-mixture distributions

In order to deal with eventually complicated distributions while conserving some

simplicity, we now use gaussian-mixture distribution. This approach is known in

the literature as the ‘Gaussian-Mixture Particle Filter’ (van der Merwe & Wan

2003). A G-gaussian mixture is defined as G gaussian distributions

)P,,h(N )g()g(µ combined with weights )g(α ( 10

1

=α≥α ∑=

G

g

)g()g( , ). Suppose now

that the posterior distribution of previous state variables and of the structural

and observational shocks are approximated respectively by a G-, I-, J- gaussian

mixtures:

=ηη

=εε

=−−−−−−

µηγ=η

µεβ=ε

µα=

J

j

)j()j(t

)j(tttGM

I

i

)i()i(t

)i(tttGM

G

g

)g(t

)g(tt

)g(tt:ttGM

)P,,(N)s(p

)P,,(N)s(p

)P,,h(N)y,sh(p

tt

tt

1

1

1

1111111

Define g'(=1,… G'=GI) and g''(=1,… G''=GIJ). For each combination of g, i and j,

we build two Gaussian-mixture approximations:

∑=

− µα='

'

)'P,',h(N')y,sh(pG

g

)g(t

)g(tt

)g(tt:ttGM

1

11

∑=

µα=''G

g

)g(t

)g(tt

)g(tt:ttGM

''

)''P,'',h(N'')y,sh(p

1

1

Page 18: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

18

{ } 'G

'g)'g(

t)'g(

t)'g(

t P,,1=µα and { } ''''''P,'',''

G

g)g(

t)g(

t)g(

t 1=µα respectively approximate the

predicted (prior) and the filtered (posterior) distribution of states conditionally to

the regime. Their moments are calculated using the Gaussian Kalman filter

(Julier & Uhlmann 1997) for each component of the mixture (van der Merwe &

Wan 2003). As this approach can reveal cumbersome with particles, it is

alleviated by replacing particles with sparse grids. Here, we use a third-degree

spherical-radial cubature proposed by Arasaratnam & Haykin (2009a) (2009b)

(see appendix B).

The Cubature Kalman filter iterates as follows. Suppose we stack previous state

variables, state errors and measurement errors in ( )',,h tttt εη=ξ −1 . Let’s

calculate a Gaussian weighted approximation { }Ljjj W, 1=

χ of tξ with jχ composed

of ( )tttjj

hj ,,

εη χχχ −1 . We use our state-space representation to build the predictive

state and measurement distributions for each combination of nodes

{ }Gg

)g(t

)g(t

)g(t P,,

1=µα , { }Jj

)j()j()j(t )P,,

tt 1=ηηµγ and { }Ii

)i()i()i(t tt

P,,1=εεµβ of our Gaussian-

mixture approximations:

);,(g

);,(f

ttt

ttt

jhj

yj

jhj

hj

θχχ=χ

θχχ=χε

η−1

The empirical moments are provided by:

=−µ

=−−

=−

=

=

−χ⋅µ−χ⋅=

−χ⋅−χ⋅=

χ⋅=

µ−χ⋅µ−χ⋅=

χ⋅=µ

L

jtt

yj

)g(t

hjjy,

L

j

ttyjtt

yjjy

L

j

yjjtt

L

j

)g(t

hj

)g(t

hjj

)g(t

L

j

hjj

)g(t

')y()'(WP

')y()y(WP

Wy

')'()'(W'P

W'

tt

tt)'g(

t

tt

tt

t

tt

t

1

1

1

11

1

1

1

1

1

1

Following the minimizing variance criterion, we calculate the Kalman gain as:

Page 19: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

19

1

11

µ

=

−− tttt

)'g(t

yy,t PPK

and deduce the moments for the filtered distribution of state variables:

'KPK'P''P

)yy(K'''

tyt)g(

t)g(

t

tttt)g(

t)g(

t

tt 1

1

−−=

−+µ=µ −

that now incorporates current information from observables. They constitute

particular nodes of the two Gaussian-mixture distributions whose weights are

provided by:

∑∑

∑∑

= =

= =−

µγα

µγα=α

βα

βα=α

'G

'g

J

j

)'g(ttt

)j(t

)'g(t

)'g(ttt

)j(t

)'g(t)''g(

t

G

g

I

i

)i(t

)g(t

)i(t

)g(t)'g(

t

),sy(p

),sy(p

1 1

1 1

1

1

The G’’-Gaussian mixture { } ''G

''g)''g(

t)''g(

t)''g(

t P,,1=µα is then used as proposal

distribution to draw the current particles { }S,...sM,...it

)i(t

t

sh~

1

1

== . The G’-Gaussian

mixture { } 'G

'g)'g(

t)'g(

t)'g(

t P,,1=µα is then used as prior distribution to calculate the

probabilities of the current particles { }S,...sM,...it

)i(t

t

sh~

1

1

== in the particles weight:

)y,sh~(p

)y,sh~(p);s,h

~|y(p

wswt:t

)i(tGM

t:t)i(

tGMt)i(

tt)i(tt

)i(t

1

11

1

−−

⋅θ⋅=

This approach displays the advantage to be fast and easy to implement. As we

handle a limited number of nodes, it drastically reduces the number of

operations to implement. In order to reach the following filter iteration, we have

to reduce the size G’’ of the mixture, otherwise the number of components will

explode after a limited number of iterations. Following van der Merwe & Wan

(2003), we use the collapsing procedure proposed by McLachlan & Krishnan

(1997) to fit a G-gaussian mixture on the swarm of resampled particles. It will

provide the corresponding set { }Gg

)g(t

)g(t

)g(t P,,

1=µα necessary for implementing the

next filter iteration. As the starting values of this algorithm are provided by the

Page 20: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

20

previous G-gaussian mixture, this procedure is reputed quite fast and relatively

costless.

4.3 Application on the simulated dataset

Figures (4-a) and (4-b) display the transversal cuts of the likelihood function

provided by the HBPF relatively to each parameter. We can notice that even with

500 particles, they are very smooth in all cases. Table 4 provides the estimation

results implemented on the benchmark simulated dataset. We can see that the

evaluation of unobserved variables is very efficient, as in the online approach.

Concerning the parameters, the HBPF and the HGMPF deliver estimates very

close to the true values of parameters, whether we use 500 or 5 000 particles.

5 Simulation experiments on the competing approaches

We propose a simple Monte-Carlo experiment to compare the performance of the

three approaches. We generate 50 artificial samples of length T = 500 based on

the calibration proposed in section (2-2) for the MS-SVL model and use the

competing estimation methods. In all cases, the number of particles employed is

set to M = 500. Besides, the results are directly comparable since estimations

are led on the same samples. Mean estimate, standard-deviation from true

parameters and traditional indicators like bias and mean-square error are

calculated for each parameter (table 5). At last, we summarize our results using

non-parametric density estimation (see figure 6). We can see our two filters

provide estimates without significant bias. Furthermore, MSE indicates much

more accurate estimators, with distributions with lesser variance. Using the

HGMPF improves considerably the quality of estimation for the leverage effect. At

last, we notice that the HGMPF always outperform the HBPF in terms of MSE.

6 Application on real data

In this section, our approach is implemented on two financial indices. First, the

IBOVESPA stock index (from the Sao Paulo Stock Exchange) from 01/02/1997

to 01/16/2001 (figures 7-a and 7-b) in order to compare our results with

Carvalho & Lopes (2007) and their online approach. As noticed by the authors,

this period includes a set of currency crises (in Asia in 1997, in Russia in 1998

and in Brazil in 1999) that generate high levels of uncertainty and consequently

high levels of volatility. For this reason they decide to apply the two-regime MS-

Page 21: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

21

SV model. We extend their model since they do not include the leverage effect in

their specification. Second, we apply our approach to the CAC40 index (from the

Paris Stock Exchange), from 03/01/1990 to 02/27/2012 (figures 8-a and 8-b).

This period includes the crisis previously evoked and the very last ones.

Estimation is led using both HBPF and HGMPF. In this former case, we retain

two mixtures for state variables, state and measurement shocks. Results are

displayed in tables 6 and 7 for IBOVESPA and CAC40 respectively.

At least four conclusions can be highlighted. First, we confirm the results

obtained by Carvalho & Lopes (2007) regarding the evaluation of the parameters,

particularly the decrease of the persistence parameter when introducing regimes

in the specification, the regime identification and the log-volatility estimation.

Second, we observe that the leverage effect has an important magnitude and is

significant (using a LR statistics) for both indices. Third, the regime delivered

from the estimation with the HBPF (figures 7-c and 8-c) are less clear than with

the HGMPF (figures 7-b and 8-b). At last, the log-volatility evaluation seems to

be robust whatever Hamilton particle filters employed and accurate as regards

the empirical confidence bands.

7 Conclusion

In this paper, we propose a new particle filtering approach for nonlinear models

with Markov-switching regimes that we called Hamilton particle filters. This

methodology is based on the Rao-Blackwellization of the unobserved regime

variable in a structure based on the Hamilton filter. This structure uses an

importance sampling particle filtering approach for calculating the conditional

likelihood and treating the other unobserved variable, namely the log-volatility.

Unknown parameters are estimated through maximum likelihood since smooth

resampling is implemented to update the particles current distribution using the

regime-conditional distributions. We develop two filters: the first one is based on

the usual choice for the proposal distribution, i.e. the transition state density;

the second one is based on the Cubature Kalman filter implemented on a

Gaussian mixture approximating the joint distribution of states and innovations.

The preliminary results of our simulation experiments are promising with a

substantial gain in the estimators performances. The application of this

methodology to real data delivers coherent results but it still needs to be more

Page 22: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

22

deeply explored. At last, our approach probably offers a framework for many

promising and exciting extensions to the MS-SVL model.

References

An S. and Schorfheide F. (2007), Bayesian Analysis of DSGE Models, Econometric Reviews 26 (2-4), 113–172.

Andrieu C., Davy M. and Doucet A. (2003), Efficient Particle Filtering for Jump Markov Systems: Application to Time-Varying Autoregressions, IEEE Transactions on Signal Processing, 51(7), 1762-1770.

Arasaratnam I. and Haykin S. (2009a), Cubature Kalman Filters, IEEE Transactions on Automatic Control, 54(6), 1254–1269.

Arasaratnam I. and Haykin S. (2009b), Hybrid Cubature Filter: Theory and Tracking Application, McMaster University, Technical Report CSL-2009:4, 1-29.

Arulampalam S., Maskell S., Gordon N. and Clapp T. (2002), A Tutorial on Particle Filters

for on-line Non-linear / Non-gaussian Bayesian Tracking, IEEE Trans, Signal Process, 50, 241–254.

Bilio M and Casarin C. (2010), Identifying Business Cycle Turning Points with Sequential Monte Carlo Methods: an Online and Real-Time Application to the Euro Area, Journal of Forecasting, 29, 145–167.

Bos C. S. and Shephard N. (2006), Inference for Adaptive Time Series Models: Stochastic

Volatility and Conditionally Gaussian State Space Form, Econometric Reviews, 25 (2-3), 219–244.

Cappé O., Godsill S.J. and Moulines E. (2007), An Overview of Existing Methods and Recent Advances in Sequential Monte Carlo, Proceedings of the IEEE, 95(5), 899–924.

Carvalho C.M. and Lopes H.F. (2007), Simulation-based Sequential Analysis of Markov-

Switching Stochastic Volatility Models, Computational Statistics & Data Analysis, 51, 4526–4542.

Casarin R. (2003), Bayesian Inference for Generalized Markov-Switching Stochastic

Volatility Models, 4th International Workshop on Objective Bayesian Methodology, CNRS, Aussois, 15-20 June 2003.

Chen, R. and J. S. Liu (2000), Mixture Kalman filters, Journal of the Royal Statistical Society, Series B 62 (3), 493–508.

Chib S., Nardari F. and Shephard N. (2002), Markov Chains Monte Carlo Methods for Stochastic Volatility Models, Journal of Econometrics, 108, 281-316.

Creal D. (2009), A Survey of Sequential Monte Carlo Methods for Economics and Finance, Econometric Reviews, 31(3), 245-296.

Douc R., Cappé O. and Moulines E. (2005). Comparison of Resampling Schemes for

Particle Filtering, 4th International Symposium on Image and Signal Processing and Analysis (ISPA), Zagreb, Croatia.

Doucet A., Freitas J.G. and Gordon J. (2001), Sequential Monte Carlo Methods in Practice, Springer Verlag, New York.

Doucet A., Godsill S. and Andrieu C. (2000), On Sequential Monte Carlo Sampling Methods for Bayesian Filtering, Statistics and Computing, 10, 197-208.

Doucet, A. and Johansen A. (2009), A Tutorial on Particle Filtering and Smoothing:

Fifteen Years Later, The Oxford Handbook of Nonlinear filtering, Oxford University Press.

Durbin J. and Koopman S. (1997), Monte Carlo Maximum Likelihood Estimation for non Gaussian Sate Space Models, Biometrika, 84, 669-684.

Page 23: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

23

Engle R.F. (1992), Autoregressive Conditional Heteroskedasticity with Estimates of the Variance of UK Inflation, Econometrica, 50, 987-1008.

Engle R.F. and Hamilton J.D. (1990), Long Swings in the Dollar: Are They in the Data or Do Markets Know it? American Economic Review, 80(4), 689-713.

Fernandez-Villaverde J. and Rubio-Ramirez J. F. (2005), Estimating Dynamic Equilibrium

Economies: Linear versus Nonlinear Likelihood, Journal of Applied Econometrics 20, 891–910.

Fernandez-Villaverde, J. and Rubio-Ramirez J. F. (2007), Estimating Macroeconomic Models: a Likelihood Approach, The Review of Economic Studies 74 (4), 1059–1087.

Filardo A.J. (1994), Business-Cycle Phases and Their Transitional Dynamics, Journal of Business & Economic Statistics, 12(3), 299-307.

Frühwirth-Schnatter S. (2006), Finite Mixture and Markov Switching Models, Springer Press, New York.

Gallant A.R. and Tauchen G. (1996), Which Moments to Match, Econometric Theory, 12, 657-681.

Gallant A.R., Hsieh D. and Tauchen G. (1997), Estimation of Stochastic Volatility Models with Diagnostics, Journal of Econometrics, 81, 159-192.

Gordon N., Salmond D. and Smith A.F.M. (1993), Novel Approach to Nonlinear and Non-Gaussian Bayesian State Estimation, IEE Proceedings-F, 140, 107-113.

Gouriéroux C., Monfort A. and Renault E. (1993), Indirect Inference, Journal of Applied Econometrics, 8, 85-118.

Hamilton J.D. (1989), A New Approach to the Economic Analysis of Nonstationary Time Series and the Business Cycle, Econometrica, 57(2), 357-384.

Hamilton J.D. (1994), Time Series Analysis, Princeton.

Hamilton, J.D. and Susmel, R. (1994), Autoregressive Conditional Heteroskedasticity and Changes in Regime, Journal of Econometrics, 64, 307–333.

Harvey A., Ruiz E. and Shephard N. (1994), Multivariate Stochastic Variance Models, The Review of Economic Studies, 61(2), 247-264.

Jacquier E., Polson N. G. and Rossi P. E. (1994), Bayesian Analysis of Stochastic Volatility Models, Journal of Business & Economic Statistics, 12(4), 69-87.

Johannes M.S. and Polson N. (2002), MCMC methods for Financial Econometrics, in the Handbook of Financial Econometrics.

Julier S. J.and Uhlmann J. K. (1997), A New Extension of the Kalman Filter to Nonlinear

Systems, Proceedings of AeroSense, the 11th Int. Symp. on Aerospace/Defense Sensing, Simulation and Controls.

Karamé F. (2010), Impulse-Response Functions in Markov-Switching Structural Vector AutoRegressions: a Step Further, Economics Letters, 106(3), 162-165.

Karamé F. (2011), Generalized Impulse-Response Functions: a State-Space Approach, mimeo.

Kim C.J. (1994), Dynamic Linear Models with Markov-Switching, Journal of Econometrics, 60, 1-22.

Kim C.J. and Nelson C.R. (1999), State-Space Models with Regime Switching: Classical and Gibbs Sampling Approaches with Applications, MIT Press.

Kitagawa G. (1987), Non-Gaussian State Space Modeling of Nonstationary Time Series, Journal of the American Statistical Association 82 (400), 1023–1063.

Kitagawa G. (1996), Monte Carlo Filter and Smoother for Non-Gaussian Nonlinear State Space Models, Journal of Computational and Graphical Statistics 5 (1), 1–25.

Kitagawa G. (1998), A Self-Organizing State-Space Model, Journal of the American Statistical Association 93 (443), 1203–1215.

Krolzig H-M. (1997), Markov-Switching Vector Autoregressions, Springer.

Page 24: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

24

Liu J. and West M. (2001), Combined Parameter and State Estimation in Simulation-

Based Filtering, in Sequential Monte Carlo Methods in Practice, eds Doucet A., Freitas J.G. and Gordon J., Springer Verlag, New York.

Malik S. and Pitt M. (2011a), Particle Filters for Continuous Likelihood Evaluation and Maximisation, Journal of Econometrics, 165(2), 190-209.

Malik S. and Pitt M. (2011b), Modelling Stochastic Volatility with Leverage and Jumps: A

Simulated Maximum Likelihood Approach via Particle Filtering, working paper, university of Warwick.

McLachlan G.J. and Krishnan T. (1997), The EM Algorithm and Extensions, John Wiley & Sons, New York.

Pitt M. and Shephard N. (1999), Filtering via Simulation: Auxiliary Particle Filters. Journal of the American Statistical Association, 94(446), 590-599.

Schon T., Gustafsson F. and Nordlund P.-J. (2005), Marginalized Particle Filters for Mixed Linear/Nonlinear State-Space Models, IEEE Transactions on Signal Processing, 53 (7), 2279–2289.

Shephard N. (2005), Stochastic Volatility, Selected Readings, Oxford University Press.

So M.K.P., Lam K. and Li W.K. (1998), A Stochastic Volatility Model with Markov-Switching, Journal of Business & Economic Statistics, 16(2), 244-253.

van der Merwe R. and Wan E. (2003), Gaussian Mixture Sigma-Point Particle Filters for Sequential Probabilistic Inference in Dynamic State-Space Models, mimeo.

Zha T. (2011), Nonlinearity in Markov-Switching Structural Models, European Central

Bank Workshop on the role of nonlinear methods in empirical macroeconomics and forecasting, September, ECB.

Page 25: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

25

Appendix A: Smooth resampling

Appendix B: Gaussian approximations

To approximate the distribution of interest, we can either use particles (as in our

first proposal) or approximations (under of course some normality assumptions).

The use of approximation speeds up the algorithm since a Gaussian multivariate

distribution can be approximated by sparse grids.

The following presentation will concern n gaussian multivariate variables

N( )nx( 10 , nI ) approximated by { }L

jjj W, 1=χ . It consists in a set of weighted nodes.

Simply remember that every distribution )P,,x(N µ can be approximated by

{ }Ljjj W,)P(chol1=

χ⋅+µ . In this section we present two alternatives based on sparse

grids.

The retained possibility is the third-degree spherical-radial cubature

(Arasaratnam & Haykin, 2009a, 2009b). It leads to define L = 2n nodes and

weights such as:

{ } { }nnn

jj InIn ⋅⋅−=χ=2

1 and { }

=

= nW n

jj2

12

1

Page 26: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

26

Table 1: Sequential Importance Resampling Particle Filter for the MS-SV model

Given Mi

)i(t

)i(t

)i(t }w,s,h{

1111 =−−− and θ,

1. Draw )i(

ts~ in )sss(p )i(

ttt 11 −− =

2. Draw current particles Mi

)i(t }h~{

1= in );s~,hh(p )i(t

)i(tt θ

1− .

3. Calculate the weights: );s~,h~|y(pww )i(

t)i(

tt)i(

t)i(

t θ⋅= −1 and normalize:

∑ =

=M

i

)i(t

)i(t)i(

t

w

ww~

1

.

4. Resample Mi

)i(t

)i(t

)i(t }w~,s~,h~{ 1= into

Mi

)i(t

)i(t

)i(t }

Mw,s,h{ 1

1== and return to step 1.

Table 2: Carvalho & Lopes (2007) filter for online estimation of parameters of the MS-SV model

Choose δ ∈ [0.95, 0.99] and set 2

2

2

131

−−=δ

δb and

21 ba −= .

Given Mi

)i(t

)i(t

)i(t

)i(t }w,,s,h{

11111 =−−−− θ

1. Calculate ∑ = −−− =M

i

)i(t

)i(tt w

1111

θθ and '))((wV

M

i t)i(

tt)i(

t)i(

tt ∑ = −−−−−− −−=1

111111θθθθ .

2. Define the predictions for the states variables:

11

1 −− −+= t)i(

t)i(

t )a(a θθθ

),ssks(pmaxargs )i(t

)i(ttt

k

)i(t θ

11 −− ===

]),s,hh(p[Eh )i(t

)i(t

)i(tt

)i(t θ

1−=

3. Selection of the most promising particles Mi

)i(t

)i(t

)i(t },s,h{

1111 =−−− θ by sampling the index lk

from ),s,hy(pw)k(p )i(t

)i(t

)i(tt

)i(t

l θ⋅∝ −1

4. Draw current particles:

)i(

t

~θ from )Vb,(N t)k(

t

l

1

2

−θ

)i(

ts~ from )

~,sss(p )i(t

)k(ttt

l

θ11 −− =

)i(

th~

from )~,s~,hh(p )i(t

)i(t

)k(tt

l

θ1− .

5. Calculate the weights:

),s,h|y(p

)~,s~,h

~|y(p

w)k(

t)k(

t)k(

tt

)i(t

)i(t

)i(tt)i(

t lll

θ

θ∝ and normalize:

∑ =

=M

i

)i(t

)i(t)i(

t

w

ww~

1

.

6. (Optional): Resample Mi

)i(t

)i(t

)i(t

)i(t }w~,

~,s~,h

~{

1=θ into Mi

)i(t

)i(t

)i(t

)i(t }

Mw,,s,h{ 1

1==θ and return

to step 1.

Page 27: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

27

Table 3: Hamilton particle filters

Filter steps

Hamilton filter Modified particle filter

0 Given );ys(p t:t θ111 −− and

M

i

)i(t

)i(t M

w,h1

11

1

=−−

=

1. Predict regime probabilities:

∑=

−−−−−

⋅=S

s

t:tttt:t

t

);ys(p);ss(p);ys(p1

111111

1

θθθ

2.

Draw current particles );y,s,h|h(qsh~

tt)i(

ttt)i(

t θ≈ −1

with weights: )s(wsw t)i(

t)i(

tt)i(

t α⋅∝ −1

3. Calculate conditional densities

=

=−−

α=

α⋅≈θ

M

i

t)i(

t

M

i

t)i(

t)i(

tt:tt

)s(M

)s(w);y,sy(p

1

1

111

1

4. Deduce marginal density:

∑=

−−− ⋅=S

s

t:tt:tttt

t

);ys(p);y,sy(p);yy(p1

11111 θθθ

5. Update regime probabilities:

∑=

−−

−−

⋅=

S

s

t:tt:tt

t:tt:tt

tt

t

);ys(p);y,sy(p

);ys(p);y,sy(p);ys(p

1

1111

1111

θθ

θθθ

6.

Stack particles: t)i(

t)s,i(

t sh~

h~

t =

with weights: t)i(

tt:t)s,i(

t sw);ys(pw t ⋅≈ − θ11

Normalize:

∑∑= =

=M

i

S

s

)s,i(t

)s,i(t)s,i(

t

t

t

tt

w

ww~

1 1

7. Resample { }S,...sM,...i

)s,i(t

)s,i(t

t

tt w~,h~

1

1

== into

M

i

)i(t

)i(t

Mw,h

1

1

=

=

8. Go to step 0

Page 28: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

28

Table 4: Comparison of the estimation methods

(MS-SVL model, simulated data)

DGP Online estimation

(δ = 0.99, M = 5 000) Hamilton Bootstrap Particle Filter

Hamilton Gaussian-Mixture Particle Filter

True values

Mean estimate [2.5%, 97.5%]

M = 500 M = 5 000 M = 500 M = 5 000

1µ 1.00 1.065 [0.845, 1.266]

0.965 0.969 0.987

φ 0.30 0.421 [0.271, 0.549]

0.296 0.293 0.304

ησ 0.14 0.114 [0.004, 0.317]

0.132 0.140 0.150

ρ -0.80 -0.691 [-0.868, -0.281]

-0.841 -0.819 -0.818

2µ 5.00 5.004 [4.778, 5.238]

5.091 5.087 5.054

11p 0.95 0.956 [0.946, 0.964]

0.948 0.949 0.951

12p 0.10 0.088 [0.053, 0.126]

0.084 0.084 0.077

Likelih - - -1409.19 -1409.20 -1410.62

Page 29: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

29

Table 5: Monte Carlo results

(MS-SVL model, 50 simulation experiments, M = 500)

DGP Online estimation Hamilton Bootstrap Particle Filter Hamilton Gaussian-Mixture Particle Filter

True values

Mean Std-Err. Bias MSE Mean Std-Err. Bias MSE Mean Std-Err. Bias MSE

1µ 1.00 1.194 0.678 -0.194 0.4973 0.977 0.090 0.023 0.0086 0.999 0.084 0.001 0.0071

φ 0.30 0.442 0.189 -0.142 0.0558 0.150 0.078 0.150 0.0288 0.152 0.073 0.148 0.0271

ησ 0.14 0.362 0.476 -0.221 0.2752 0.195 0.128 -0.054 0.0192 0.166 0.076 -0.024 0.0063

ρ -0.80 -0.695 0.189 -0.105 0.0468 -0.746 0.293 -0.054 0.0891 -0.800 0.166 0.000 0.0275

2µ 5.00 5.044 0.757 -0.044 0.5746 4.956 0.153 0.044 0.0252 4.958 0.142 0.042 0.0219

11p 0.95 0.941 0.021 0.009 0.0005 0.952 0.017 -0.002 0.0003 0.952 0.016 -0.002 0.0003

12p 0.10 0.161 0.159 -0.061 0.0289 0.109 0.037 -0.009 0.0014 0.104 0.034 -0.004 0.0012

Page 30: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

30

Table 6: Estimation results on IBOVESPA

(from 01/02/1997 to 01/16/2001)

Hamilton Bootstrap Particle Filter

Hamilton Gaussian-Mixture Particle Filter

1µ -7.911 -8.152

φ 0.828 0.797

ησ 0.350 0.261

ρ -0.617 -0.856

2µ -5.645 -5.327

11p 0.999 0.989

12p 0.036 0.041

Likelihood 2 337.029 2 337.046

Table 7: Estimation results on CAC40

(from 03/01/1990 to 02/27/2012)

Hamilton Bootstrap Particle Filter

Hamilton Gaussian-Mixture Particle Filter

1µ -9.856 -10.157

φ 0.939 0.958

ησ 0.187 0.144

ρ -0.773 -0.865

2µ -7.213 -6.971

11p 0.995 0.992

12p 0.013 0.011

Likelihood 16 631.550 16 630.290

Page 31: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

31

Figure 1: Simulated MS-SVL model

( 10950801403051500121121

.p,.p,.,.,.,,,T ==−====== ρσφµµ η )

(a) Simulated returns (b) Regime 2 occurrence (c) Simulated log-volatility

Page 32: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

32

Figure 2-a: Transversal cuts of the likelihood function by parameter

(MS-SVL model, standard particle filter, simulated dataset, M = 5 000, stratified resampling)

Figure 2-b: Transversal cuts of the likelihood function by parameter

(MS-SVLmodel, standard particle filter, simulated dataset, M = 5 000, residual resampling)

Page 33: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

33

Figure 3-a: Unobserved components provided by online estimation

(MS-SVL model, Carvalho & Lopes filter (2007), simulated dataset, δ = 0.99, M = 5 000)

(a) Simulated returns (b) Regime 2 (true occurrence and filtered probability) (c) Log-volatility (simulated, mean and mode estimates)

Figure 3-b: Online estimation of parameters

(MS-SVL model, Carvalho & Lopes filter (2007), simulated dataset, δ = 0.99, M = 5 000)

red line: parameter mean estimate, cyan: parameter mode estimate, blue and green: confidence bands at 90% and 95%

Page 34: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

34

Figure 4-a: Transversal cuts of the likelihood function by parameter

(MS-SVLmodel, Hamilton bootstrap particle filter, simulated dataset, M = 500)

yellow line: estimated value ; pink line: true value

Figure 4-b: Transversal cuts of the likelihood function by parameter

(MS-SVL model, Hamilton bootstrap particle filter, simulated dataset, M = 5 000)

yellow line: estimated value ; pink line: true value

Page 35: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

35

Figure 5-a: Unobserved components

(maximum likelihood estimation of the MS-SVL model with the Hamilton bootstrap particle filter on simulated data, M = 500)

(a) Simulated returns (b) Regime 2 (true occurrence and smoothed probability) (c) Log-volatility (simulated, mean and mode estimates)

Figure 5-b: Unobserved components

(maximum likelihood estimation of the MS-SVL model with the Hamilton Gaussian Mixture particle filter on simulated data, M = 500)

(a) Simulated returns (b) Regime 2 (true occurrence and smoothed probability) (c) Log-volatility (simulated, mean and mode estimates)

Page 36: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

36

Figure 6: Non-parametric density estimates

(Gaussian kernel, optimal bandwidth, MS-SVL model, 50 simulation experiments, M = 500)

blue line: HBPF, red dashed line: online approach, brown dotted line: HGMPF, green line: true value

Page 37: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

37

Figure 7: Estimation results on IBOVESPA (from 01/02/1997 to 01/16/2001) (a) Price (b) Daily returns (c) Regime 2 (filtered and smoothed probability, HBPF) (d) Log-volatility (mean, mode, 95% confidence bands,

HBPF) (e) Regime 2 (filtered and smoothed probability, HGMPF) (f) Log-volatility (mean, mode, 95% confidence bands, HGMPF)

Page 38: Hamilton Particle Filtersecodroit.univ-lemans.fr/IMG/pdf/frederic_karame_paper.pdf · 3 particle filter introduced by Pitt & Shephard (2001) with the Liu & West (2001) filter. However,

38

Figure 8: Estimation results on CAC40 (from 03/01/1990 to 02/27/2012) (a) Price (b) Daily returns (c) Regime 2 (filtered and smoothed probability, HBPF) (d) Log-volatility (mean, mode, 95% confidence bands,

HBPF) (e) Regime 2 (filtered and smoothed probability, HGMPF) (f) Log-volatility (mean, mode, 95% confidence bands, HGMPF)