deep_sort icon indicating copy to clipboard operation
deep_sort copied to clipboard

Kalman filter covariance update formula

Open bamfpga opened this issue 4 years ago • 5 comments

Hi, Very nice implementation. I've been analysing the code for the Kalman filter linear algebra equations, I understood all of them, except for the last one, the covariance update, which does not seem to match any of the forms presented at https://en.wikipedia.org/wiki/Kalman_filter, neither classic or Joseph form. How was this equation derived?

Another question? Is solving a linear sistem using Cholesky decomposition cheaper than performing a tradition matrix inversion using for example Gauss-Jordan method. Thanks in advance!

bamfpga avatar Aug 12 '20 17:08 bamfpga

Cholesky decomposition is faster than inverting a matrix using Gauss-Jordan elimination in most cases. There are several ways to decompose a matrix as well as compute the inverse. Generally, computing the inverse is slow.

From what I can see, the covariance update assumes the identity matrix is negligible in the Joseph form. Screenshot from 2020-11-05 15-09-32 This factors the equation down to: P = KHPH^TK^T + KRK^T = K(HPH^T + R)K^T = KSK^T

studentbrad avatar Nov 05 '20 20:11 studentbrad

This actually has a name. It took awhile to find in literature, but is commonly referred to as Symmetric form.

studentbrad avatar Nov 16 '20 06:11 studentbrad

Thanks for the response!

bamfpga avatar Nov 16 '20 21:11 bamfpga

I have found this one helpful for resolving this query.

BhautikDonga avatar Mar 18 '21 05:03 BhautikDonga

I have found this one helpful for resolving this query.

Good find. This is a better explanation of what is going on. I'll add that this proof is only valid once we assume the covariance matrix P is symmetric. Otherwise (KHP^T)^T is not equal to KHP. Hence the name Symmetric Form.

studentbrad avatar Mar 22 '21 15:03 studentbrad