|
...returns, unobservable noise equity index levels, unobservable parameters and state variables in commodity futures prices, unobservable inflation expectations, unobservable stock betas, and unobservable hedge ratios across interest rate contracts. (1) In the field of engineering, Kalman filter (Kalman 1960) is employed for similar problems involving physical phenomena. The technique is appearing more frequently in the fields of finance and economics. However, understanding the technique can be very difficult given the available resource material.
When viewing chapter thirteen of Hamilton's (1994) Times Series Analysis text, one can understand why the topic of Kalman filters is generally reserved for the graduate classroom. However, as we will demonstrate, the technique is not quite as difficult as one may perceive initially and has similarities to standard linear regression analysis. Consequently, if placed in the correct context, it is accessible to the undergraduate student. In order to make the Kalman filter more accessible, an Excel application is developed in this article to work the student through the mechanics of the process.
In the first section, a derivation of the Kalman filter algorithm is presented in a univariate context and a connection is made between the algorithm and linear regression. In the second section, the Kalman filter is combined with maximum likelihood estimation (MLE) to create an iterative process for parameter estimation. In the third section, an Excel application/example of using the Kalman filter/MLE iterative routine is performed.
DEVELOPING THE KALMAN FILTER ALGORITHM
There are two basic building blocks of a Kalman filter, the measurement equation and the transition equation. The measurement equation relates an unobserved variable ([X.sub.t]) to an observable variable ([Y.sub.t]). In general, the measurement equation is of the form:
[Y.sub.t] = [m.sub.t] x [X.sub.t] + [b.sub.t] + [[epsilon].sub.t] (1)
To simplify the exposition, assume the constant [b.sub.t] is zero and [m.sub.t] remains constant through time eliminating the need for a subscript. Further, [[epsilon].sub.t] has a mean of zero and a variance of [r.sub.t]. Equation (1) becomes:
[Y.sub.t] = m x [X.sub.t] + [[epsilon].sub.t] (2)
The transition equation is based on a model that allows the unobserved variable to change through time. In general, the transition equation is of the form:
[X.sub.t+1] = [a.sub.t] x [X.sub.t] + [g.sub.t] + [[theta].sub.t] (3)
Again, to simplify the exposition, assume the constant [g.sub.t] is zero and [a.sub.t] remains constant through time eliminating the need for a subscript. Further, [[theta].sub.t] has a mean of zero and a variance of [q.sub.t]. Equation (3) becomes:
[X.sub.t+1] = a x [X.sub.t] + [[theta].sub.t] (4)
To begin deriving the Kalman filter algorithm, insert an initial value [X.sub.0] into Eq. (4) (the transition equation) for [X.sub.t], [X.sub.0] has a mean of [[micro].sub.0] and a standard deviation of [[sigma].sub.0]. It should be noted that [[epsilon].sub.t], [[theta].sub.t], and [X.sub.0] are uncorrelated. (Note: these variables are also uncorrelated relative to lagged variables.) Equation (4) becomes:
[X.sub.1P] = a x [X.sub.0] + [[theta].sub.0] (5)
where [X.sub.1P] is the predicted value for [X.sub.1].
[X.sub.1P] is inserted into Eq. (2) (the measurement equation) to get a predicted value for [Y.sub.1], call it [Y.sub.1P]:
[Y.sub.1P] = m x [X.sub.1P] + [[epsilon].sub.1] + m x [a x [X.sub.0] + [[theta].sub.0] + [[epsilon].sub.1] (6)
When [Y.sub.1] actually occurs, the error, [Y.sub.1E], is computed by subtracting [Y.sub.1P] from [Y.sub.1]:
[Y.sub.1E] = [Y.sub.1] - [Y.sub.1P] (7)
The error can now be incorporated into the prediction for [X.sub.1]. To distinguish the adjusted predicted value of [X.sub.1] from the predicted value of [X.sub.1] in Eq. (5), the adjusted predicted value is called [X.sub.1P] - ADJ:
[X.sub.1P - ADJ] = [X.sub.1P] + [k.sub.1] x [Y.sub.1E] = [X.sub.1P] + [k.sub.1] [[Y.sub.1] - [Y.sub.1P]] = [X.sub.1P] + [k.sub.1] [[Y.sub.1] - m x [X.sub.1P] - [[epsilon].sub.1]] = [X.sub.1P] [1 - m x [k.sub.1]] + [k.sub.1] x [Y.sub.1] - [k.sub.1] x [[epsilon].sub.1] (8)
where [k.sub.l] is the Kalman gain, which will be determined shortly.
The Kalman gain variable is determined by taking the partial derivative of the variance of [X.sub.1P] - ADJ relative to [k.sub.1] in order to minimize the variance based on [k.sub.1] (i.e., the partial derivative is set to zero and then one finds a solution for [k.sub.1]). For ease of exposition, let [p.sub.1] be the variance of [X.sub.1P] (technically, [p.sub.1] equals: [(a x [[sigma].sub.0]).sup.2] + [q.sub.0]). The solution for the Kalman gain is as follows (see Joseph, 2007, for a numerical example):
Var([X.sub.1P - ADJ]) = [p.sub.1] x [[1 - m x [k.sub.1]].sup.2] + [k.sup.2.sub.1] x [r.sub.1] (9)
[partial derivative]Var([X.sub.1P - ADJ]/[partial derivative][k.sub.1] = -2m x [1 - m x [k.sub.1]] x [p.sub.1] + 2 x [k.sub.1] x [r.sub.1] = (10)
[??] [k.sub.1] = [p.sub.1] x m/([p.sub.1] x [m.sup.2] + [r.sub.1]) = Cov([X.sub.1P], [Y.sub.1P])/Var([Y.sub.1P]) (11)
Notice, the Kalman gain is equivalent to a [beta]-coefficient from a linear regression with [X.sub.1P] as the dependent variable and [Y.sub.1P] as the independent variable. Not that one would have a sufficient set of data to perform such a regression, but the idea that a [beta]-coefficient is set to reduce error in a regression is equivalent to the idea of the Kalman gain being set to reduce variance in the adjusted predicted value for [X.sub.1].
The next...
NOTE: All illustrations and photos
have been removed from this article.

More articles from Engineering Economist
A disputation between the authors and the reviewing editor.(Letter to ..., April 01, 2008
Looking for additional articles?
Search our database of over 3 million articles.
Looking for more in-depth information on this industry?
Search our complete database of Industry & Market reports by text, subject, publication
name or publication date.
About Goliath
Whether you're looking for sales prospects, competitive information, company
analysis or best practices in managing your organization,
Goliath can help you meet your business needs.
Our extensive business information databases empower business
professionals with both the breadth and depth of credible,
authoritative information they need to support their business
goals. Whether it be strategic planning, sales prospecting,
company research or defining management best practices -
Goliath is your leading source for accurate information.
|