Implementing Kalman fillter
Suppose xi is a state-scalar that admits the following recursion (so-called the first-order Gauss-Markov process):
xi+1 = 0.9xi + ni
where the process noise ni is a zero-mean Gaussian random variable with variance Qi = 1. We assume the initial state x0 is also a zero-mean Gaussian random variable with variance π0 = 1. Also, assume the scalar observation yi and xi ts the following linear model:
yi = xi + vi
where the measurement noise vi is a zero-mean Gaussian random variable with variance Ri. Assume
E(ninj*)= δij , E(vivj*)=Riδij , E(nivj*) = 0, E(nix0*) = 0, E(vix0*) = 0.
For (i) Ri = (0:9)i, (ii)Ri = 1, (iii)Ri = (1.1)i do the following and explain your results.
1. Plot πi = E(xixi) for i = 0; 1,....,200.
2. Plot the gains Kp,i and Kf,i for i = 0; 1,...., 200.
3. Plot Re,i = E(eiei); Pi|i = E(x~i|i x~i|i), Pi+1|i = E(x~i+1|i x~i+1|i), ∑i for i = 0; 1,....,200.