Understanding error covariance matrix in Kalman filter

control theoryestimationkalman filter

I have recently started reading about Kalman filter for the very first time. I am using a pdf from MIT as a reference.(pdf link: https://web.mit.edu/kirtley/kirtley/binlustuff/literature/control/Kalman%20filter.pdf). In this they talk about minimizing the mean squared error which is nothing but trace of the error covariance matrix. However i am unable to understand what the elements of error covariance matrix actually are? As per the pdf, let $x_k \in \mathbb{R}^n $ be the actual state vector at time instant 'k'. Let $\hat{x_k'} $ be the prior estimate and $\hat{x_k} $ be the updated estimate after measurement. Then the error covariance matrix is at time k is defined as:
$P_k=E[(x_k-\hat{x_k})(x_k-\hat{x_k})^T]$. Then they have talked about how trace of error covariance matrix gives mean squared error and we can minimize it. I am adding a screenshot from the pdf:
screenshot from pdf
I am unable to understand what the elements $P_k$ actually are and how is it's trace the mean squared errors. This $P_k$ is defined for time 'k' then how can it give mean squared error for other time instants as shown in the image?

Best Answer

I find the equation in the screenshot very odd, and I work with Kalman filters quite often. Don't get too caught up on that particular equation.

The important takeaway is that the derivation of the Kalman "gain" matrix $K_k$ is based on minimizing the trace of $P_k$. The diagonal elements of $P_k$ (that are summed together in the trace) are the variances of the estimation errors for the individual elements of the state vector. For example, if element $i$ of the state vector $x_k$ was a position in meters, then entry $(P_k)_{ii}$ is the variance of the estimation error for state element $i$ (in units m$^2$). And it turns out that minimizing the sum of the estimation error variances over all the elements of the state is a good criterion for obtaining good estimates.

Related Question