= Solution
At the terminal time,
$$
F(W_T)=\mathbb E[x_T^2\mid W_T]
=\widehat x_T^2+V_T,
$$
so $P_T=1$ and $d_T=V_T=1/(T+1)$.
Assume $F(W_t)=P_t\widehat x_t^2+d_t$. Conditional on $W_{t-1}$, the random part of the next <Kalman filter> estimate is $h_t$ times the innovation. Its variance is
$$
h_t^2(V_{t-1}+1)
=\frac{V_{t-1}^2}{V_{t-1}+1}
=V_{t-1}V_t.
$$
Therefore the <Bellman equation> gives
$$
\begin{aligned}
F(W_{t-1})
&=\inf_{u_{t-1}}
\left\{u_{t-1}^2
+P_t\mathbb E[\widehat x_t^2\mid W_{t-1}]
+d_t\right\}\\
&=\inf_u\left\{
u^2+P_t(\widehat x_{t-1}+u)^2
+P_tV_{t-1}V_t+d_t\right\}.
\end{aligned}
$$
Completing the square gives
$$
P_{t-1}=\frac{P_t}{1+P_t},
\qquad
d_{t-1}=P_tV_{t-1}V_t+d_t.
$$
Starting from $P_T=1$ yields
$$
\boxed{P_t=\frac1{T-t+1}},
$$
and hence
$$
\boxed{F(W_t)=P_t\widehat x_t^2+d_t,\quad
d_T=\frac1{T+1},\quad
d_{t-1}=V_{t-1}V_tP_t+d_t.}
$$
Back to article page