I’m implementing the Square-Root Kalman-Filter similar to this python implementation: Python - Square-Root Kalman-Filter
The implementation calculates the QR-decomposition, but it only needs the upper triangular matrix R (see here). The Q is not needed. I searched the internet to see, if there was an efficient implementation to just calculate the matrix R and not Q and found this matlab page: Matlab qr
It states: To calculate the upper-triangular factor R and permutation matrix P , but avoid computing the orthogonal matrix Q (which is often the most computationally expensive part of a call to qr ), you can specify B as an empty matrix:
Why are there so many allocations even though LAPACK.gels! is an inplace function?
Is there a better way to calculate the matrix R? I tried to use a zero sized B as suggested by the matlab page: LAPACK.gels!('N', copy(A), zeros(10,0)), but this does not provide the correct result.
I’d like to make the package publicly available as soon as it is finished.
Are you sure you actually need the square root form? I find that by simply symmetrizing the covariance matrix in the right places, you get almost the same numerical performance with a textbook implementation.
I discussed the need of the square root KF with some industry people some 10 years ago (defence industry). Their point of view was that the square root KF is useful if one does calculations in Float32, but is not needed with Float64.
guarantees positive semi-definiteness of the underlying state covariance
In my post above I asked for the standard Kalman-Filter, because I’d like to be able to switch from standard Kalman-Filter to the UKF or vice-versa depending on whether the process model or the measurement model is linear or non-linear.
Nonetheless, the SR-UKF also needs the matrix R from the QR-decomposition.
The UD algorithms from Bierman are the most robust, however, a Cholesky algorithm of the unscented filter is easiest to implement. Has anyone noticed the bug in the unscented filter equations? As documented, it will estimate observable parameters.