1 Deriving Kalman Filter
1 Deriving Kalman Filter
DerivingKalmanFilterAnEasyAlgorithm
© 2017. Amaresh Das & Faisal Alkhateeb. This is a research/review paper, distributed under the terms of the Creative Commons
Attribution-Noncommercial 3.0 Unported License http://creativecommons.org/licenses/by-nc/3.0/), permitting all non commercial
use, distribution, and reproduction in any medium, provided the original work is properly cited.
Deriving Kalman Filter - An Easy Algorithm
Notes
Amaresh Das α & Faisal Alkhateeb σ
2017
Year
Abstract- The Kalman filter may be easily understood by the econometricians, and forecasters if it is cast as a problem
in Bayesian inference and if along the way some well-known results in multivariate statistics are employed. The aim is to
motivate the readers by providing an exposition of the key notions of the predictive tool and by laying its derivation in a
11
few easy steps. The paper does not deal with many other ad hoc techniques used in adaptive Kalman filtering.
Global Journal of Science Frontier Research ( F ) Volume XVII Issue III Version I
Keywords: bayes’s theorem, state-space forecasting.
I. Introduction
The Kalman filter wants to find at each iteration, the most likely cause of the
measurement of Yt given the approximation made by a flawed estimation the linear
dynamics 1. What is important here is not only that we have the measurement and the
prediction, but knowledge of how each is flawed. 2 In the Kalman case, this knowledge is
given by the covariance matrixes (essentially fully describing the distribution of the
measurement and prediction for the Gaussian case). The main principle of forecasting is
to find the model that will produce the best forecasts, not the best fit to the historical
data. The model that explains the historical data best may not be best predictive
model 3.The power of the Kalmancomes from its ability not only to perform this
estimation once (a simple Bayesian task) but to use both estimates and knowledge of
their distributions to a distribution for the updated estimate, thus iteratively
calculating the best solution for state at each iteration 4.
Let Yt , Yt +1 , . . . . Y1 , the data (which may be either scalar or vertical) denote the
observed values of a variable of interest at times t, t-1, . . . . 1. We assume that Yt
1
The famous work by [1] was extension of Weiner’s classical work. They focused attention upon aclass of linear minimum-error
variance sequential error estimation algorithm. While the problem of linear minimum variance sequential filtering
2
In the Kalman case, this knowledge is given by the covariance matrixes (essentially fully describing the distribution of the
measurement and prediction for the Gaussian case.While many derivations of the Kalmanfilter are available, utilizing the
orthogonalityprinciple orfnding iterative updates to the Best Linear Unbiased Estimator (BLUE), we will derive the Kalmanfilter here
using a Bayesian approach, where 'best' is interpretedin the Maximum A-Posteriori (MAP) sense 2instead of Gaussian innovations. This
forecasting algorithm [5] is very flexible method that is particularly suitable in nonstationary time series. The Eq [7] used the method to
forecast demand in the alcoholic drink industry over a period that included record demand followed by a drought and the imposition of
a new excise duty.
3
The future may not be described by the same probability as the past. Perhaps neither the past nor the future is a sample from any
probability distribution. The time series could be nothing more than a non-recurrent historical record. •The model may involve too many
parameters. Over fitted models could account for noise or other features in the data that are unlikely to extend into the future.The error
involved in fitting a large number of parameters may be damaging to forecast accuracy, even when the model is correctly specified.
4
It will be very convenient for the readers to remember the keywords used in the text:Filtering- When we estimate the current value
given past and current observations, Smoothing: - When estimating past values given present and past measures, and Prediction - :
When estimating a probable future value given the present and the past measures.
Author α: Professor, College of Business, Southern University at New Orleans & Department of Mathematics, University of New Orleans.
e-mail: [email protected]
Author σ: Assistant Professor, College of Business, Southern University at New Orleans.
with time. This dynamic feature is incorporated via the system equation wherein
Year
φt = Ψ t φt + ζ t (2)
21
Ψt being a known quantity and the system equation error ζ t → N (0, ζ t ) with ζ t known.
Global Journal of Science Frontier Research ( F ) Volume XVII Issue III Version I
Since there are physical systems for which the state of nature φ t changes over time
according to a relationship prescribed by engineering or scientific principles, the ability
to include a knowledge of the system behavior in the statistical model is an apparent
source of attractiveness of the Kalman filter. Note that the relationships (1) and (2)
specified through ϖ t and ψ t may or may not change with time, as is also true of the
variance υ t and ζ t we have subscripted these here for the sake of generality. In addition
to the usual linear model assumptions regarding the error terms, we also postulate that
υ t is independent of time. The extension of the case of dependency is straightforward.
φ 2, t = φ 2, t -1 + ζ 2, t
0 1
ζ =
0 1
2017
The Kalman filter refers to a recursive procedure for inference about the state of
nature φ t . The key notion here is that given the data Yt = ( Yt ,.. . . Y1 ) the inference
Year
1. Box and G E P and Jenkins G M (1970) Time Series Analysis, Forecasting and
Global Journal of Science Frontier Research ( F ) Volume XVII Issue III Version I
P( φ t Yt ) = P ( Yt φ t , Y t -1) x P ( φ t Yt -1 ( (4)
5
Kalman filters are ideal for systems which are continuously changing. They have the advantage that they are light on memory (they
don’t need to keep any history other than the previous state), and they are very fast, making them well suited for real time problems and
embedded systems. For a Monte Carlo Sampling Method for Bayesian Filter see [3] Sequential Bayesian filtering is the extension of the
Bayesian estimation for the case when the observed value changes in time. It is a method to estimate the real value of an observed
variable that evolves in time. See [11]
Stage 1
Prior to choosing Yt our best choice for φ t is governed by the system equation (2)
and is given by Ψ φ t -1 + ζ t . Since φ t−1 is described by (5) and state of knowledge above
φ t is embodied in the probability statement
( φ t −1 Yt -1 → N ( ψ t , φ t −1 , Θ = Ψt Σ t −1 ψ ′ + ζ t ) (6)
X → N ( µ, Σ ) = C X → N ( Cµ , C Σ C ′ )
Year
P ( φ t Yt , Yt -1 ) = P ( φ t e t -1 ) = P ( e t φ t , Yt -1 ) X
P ( φ t Yt -1 ) (8)
P ( e t φ t , Yt −1 ) x P ( φ t Yt -1 )
P ( φ t Yt , Yt −1 ) = (10)
∫all et P ( e t , φ t Yt -1 ) d φ1
and this best describes our state of knowledge about φ t at time t. Once P( φ t Yt , Yt -1 ) is
continued, we can go back to (5) for the next cycle of the recursive procedure.
Therefore, Kalman filter can be a very effective forecasting tool. It should be useful in a
6
The opportunity exists to proclaim an inherent equivalence of the least square estimation and Kalman filter theory, See [3] See also [2]
2017
Kalman’s algorithm 7. Practical applications are given in the paper by Mehra.
Year
9. Mehra, R K (1979) “Kalman filters and their Applications in Forecasting’ TIMS
Studies in Management Sciences Ed M K Starr, Amsterdam, North-Holland, 37, 207-
IV. Conclusion
51
The note presents a mathematical theory of Kalman filtering. The filtering
Global Journal of Science Frontier Research ( F ) Volume XVII Issue III Version I
techniques is discussed as a problem in Bayesian inference in a series of elementary
steps, enabling the optimality of the process to be understood. The style of the note is
informal and the mathematics elementary but rigorous, making it accessible to all those
with a minimal knowledge of linear algebra and systems theory Many other topics
related to Kalman filtering are ignored (for example, Wavelet) although occasionally we
referred to them inside the text.
7
In addition to the Kalman filtering algorithms there are other time domain algorithms available in literature. Perhaps the most exciting
ones are the so-called wavelet algorithms. Wavelets were first introduced by [6].Wavelets are based on translation W(x) → W ( x + 1)
and above all on dilation (w (x) → (2 x ) The basic dilation is a two-scale difference equation Φ ( x) = Σ c k Φ ( 2x - k ) ... We look for a
solution normalized by Φ dx = 1 The first requirement on the coefficients c k comes from multiplying by 2 and integrating
∫
2 ∫ Φ dx = Σ c k ∫ Φ ( 2x - k ) d (2x - k ) yields Σ c k = 2. Uniqueness of Φ is ensured by Σ c k = 2
61
Global Journal of Science Frontier Research ( F ) Volume XVII Issue III Version I