The marginalization operation is given by

$$\phi(x_{\,1})=\int_{x_{\,2}}\phi(x_{\,1},x_{\,2})=[h_{1}-K_{12}K_{22}^{-1}h_{2},K_{11}-K_{12}K_{22}^{-1}K_{21},g^{\prime}]$$

where g ′ = g − f log | K 22 / 2 π | + f h 2 T ( K 22 ) − 1 h 2 and g is the initial constant term of φ ( x 1 , x 2 ).

The conditioning operation is given by

$$\phi\big(x_{1},\,x_{2}\,=\,\hat{x}_{2}\big)=\big[h_{1}\,-\,K_{12}\hat{x}_{2}\,,\,K_{11}\,,\,g^{\prime}\big]\,\,,$$  where $g^{\prime}\,=\,g\,+\,h_{2}^{T}\,\hat{x}_{2}\,-\,\frac{1}{2}\hat{x}_{2}^{T}K_{22}\,\hat{x}_{2}$.  

## B.1   The  Kalman Filter  Recursions

Suppose we are given the following linear model subject to noise

$$\begin{array}{r c l}{{z_{k}}}&{{=}}&{{A z_{k\,-\,1}\,+\,\zeta_{k}}}\\ {{y_{k}}}&{{=}}&{{C z_{k}\,+\,\epsilon_{k}}}\end{array}$$
$$\langle(0,\,Q)\,\,\mathrm{and}\,\,\,\epsilon_{k}\,\sim{\mathcal{N}}(0,R\,)$$

where A and C are constant matrices, ( k ~ N (0, Q ) and ε k ~ N (0, R )
The model encodes the joint distribution

$$p(z_{1:K};\,y_{1:K})=\prod_{k\,=1}^{K}p(y_{k}|z_{k}\,)p(z_{k}\,|z_{k\,-1})\tag{30}$$ $$p(z_{1}|z_{0})=p(z_{1}\,)\tag{31}$$
µ, P- 1, - - log | 2 π P | - - µ T p( 21 ) CT R-1 C - CT R- 1 p(y1|z1) l R-1 ( -R-lC |0 + CT R-1 y 1, CT R-1 C, - 1 log | 2 π R| - p(y1 = y1 z1) l -ATQ p( 2 2 2 1 ) l
B.1.1  FORWARD MESSAGE PASSING Suppose we wish to compute the likelihood

$$\begin{array}{r c l}{{p\left(y_{1};_{K}\right)}}&{{=}}&{{\int_{z_{K}}p\left(y_{K}|z_{K}\right)\cdots\int_{z_{2}}p\left(z_{3}|z_{2}\right)p\left(y_{2}|z_{2}\right)\int_{z_{1}}p\left(z_{2}|z_{1}\right)p\left(y_{1}|z_{1}\right)p\left(z_{1}\right)}}\end{array}$$

7We can compute this integral by starting from z 1 and proceeding to z K .  We define forward
"messages" α as