The following notes summarize parts of the contents in the paper "Derivation of an EM algorithm for constrained and unconstrained multivarite autoregressive state-space (MARSS) models" [link](http://faculty.washington.edu/eeholmes/Files/Holmes2010.pdf)

------

A Kalman filter/smoother is an optimal estimator -- i.e. infers parameters of interest from indirect, inaccurate and uncertain observations. It is recursive so that new measurements can be processed as they arrive. If all noise is Gaussian, the Kalman filter minimises the mean square error of the estimated parameters.

The Kalman Smoother calculate the expectations and variances of state variables.  Given a state model:

\begin{align}
x_t  &=  Bx_{t-1} + u + w_t \\
y_t  &=  zx_t + a + v_t
\end{align}

Denote the conditional expection and variance of $x_t$ given observation $y_1^\tau$ as: $x_t^\tau = E[x_t|y_1^\tau], v_t^\tau = Var[x_t|y_1^\tau]$. The classical Kalman Filter will generate the forward estimation of $x_t$ conditioned on data up to time $t$: $x_t^{t-1}, x_t^t, V_t^{t-1}, V_t^t$. By contrast, the Kalman Smoother will generate the posterior estimation of $x_t$ based on the complete observation data: $x_t^T, V_t^T$.

###### The forward recursions: Kalman Filter

\begin{align}
&x_t^{t-1} = B_tx_{t-1}^{t-1} + u_t \\
&x_t^t = x_t^{t-1} + K_t(y_t - Z_tx_t^{t-1} - a_t) \\
&V_t^{t-1} = B_tV_{t-1}^{t-1}B_t' + Q_t \\
&V_t^t = (I - K_tZ_t)V_t^{t-1} \\
&K_t = V_t^{t-1}Z_t'(Z_tV_t^{t-1}Z_t' + H_tR_tH_t')^{-1}
\end{align}

###### The backward recursions: Kalman Smoother

######Expectations involving $Y_t$

The classic Kalman Smoother is an algorithm to compute these estimations conditioned on no missing values in $y$.

\begin{align}
&E[Y_t|Y_t = y_t] = y_t \\
&E[Y_tY_t'|Y_t = y_t] = y_ty_t'  \\
&E[Y_tX_t'|Y_t = y_t] = y_t{x_t^T}' \\
&E[Y_tX_{t-1}'|Y_t = y_t] = y_tE[X_{t-1}'] = y_t{x_{t-1}^T}'
\end{align}



dbba4dc484b438b8ba159839cf3afd0f9997e72d
ipynb
Jupyter Notebook
Miscellaneous/ipynb/Kalman Smoother.ipynb
zhwa/notes
d7bd132a41220fa5d9e21ad1d0fcaab7daf95b0e
MIT
Miscellaneous/ipynb/Kalman Smoother.ipynb
zhwa/notes
d7bd132a41220fa5d9e21ad1d0fcaab7daf95b0e
MIT
Miscellaneous/ipynb/Kalman Smoother.ipynb
zhwa/notes
d7bd132a41220fa5d9e21ad1d0fcaab7daf95b0e
MIT
Qwen/Qwen-72B
1. YES
2. YES