⦁ Problem 1. Create a python implementation the Kalman filter and Rauch-Tung-Striebel smoother using the equations from lecture. In more detail, for the filter you’ll need to implement the prediction step:
• Problem 2.
Use your code from Problem 1 to implement a model of the form described in the section on analyst price targets. Assume the observed price targets yt are noisy measurements of an unobservable underlying true price target” Pt at time t:
Yt = Pt+Tt: Tt~ N(0,R)
where R is a scalar (or 1×1 matrix).
We furthermore assume that pt evolves with velocity” v. In other words our dynamic model will be of the form
Pta1Pt-1+ a2vt-1 + noise
Note that there are two state variables here, pt and vt. Thus the full description of the hidden state is actually
Xt:=
Pt
Vt
and the dynamics can be written in matrix form:
Xt= Axt-1+qt, A
It ~
–
=
A11 A12
(411
~ N(0, Q), Q = (211
0 A22
Qua Q12 Q12 Q22
Use the parameter estimates provided in lecture. Run your filter and smoother code on the Analyst Price Target data-set that we provide, and plot the data along with the hidden state estimates from the filter and smoother, in two different colors on the same chart.