KALMAN FILTERS - BASIC RELATIONS

The introduction to the Kalman filter theory will be limited to the linear theory. The stress is on the applications. Thus relations will be justified by plausible arguments based on physics of the problem. The stress is not on rigorous mathematical proofs. The dynamical system is described by a set of linear Itô differential equation

d Xt = ft Xt dt + gt d Bt (10.1)

where Xt is the column matrix of n random functions, ft and gt are respectively n×n and n×m deterministic, continuous matrix functions and Bt, t0 is a column matrix of n independent Brownian motion processes with variance parameters equal to ones. The initial conditions correspond to Gaussian processes. In the second row the dimensions of the matrices are given for a twice differentiable process with a dominant frequency.

Discrete, linear observations are taken at times tr

Ytr = htr Xtr + Vtr , r = 1,2, , 0<t1< <tr<tr+1 (10.2)

where Yr is the column matrix of s random observations, htr is a s×n deterministic matrix and Vr is the column matrix of s Gaussian white noise sequences with zero mean values and prescribed variances. It is assumed that the initial conditions, the Brownian motion processes and the white noise observations sequences are independent.

The basic theorems are true for all linear systems. For constant coefficients the solutions are obtained by standard methods that are very easy to apply. In practical applications the computations are often restricted to discrete set of times with constant spacing tr=rΔt. The most important case in applications is a dynamical system described by a set of difference equations with equal time intervals

Xr+1 = φΔt Xr + qΔt Ur+1 (10.3)

where the column matrix Xr with n rows contains the values of the mathematical model, the n×n matrix φΔt corresponds to a transformation in one step, qΔt is an n×m matrix and Ur+1 is an m×1 Gaussian white noise sequence with mean values equal to zeros and variances equal to one (the variance may be included in the values of the elements of q). The observation model is the same as in the case of the continuous discrete model

Yr = h Xr + Vr , r = 1,2, (10.4)

In the example of a twice differentiable process with a dominant frequency the matrix X and h are

XTr = X0r Y0r X1r Y1r X2r Y2r (10.5)
h = 0 0 0 0 1 0

For two events A and B the conditional probability function Pr{A|B} of event A given the event B is

Pr{A|B} = Pr{AB} Pr{B} , Pr{B}>0 (10.6)

Let us now introduce an outline of the procedure in the Kalman filter formulations. The discussion will be based on the example of a twice differentiable discrete random process and the corresponding observation model.

Let us assume that at the time tr=rΔt we have a good estimate of the investigated realization of the random vector Xr denoted by X^rr based on all observations up to r. Now we want to compute the expected value at the time tr+1= (r+1)Δt on the data from the observation model for the time intervals 0,1,,r. This value may be calculated from the mathematical model as the expectation of the conditional probability as defined in relation (10.6). Thus

X^r+1r = E Xr+1 | Yr = φΔt X^rr (10.7)

Let us now compute the prediction of the variance of the error

Pr+1r = E [ Xr+1 - X^r+1r ] [ Xr+1 - X^r+1r ]T | Yr = E [ φ ( Xr+1 - X^r+1r ) + g Ur+1 ] [ φ ( Xr+1 - X^r+1r ) + g Ur+1 ]T | Yr

The finale result is

Pr+1r = φΔt Prr φTΔt + qΔt qTΔt (10.8)

Up till now we discussed the predictions for the time tr+1= (r+1)Δt based on the mathematical model and the observation up till tr= rΔt.

To compute the estimate X^r+1r+1 the observation at the time tr+1= (r+1)Δt has to be taken into account. It was proved by Kalman that the influence of this observation leads to the following relation

X^r+1r+1 = X^r+1r + KΔt Yr+1 - h X^r+1r (10.9)

where KΔt is the Kalman gain given by the following relation

KΔt = Pr+1r hT h Pr+1r hT + R -1 (10.10)

where R is a diagonal matrix of variances of the matrix white noise sequece V(r) in the relation (10.4).

From the physics of the problem it is clear that the prediction has to be supplemented by the expected value of the observation error. In our example there is only one observation and it corresponds to the measurement of X2r. In general the matrix R is a set of numbers that has to be related to the variances of the measured random processes. For example the standard deviation is 5% of the standard deviation of X2r.

The procedure must be completed by the estimation of the variance of the prediction error when the observation at the time is taken into account

Pr+1r+1 = Pr+1r - KΔt h Pr+1r (10.11)

This procedure leads to the computation of all the necessary initial values for the next step: Pr+1r+1, X^r+1r+1. Now it is possible to follow the outlined procedure to calculate the values in the next step: Pr+2r+1, X^r+2r+1, Pr+2r+2, X^r+2r+2. Taking consecutive steps the computation of the realization may be completed. It is only necessary to have the initial values at the initial time t=0. If there is no information available it is reasonable to assume X^00=0 and P00=0. It means the initial values are equal to the expected values and the variance of the initial error is equal to the asymptotic variance of the process.

Numerical examples

Example 1
The script file pwsemh04 computes examples of twice differentiable realizations with a dominant frequency computes matrices for Kalman filters and applies them.

Download
Scilab: pwsemh04.sci
Octave/Matlab: pwsemh04.m

Example 2
The script file pwsemi04 is a program to discuss a random function and the estimated corresponding random sequence.

Download
Scilab: pwsemi04.sci
Octave/Matlab: pwsemi04.m

Example 3
The script file pwsemj04 is a program to discuss a random function and the corresponding estimated random sequence and derivatives.

Download
Scilab: pwsemj04.sci
Octave/Matlab: pwsemj04.m