# Methodology

# Methodology

The Hamilton model assumes that there exist *n* states of nature, with the returns from each state being drawn from a different distribution. The model views *x _{t}* as being drawn from a mixture of densities. Thus

*x*might be thought of as realisations of a process with, say, two 'states', each of which occurs randomly. For example, values of

_{t}*x*in the first state are drawn from a normal distribution with mean,

_{t}*μ*

_{1}, and variance

*σ*

_{1}

^{2}while in the second they come from a normal distribution with mean

*μ*

_{2}, and variance

*σ*

_{2}

^{2}. The state which occurs will be determined by a third process for which the probability of state one occurring is

*λ*. Hence the density of

*x*will be:

_{t}where *n*_{1}(*x*) and *n*_{2}(*x*) are the density functions of a normal distribution^{2} *N*(*μ*_{1},*σ*_{1}^{2}), *N*((*μ*_{2},*σ*_{2}^{2}), respectively. If *λ* is then allowed to vary with the past history of states, a certain level of dependence in returns may be modelled. A method of achieving this is to make the probability of being in state one during period *t* differ, conditional upon whether the process is in state one or state two in period *t-1*.

Each state of nature is assumed to follow a Markov process, with the probability *p _{i}* of being in state

*i*at time

*t*conditional upon the fact that the process is in state

*i*in time

*t-1*. The model's strength lies in its flexibility, being capable of capturing changes in the variance between state processes, as well as changes in the mean. It has been applied with some success to other markets; for example, Engel [1994] uses a two-state model to study the behaviour of exchange rates.

Specifying the model in this manner differs from the well known ARIMA and ARCH (or GARCH) models - see Bollerslev, Chou & Kroner [1992] for a survey of the latter. In the former, the variance of the process is assumed to be constant, but the expected value of the series follows a memory process. As a result, ARIMA based models are highly restrictive, and inappropriate if the disturbances are heteroscedastic. In the latter, the mean of the process is assumed to be constant, whereas under Markov regime-switching models this restriction is relaxed.

Hamilton's basic model^{3} has an unobserved state variable *z _{t}*, that can assume either the value of zero or unity. This variable evolves according to the first-order Markov process:

It can be shown by substitution that this scheme implies that *z _{t}* evolves as an AR(1) process:

where

and conditional upon

with conditional upon

The intention is that observed returns *x _{t}* evolve as:

where *ε _{t}* are n. i. d. (0,

*σ*

^{2}). Equation (6.3) shows that the expected values

*x*in the two states are (

_{t}*μ*

_{0},

*μ*

_{0}+

*μ*

_{1}) respectively, while the variances are (

*σ*

^{2},

*σ*

^{2}+

*θ*).

Thus, from equation (6.2), the following can be derived:

where *v _{t}* will be an MA(1). It therefore follows that

*x*is an ARMA(1,1) process which is covariance stationary.

_{t}Returning to equation (6.3), express it as

where

with

due to the independence of *η _{t}* and

*ε*, the variance of

_{t}is a linear function of *z _{t}*

_{_1}.

^{4}Combining (6.2) and (6.4) produces a two-equation procedure very similar to that used in generating the Kalman filter. There is an observation equation (6.4), a state dynamics equation (6.2), and the errors are jointly martingale differences i. e.

One difference, however, is that the error terms in both equations have time varying conditional variances that depend on unobserved quantities i. e.

*E*(*ξ*_{t}^{2}|*z _{t}*

_{-1})

and

*E*(*η*_{t}^{2} |* z _{t}*

_{-1})

Both depend upon *z _{t}*

_{-1}; the Kalman filter allows for the conditional variances of the errors to vary in a known way with the past history of

*x*, but does not allow them to depend on the past unobserved states.

_{t}In the Kalman filter case the likelihood of the data *x*_{1,} *x*_{2}, ... , *x*_{T} is built up recursively by assuming that the errors in both equations are jointly normal. The aim is to characterise the density of *x _{t}* given the past history

*X*i. e.

_{t-1}*f*(*x _{t} | X_{t-1}*)

where

*X _{t-1} *=

*{*

*x*

_{1,}

*x*

_{2}, ... ,

*x*

_{T}}

If the following is given

*f*(*z _{t}*

_{-1, }

*z*

_{t}_{-2}

*| X*)

_{t-1}when *t*=1, this would equal

*f*(*z*_{0, }*z*_{-1}* | X*_{0})

This can either be set to the unconditional density

*f*(*z*_{0, }*z*_{-1})

or estimated. Hamilton [1989] uses the former, whereas in Hamilton [1990] he proceeds under the latter assumption.

From the properties of conditional densities^{5}

e.g.

*f*(*z*_{1, }*z*_{0}* | X*_{0}) = *f*(*z*_{1 }*|*_{ }*z*_{0}) *f*(*z*_{0, }*z*_{-1}* | X*_{0})

Given

*f*(*z _{t}*

_{-1, }

*z*

_{t}_{-2}

*| X*

_{t}_{-1})

and recognising that

*f*(*z _{t,}*

_{ }

*z*

_{t}_{-1}

*| X*

_{t}_{-1})

will be equation (6.1), the joint density of

(*z _{t}*,

*z*

_{t}_{-1},

*x*)

_{t}conditional upon *X _{t}*

_{-1}, is

^{6}

Once the joint density

*f*(*x _{t }|_{ }z_{t,}*

_{ }

*z*

_{t}_{-1},

*X*

_{t}_{-1})

*f*(

*z*

_{t,}_{ }

*z*

_{t}_{-1}

*| X*

_{t}_{-1})

is determined, the density of *x _{t}* conditional upon

*X*

_{t}_{_1}can be found by integrating out the states

*z*,

_{t}*z*

_{t}_{_1}. In this case the integration simply involves summation due to the discrete nature of the states, i. e.

Of the two densities from equation (6.6),

*f*(*x _{t }|_{ }z_{t,}*

_{ }

*z*

_{t}_{-1},

*X*

_{t}_{-1})

and

*f*(*z _{t,}*

_{ }

*z*

_{t}_{-1}

*| X*

_{t}_{-1})

the first is found directly from the fact that

is *N*(0,1); see equation (6.3). The second comes from equation (6.5). The difficulty is

then the ability to determine

*f*(*z _{t}*

_{-1, }

*z*

_{t}_{-2},

*X*

_{t}_{-1}) =

*f*(

*z*

_{t,}_{ }

*z*

_{t}_{-1}

*| X*

_{t}_{-1})

generally. This is achieved by using the formula for a conditional density

as all the densities on the right-hand side of equation (6.8) have been previously determined.

Estimation of the unknown parameters can be undertaken by maximum likelihood estimation using

*f*(*x _{t}* l

*X*

_{t}_{-1})

Iteration of equations (6.5) ... (6.8) for *t*=1,... ,T produces

*f*(*x _{t}*|

*X*

_{t}_{-1}) (

*t*= 1,...,

*T*)

To determine the log likelihood, the joint density of returns is then written as the product of a conditional, *f*(*x _{t}* |

*F*

_{t}_{_1}) and a marginal density,

*f*(

*F*

_{t}_{_1}).

*f*(*x _{t}*,

*F*

_{t}_{_1}) =

*f*(

*x*|

_{t}*F*

_{t}_{_1})

*f*(

*F*

_{t}_{_1})

Building this up for all *T* observations, gives the joint density

making the log likelihood of *x*_{1}, ... , *x _{T}* equal to

and this may be maximised with respect to the unknown parameters *q*, *p*, *μ*_{0}, *μ*_{1}, *σ*^{2} and *φ*, using the EM algorithm described by Hamilton [1990].

____________________________

^{1} In the UK the Investment Property Databank has provided a comprehensive performance measurement service for institutional investors, since 1986.

^{2}

^{3}For a comprehensive discussion of Markov régime-switching models, and an excellent review of those econometric issues pertinent to financial markets, see Pagan [1993].

^{4}It can be shown that

^{5}f(*z _{t}* |

*z*

_{t}_{ _1}, z

_{t _ 2},

*X*

_{t}_{-1}) =f (

*z*|

_{t}*z*

_{t}_{- 1}) due to independence and the first-order Markov process assumed for the states. The f(.) is used to indicate both the density of the continuous variable

*x*and the probability function of the discrete random variable

_{t}*z*.

_{t}^{6}Note that because the process is first-order Markov, information on states can be summarised by *z _{t}* and

*z*

_{t}_{-1}alone.