Kalman filter innovation residual inversion I'm trying to implement a Kalman filter in a computationally efficient way. The main issue is the inversion of the innovation residual:
$$S=HPH^T+R$$
$$K=PH^TS^{-1}$$
My question is, can one assume that the S matrix in positive definite? This would make inverting it more computationally efficient....
 A: If $P$ is non negative-definite and $R$ is positive-definite, then yes $S$ is positive definite.  $S$ is positive definite if for every non-zero $x$,
\begin{align}
0 &< x^T S x \\
0 &< x^T ( HPH^T + R ) x \\
0 &< x^THPH^Tx + x^T R x \\
0 &< (H^Tx)^TP(H^Tx) + x^T R x
\end{align}
If $R$ is positive definite then $ x^T R x > 0 $.  If $P$ is non-negative definite then $(H^Tx)^TP(H^Tx) \ge 0$.  If $R$ is positive definite and $P$ is non-negative definite then $(H^Tx)^TP(H^Tx) + x^T R x > 0$ and so $S$ is positive definite.
Generally covariance matricies ($P$, $R$) are positive-definite so generally $HPH^T+R$ is positive definite.
A: Since $S$ must be a covariance matrix (it is the covariance matrix of the multivariate normal distribution which corresponds to the predictive distribution of your measurements), and by definition covariance matrices are positive-definite, then you can safely assume that $S$ is positive-definite. By the way, you should avoid inverting matrices, it is more numerically stable to solve the corresponding linear system of equations.
