<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="mathml.xsl"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head>
<title>Data Analysis</title>
<link rel="stylesheet" type="text/css" href="styles.css" />
</head>

<body>

<h2>KALMAN FILTERS - BASIC RELATIONS</h2>

<p>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&ocirc;
differential equation</p>


<table class="equ"><tr>
<td class="equ">
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mi>d</mi>
<mi mathvariant="bold">X</mi><mfenced><mi>t</mi></mfenced>
<mo>=</mo>
<mi mathvariant="bold">f</mi><mfenced><mi>t</mi></mfenced>
<mi mathvariant="bold">X</mi><mfenced><mi>t</mi></mfenced>
<mi>d</mi><mi>t</mi>
<mo>+</mo>
<mi mathvariant="bold">g</mi><mfenced><mi>t</mi></mfenced>
<mi>d</mi>
<mi mathvariant="bold">B</mi><mfenced><mi>t</mi></mfenced>
</math>
</td>
<td class="equnum">
(10.1)
</td>
</tr></table>


<p>where <math xmlns="http://www.w3.org/1998/Math/MathML"><mi mathvariant="bold">X</mi><mfenced><mi>t</mi></mfenced></math>
is the column matrix of <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>n</mi></math> random
functions, <math xmlns="http://www.w3.org/1998/Math/MathML"><mi mathvariant="bold">f</mi><mfenced><mi>t</mi></mfenced></math>
and <math xmlns="http://www.w3.org/1998/Math/MathML"><mi mathvariant="bold">g</mi><mfenced><mi>t</mi></mfenced></math>
are respectively <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>n</mi><mo>&times;</mo><mi>n</mi></math>
and <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>n</mi><mo>&times;</mo><mi>m</mi></math>
deterministic, continuous matrix functions and
<math xmlns="http://www.w3.org/1998/Math/MathML"><mi mathvariant="bold">B</mi><mfenced><mi>t</mi></mfenced></math>,
<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>t</mi><mo>&le;</mo><mn>0</mn></math>
is a column matrix of <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>n</mi></math>
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. </p>

<p>Discrete, linear observations are taken at times
<math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>t</mi><mi>r</mi></msub></math></p>

<table class="equ"><tr>
<td class="equ">
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mi mathvariant="bold">Y</mi><mfenced><msub><mi>t</mi><mi>r</mi></msub></mfenced>
<mo>=</mo>
<mi mathvariant="bold">h</mi><mfenced><msub><mi>t</mi><mi>r</mi></msub></mfenced>
<mi mathvariant="bold">X</mi><mfenced><msub><mi>t</mi><mi>r</mi></msub></mfenced>
<mo>+</mo>
<mi mathvariant="bold">V</mi><mfenced><msub><mi>t</mi><mi>r</mi></msub></mfenced>
<mo rspace="1em">,</mo>
<mi>r</mi>
<mo>=</mo>
<mn>1</mn><mo>,</mo><mn>2</mn><mo>,</mo><mo>&hellip;</mo>
<mo rspace="1em">,</mo>
<mn>0</mn><mo>&lt;</mo><msub><mi>t</mi><mn>1</mn></msub><mo>&lt;</mo><mo>&hellip;</mo>
<mo>&lt;</mo><msub><mi>t</mi><mi>r</mi></msub><mo>&lt;</mo><msub><mi>t</mi><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow></msub>
</math>
</td>
<td class="equnum">
(10.2)
</td>
</tr></table>

<p>where <math xmlns="http://www.w3.org/1998/Math/MathML"><mi mathvariant="bold">Y</mi><mfenced><mi>r</mi></mfenced></math>
is the column matrix of <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>s</mi></math>
random observations, <math xmlns="http://www.w3.org/1998/Math/MathML"><mi mathvariant="bold">h</mi><mfenced><msub><mi>t</mi><mi>r</mi></msub></mfenced></math>
is a <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>s</mi><mo>&times;</mo><mi>n</mi></math>
deterministic matrix and <math xmlns="http://www.w3.org/1998/Math/MathML"><mi mathvariant="bold">V</mi><mfenced><mi>r</mi></mfenced></math>
is the column matrix of <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>s</mi></math> 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.</p>

<p>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
<math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>t</mi><mi>r</mi></msub><mo>=</mo><mi>r</mi><mo>&Delta;</mo><mi>t</mi></math>.
The most important case in applications is a dynamical system described
by a set of difference equations with equal time intervals</p>

<table class="equ"><tr>
<td class="equ">
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mi mathvariant="bold">X</mi><mfenced><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow></mfenced>
<mo>=</mo>
<mi mathvariant="bold">&phi;</mi><mfenced><mrow><mo>&Delta;</mo><mi>t</mi></mrow></mfenced>
<mi mathvariant="bold">X</mi><mfenced><mi>r</mi></mfenced>
<mo>+</mo>
<mi mathvariant="bold">q</mi><mfenced><mrow><mo>&Delta;</mo><mi>t</mi></mrow></mfenced>
<mi mathvariant="bold">U</mi><mfenced><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow></mfenced>
</math>
</td>
<td class="equnum">
(10.3)
</td>
</tr></table>

<p>where the column matrix 
<math xmlns="http://www.w3.org/1998/Math/MathML"><mi mathvariant="bold">X</mi><mfenced><mi>r</mi></mfenced></math>
with <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>n</mi></math> rows
contains the values of the mathematical model, the
<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>n</mi><mo>&times;</mo><mi>n</mi></math>
matrix <math xmlns="http://www.w3.org/1998/Math/MathML"><mi mathvariant="bold">&phi;</mi><mfenced><mrow><mo>&Delta;</mo><mi>t</mi></mrow></mfenced></math>
corresponds to a transformation in one step,
<math xmlns="http://www.w3.org/1998/Math/MathML"><mi mathvariant="bold">q</mi><mfenced><mrow><mo>&Delta;</mo><mi>t</mi></mrow></mfenced></math>
is an <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>n</mi><mo>&times;</mo><mi>m</mi></math> matrix and
<math xmlns="http://www.w3.org/1998/Math/MathML"><mi mathvariant="bold">U</mi><mfenced><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow></mfenced></math>
is an <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>m</mi><mo>&times;</mo><mn>1</mn></math>
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 
<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>q</mi></math>).
The observation model is the same as in the case of the continuous
discrete model</p>

<table class="equ"><tr>
<td class="equ">
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mi mathvariant="bold">Y</mi><mfenced><mi>r</mi></mfenced>
<mo>=</mo>
<mi mathvariant="bold">h</mi>
<mi mathvariant="bold">X</mi><mfenced><mi>r</mi></mfenced>
<mo>+</mo>
<mi mathvariant="bold">V</mi><mfenced><mi>r</mi></mfenced>
<mo rspace="1em">,</mo>
<mi>r</mi>
<mo>=</mo>
<mn>1</mn><mo>,</mo><mn>2</mn><mo>,</mo><mo>&hellip;</mo>
</math>
</td>
<td class="equnum">
(10.4)
</td>
</tr></table>

<p>In the example of a twice differentiable process with a dominant frequency the matrix
<math xmlns="http://www.w3.org/1998/Math/MathML"><mi mathvariant="bold">X</mi></math> and 
<math xmlns="http://www.w3.org/1998/Math/MathML"><mi mathvariant="bold">h</mi></math> are</p>

<table class="equ"><tr>
<td class="equ">
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<msup><mi mathvariant="bold">X</mi><mo>T</mo></msup><mfenced><mi>r</mi></mfenced>
<mo>=</mo>
<mfenced open="[" close="]">
 <mrow><msub><mi>X</mi><mn>0</mn></msub><mfenced><mi>r</mi></mfenced></mrow>
 <mrow><msub><mi>Y</mi><mn>0</mn></msub><mfenced><mi>r</mi></mfenced></mrow>
 <mrow><msub><mi>X</mi><mn>1</mn></msub><mfenced><mi>r</mi></mfenced></mrow>
 <mrow><msub><mi>Y</mi><mn>1</mn></msub><mfenced><mi>r</mi></mfenced></mrow>
 <mrow><msub><mi>X</mi><mn>2</mn></msub><mfenced><mi>r</mi></mfenced></mrow>
 <mrow><msub><mi>Y</mi><mn>2</mn></msub><mfenced><mi>r</mi></mfenced></mrow>
</mfenced>
</math>
</td>
<td rowspan="2" class="equnum">
(10.5)
</td>
</tr>
<tr>
<td class="equ">
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mi mathvariant="bold">h</mi>
<mo>=</mo>
<mfenced open="[" close="]">
 <mn>0</mn>
 <mn>0</mn>
 <mn>0</mn>
 <mn>0</mn>
 <mn>1</mn>
 <mn>0</mn>
</mfenced>
</math>
</td>
</tr></table>

<p>For two events <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>A</mi></math>
and <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>B</mi></math> the
<b>conditional probability function</b> 
<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>Pr</mi><mo>{</mo><mi>A</mi><mo>|</mo><mi>B</mi><mo>}</mo></math>
of event <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>A</mi></math> given the event
<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>B</mi></math> is</p>

<table class="equ"><tr>
<td class="equ">
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mi>Pr</mi><mo>{</mo><mi>A</mi><mo>|</mo><mi>B</mi><mo>}</mo>
<mo>=</mo>
<mfrac>
 <mrow><mi>Pr</mi><mo>{</mo><mi>A</mi><mo>&cap;</mo><mi>B</mi><mo>}</mo></mrow>
 <mrow><mi>Pr</mi><mo>{</mo><mi>B</mi><mo>}</mo></mrow>
</mfrac>
<mo rspace="1em">,</mo>
<mi>Pr</mi><mo>{</mo><mi>B</mi><mo>}</mo><mo>&gt;</mo><mn>0</mn>
</math>
</td>
<td class="equnum">
(10.6)
</td>
</tr></table>

<p>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. </p>

<p>Let us assume that at the time
<math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>t</mi><mi>r</mi></msub><mo>=</mo><mi>r</mi><mo>&Delta;</mo><mi>t</mi></math>
we have a good estimate of the investigated realization of the random vector
<math xmlns="http://www.w3.org/1998/Math/MathML"><mi mathvariant="bold">X</mi><mfenced><mi>r</mi></mfenced></math>
denoted by
<math xmlns="http://www.w3.org/1998/Math/MathML"><msubsup><mover><mi mathvariant="bold">X</mi><mo>&Hat;</mo></mover><mi>r</mi><mi>r</mi></msubsup></math>
based on all observations up to
<math xmlns="http://www.w3.org/1998/Math/MathML"><mi>r</mi></math>.
Now we want to compute the expected value at the time
<math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>t</mi><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow></msub><mo>=</mo>
<mo>(</mo><mi>r</mi><mo>+</mo><mn>1</mn><mo>)</mo><mo>&Delta;</mo><mi>t</mi></math>
on the data from the observation model for the time intervals 
<math xmlns="http://www.w3.org/1998/Math/MathML"><mn>0</mn><mo>,</mo><mn>1</mn><mo>,</mo><mo>&hellip;</mo><mo>,</mo><mi>r</mi></math>.
This value may be calculated from the mathematical model as the expectation of the conditional
probability as defined in relation (10.6). Thus</p>

<table class="equ"><tr>
<td class="equ">
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<msubsup><mover><mi mathvariant="bold">X</mi><mo>&Hat;</mo></mover><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow><mi>r</mi></msubsup>
<mo>=</mo>
<mi>E</mi><mfenced open="{" close="}"><mrow>
 <mi mathvariant="bold">X</mi><mfenced><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow></mfenced>
 <mo>|</mo>
 <mi mathvariant="bold">Y</mi><mfenced><mi>r</mi></mfenced>
</mrow></mfenced>
<mo>=</mo>
<mi mathvariant="bold">&phi;</mi><mfenced><mrow><mo>&Delta;</mo><mi>t</mi></mrow></mfenced>
<msubsup><mover><mi mathvariant="bold">X</mi><mo>&Hat;</mo></mover><mi>r</mi><mi>r</mi></msubsup>
</math>
</td>
<td class="equnum">
(10.7)
</td>
</tr></table>

<p>Let us now compute the prediction of the variance of the error</p>

<table class="equ"><tr>
<td class="equ">
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mtable columnalign="left">
 <mtr><mtd>
  <msubsup><mi mathvariant="bold">P</mi><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow><mi>r</mi></msubsup>
  <mo>=</mo>
  <mi>E</mi><mfenced open="{" close="}"><mrow>
   <mrow><mo>[</mo>
    <mi mathvariant="bold">X</mi><mfenced><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow></mfenced>
    <mo>-</mo>
    <msubsup><mover><mi mathvariant="bold">X</mi><mo>&Hat;</mo></mover><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow><mi>r</mi></msubsup>
   </mrow><mo>]</mo>
   <msup><mrow><mo>[</mo><mrow>
    <mi mathvariant="bold">X</mi><mfenced><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow></mfenced>
    <mo>-</mo>
    <msubsup><mover><mi mathvariant="bold">X</mi><mo>&Hat;</mo></mover><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow><mi>r</mi></msubsup>
   <mo>]</mo></mrow></mrow><mo>T</mo></msup>
   <mo>|</mo>
   <mi mathvariant="bold">Y</mi><mfenced><mi>r</mi></mfenced>
  </mrow></mfenced>
 </mtd></mtr>
 <mtr><mtd>
  <mo>=</mo>
  <mi>E</mi><mfenced open="{" close="}"><mrow>
   <mo>[</mo><mrow>
    <mi mathvariant="bold">&phi;</mi>
    <mo>(</mo><mrow>
     <mi mathvariant="bold">X</mi><mfenced><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow></mfenced>
     <mo>-</mo>
     <msubsup><mover><mi mathvariant="bold">X</mi><mo>&Hat;</mo></mover><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow><mi>r</mi></msubsup>
    </mrow><mo>)</mo>
    <mo>+</mo>
    <mi mathvariant="bold">g</mi>
    <mi mathvariant="bold">U</mi><mfenced><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow></mfenced>
   </mrow><mo>]</mo>
   <msup><mrow><mo>[</mo><mrow>
    <mi mathvariant="bold">&phi;</mi>
    <mo>(</mo><mrow>
     <mi mathvariant="bold">X</mi><mfenced><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow></mfenced>
     <mo>-</mo>
     <msubsup><mover><mi mathvariant="bold">X</mi><mo>&Hat;</mo></mover><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow><mi>r</mi></msubsup>
    </mrow><mo>)</mo>
    <mo>+</mo>
    <mi mathvariant="bold">g</mi>
    <mi mathvariant="bold">U</mi><mfenced><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow></mfenced>
   </mrow><mo>]</mo></mrow><mo>T</mo></msup>
   <mo>|</mo>
   <mi mathvariant="bold">Y</mi><mfenced><mi>r</mi></mfenced>
  </mrow></mfenced>
 </mtd></mtr>
</mtable>

</math>
</td>
</tr></table>

<p>The finale result is</p>

<table class="equ"><tr>
<td class="equ">
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <msubsup><mi mathvariant="bold">P</mi><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow><mi>r</mi></msubsup>
  <mo>=</mo>
  <mi mathvariant="bold">&phi;</mi><mfenced><mrow><mo>&Delta;</mo><mi>t</mi></mrow></mfenced>
  <msubsup><mi mathvariant="bold">P</mi><mi>r</mi><mi>r</mi></msubsup>
  <msup><mi mathvariant="bold">&phi;</mi><mo>T</mo></msup><mfenced><mrow><mo>&Delta;</mo><mi>t</mi></mrow></mfenced>
  <mo>+</mo>
  <mi mathvariant="bold">q</mi><mfenced><mrow><mo>&Delta;</mo><mi>t</mi></mrow></mfenced>
  <msup><mi mathvariant="bold">q</mi><mo>T</mo></msup><mfenced><mrow><mo>&Delta;</mo><mi>t</mi></mrow></mfenced>
</math>
</td>
<td class="equnum">
(10.8)
</td>
</tr></table>


<p>Up till now we discussed the predictions for the time
<math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>t</mi><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow></msub><mo>=</mo>
<mo>(</mo><mi>r</mi><mo>+</mo><mn>1</mn><mo>)</mo><mo>&Delta;</mo><mi>t</mi></math>
based on the mathematical model and the observation up till 
<math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>t</mi><mi>r</mi></msub><mo>=</mo>
<mi>r</mi><mo>&Delta;</mo><mi>t</mi></math>.</p>

<p>To compute the estimate 
<math xmlns="http://www.w3.org/1998/Math/MathML"><msubsup><mover><mi mathvariant="bold">X</mi><mo>&Hat;</mo></mover><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow></msubsup></math>
the observation at the time
<math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>t</mi><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow></msub><mo>=</mo>
<mo>(</mo><mi>r</mi><mo>+</mo><mn>1</mn><mo>)</mo><mo>&Delta;</mo><mi>t</mi></math>
has to be taken into account. It was proved by Kalman that the
influence of this observation leads to the following relation</p>

<table class="equ"><tr>
<td class="equ">
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<msubsup><mover><mi mathvariant="bold">X</mi><mo>&Hat;</mo></mover><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow></msubsup>
<mo>=</mo>
<msubsup><mover><mi mathvariant="bold">X</mi><mo>&Hat;</mo></mover><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow><mi>r</mi></msubsup>
<mo>+</mo>
<mi mathvariant="bold">K</mi><mfenced><mrow><mo>&Delta;</mo><mi>t</mi></mrow></mfenced>
<mfenced open="[" close="]"><mrow>
 <mi mathvariant="bold">Y</mi><mfenced><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow></mfenced>
 <mo>-</mo>
 <mi mathvariant="bold">h</mi>
 <msubsup><mover><mi mathvariant="bold">X</mi><mo>&Hat;</mo></mover><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow><mi>r</mi></msubsup>
</mrow></mfenced>
</math>
</td>
<td class="equnum">
(10.9)
</td>
</tr></table>


<p>where <math xmlns="http://www.w3.org/1998/Math/MathML"><mi mathvariant="bold">K</mi><mfenced><mrow><mo>&Delta;</mo><mi>t</mi></mrow></mfenced></math>
is the Kalman gain given by the following relation</p>

<table class="equ"><tr>
<td class="equ">
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mi mathvariant="bold">K</mi><mfenced><mrow><mo>&Delta;</mo><mi>t</mi></mrow></mfenced>
<mo>=</mo>
<msubsup><mi mathvariant="bold">P</mi><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow><mi>r</mi></msubsup>
<msup><mi mathvariant="bold">h</mi><mo>T</mo></msup>
<msup><mfenced open="[" close="]"><mrow>
 <mi mathvariant="bold">h</mi>
 <msubsup><mi mathvariant="bold">P</mi><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow><mi>r</mi></msubsup>
 <msup><mi mathvariant="bold">h</mi><mo>T</mo></msup>
 <mo>+</mo>
 <mi mathvariant="bold">R</mi>
</mrow></mfenced> <mrow><mo>-</mo><mn>1</mn></mrow> </msup>
</math>
</td>
<td class="equnum">
(10.10)
</td>
</tr></table>

<p>where <math xmlns="http://www.w3.org/1998/Math/MathML"><mi mathvariant="bold">R</mi></math>
is a diagonal matrix of variances of the matrix white noise
sequece <math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mi mathvariant="bold">V</mi><mo>(</mo><mi>r</mi><mo>)</mo></mrow></math>
in the relation (10.4).</p>

<p>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
<math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>X</mi><mn>2</mn></msub><mfenced><mi>r</mi></mfenced></math>.
In general the matrix <math xmlns="http://www.w3.org/1998/Math/MathML"><mi mathvariant="bold">R</mi></math>
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
<math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mi>X</mi><mn>2</mn></msub><mfenced><mi>r</mi></mfenced></math>.</p>

<p>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</p>

<table class="equ"><tr>
<td class="equ">
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<msubsup><mi mathvariant="bold">P</mi><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow></msubsup>
<mo>=</mo>
<msubsup><mi mathvariant="bold">P</mi><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow><mi>r</mi></msubsup>
<mo>-</mo>
<mi mathvariant="bold">K</mi><mfenced><mrow><mo>&Delta;</mo><mi>t</mi></mrow></mfenced>
<mi mathvariant="bold">h</mi>
<msubsup><mi mathvariant="bold">P</mi><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow><mi>r</mi></msubsup>
</math>
</td>
<td class="equnum">
(10.11)
</td>
</tr></table>


<p>This procedure leads to the computation of all the necessary initial
values for the next step:
<math xmlns="http://www.w3.org/1998/Math/MathML"><msubsup><mi mathvariant="bold">P</mi><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow></msubsup></math>,
<math xmlns="http://www.w3.org/1998/Math/MathML"><msubsup><mover><mi mathvariant="bold">X</mi><mo>&Hat;</mo></mover><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow></msubsup></math>.
Now it is possible to follow the outlined procedure to calculate the
values in the next step:
<math xmlns="http://www.w3.org/1998/Math/MathML"><msubsup><mi mathvariant="bold">P</mi><mrow><mi>r</mi><mo>+</mo><mn>2</mn></mrow><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow></msubsup></math>,
<math xmlns="http://www.w3.org/1998/Math/MathML"><msubsup><mover><mi mathvariant="bold">X</mi><mo>&Hat;</mo></mover><mrow><mi>r</mi><mo>+</mo><mn>2</mn></mrow><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow></msubsup></math>,
<math xmlns="http://www.w3.org/1998/Math/MathML"><msubsup><mi mathvariant="bold">P</mi><mrow><mi>r</mi><mo>+</mo><mn>2</mn></mrow><mrow><mi>r</mi><mo>+</mo><mn>2</mn></mrow></msubsup></math>,
<math xmlns="http://www.w3.org/1998/Math/MathML"><msubsup><mover><mi mathvariant="bold">X</mi><mo>&Hat;</mo></mover><mrow><mi>r</mi><mo>+</mo><mn>2</mn></mrow><mrow><mi>r</mi><mo>+</mo><mn>2</mn></mrow></msubsup></math>.
Taking consecutive steps the computation of the realization may be
completed. It is only necessary to have the initial values at the
initial time <math xmlns="http://www.w3.org/1998/Math/MathML"><mi>t</mi><mo>=</mo><mn>0</mn></math>.
If there is no information available it is reasonable to assume
<math xmlns="http://www.w3.org/1998/Math/MathML"><msubsup><mover><mi mathvariant="bold">X</mi><mo>&Hat;</mo></mover><mn>0</mn><mn>0</mn></msubsup><mo>=</mo><mn mathvariant="bold">0</mn></math> 
and
<math xmlns="http://www.w3.org/1998/Math/MathML"><msubsup><mi mathvariant="bold">P</mi><mn>0</mn><mn>0</mn></msubsup><mo>=</mo><mn mathvariant="bold">0</mn></math>.
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.</p>


<h3>Numerical examples</h3>

<p><b>Example 1</b><br />

The script file <tt>pwsemh04</tt> computes examples of twice differentiable
realizations with a dominant frequency computes matrices for Kalman
filters and applies them.</p>

<p><b>Download</b><br />
Scilab: <a href="pwsemc04.sci"><tt>pwsemc04.sci</tt></a><br />
Octave/Matlab: <a href="pwsemc04.m"><tt>pwsemc04.m</tt></a>
</p>

<p><b>Example 2</b><br />

The script file <tt>pwsemi04</tt> is a program to discuss a random function
and the estimated corresponding random sequence.</p>

<p><b>Download</b><br />
Scilab: <a href="pwsemf04.sci"><tt>pwsemf04.sci</tt></a><br />
Octave/Matlab: <a href="pwsemf04.m"><tt>pwsemf04.m</tt></a>
</p>


<p><b>Example 3</b><br />

The script file <tt>pwsemj04</tt> is a program to discuss a random function
and the corresponding estimated random sequence and derivatives.</p>

<p><b>Download</b><br />
Scilab: <a href="pwsemg04.sci"><tt>pwsemg04.sci</tt></a><br />
Octave/Matlab: <a href="pwsemg04.m"><tt>pwsemg04.m</tt></a>
</p>



</body>
</html>


