# Kalman-Filter covariance update equation confusing derivations

I am trying to understand what seems to be the minimum mean square error part of the kalman-filter. Why is $\mathbf{P}_{k\mid k}$ calculated like this:

$\mathbf{P}_{k\mid k} = \mathrm{cov}(\mathbf{x}_{k} - \hat{\mathbf{x}}_{k\mid k})$

when we just want to calculate the covariance of the new estimate $cov(\hat{\mathbf{x}}_{k\mid k})$?

This is the example from the Wikipedia page of the Kalman-Filter https://en.wikipedia.org/wiki/Kalman_filter#Deriving_the_a_posteriori_estimate_covariance_matrix .

I am not getting the part with the "invariant" definitions, why are they defined like this? Is it just to be able to finally reshape this to into the "Josephs Form". It is also confusing that the german Wikipedia page seems to take a very different approach for deriving the covariance update equation. Is there any simple explanation how this step of combining the covariances of two variables (state and estimate) into one random variable (reducing covariance).

I am sorry to ask this question but there are so many different bits of information available and I can't sort them in my mind right now.

• I'm not crazy about wikipedia's kalman filter page. I would switch to another reference. $P_{k|k}$ can also be written as $\text{Var}(x_k|z_{1:k})$. By properties of conditional variance $\text{Var}(x_k|z_{1:k}) = \text{Var}(x_k - E[x_k|z_{1:k}]|z_{1:k}) = \text{Var}(x_k - \hat{x_{k|k}} |z_{1:k})$. They're treating some things as constants because they are measurable with respect to $z_{1:k}$, all the observations you have up to that time point. Those 'constants' are linear combinations of all the available data. – Taylor Aug 9 '16 at 14:55