Hi
1) In the present Matlab kalman_filter.m suite, the steady state conversion is checked as notsteady = max(max(abs(K-oldK))) > riccati_tol; where K = P(:,mf)*inv(F); is the gain matrix and the first Kold=0;
One problem with that is that, however unlikely, the first K may be sufficiently small, close to 0, leading to a wrong inference that the conversion to steady state occurred in the first step. To avoid that (unlikely) situation, Kold may be set to Inf or some other very large value instead or, the check should take place only if t>1, though setting the first Kold=Inf is a more straight forward change in Matlab kalman_filter.m.
2) Though Harvey (1989) and some other authors assumes convergence when the whole P matrix converges (and the whole P convergence was checked in the initial C++ Kalmn Filte implementations) I wander if we should implement the above gain matrix convergence as a sufficient criteria in the new C++ KalmnFilter instead.
If so, I can make checks work for t>0 only.
Hi George,
- In the present Matlab kalman_filter.m suite, the steady state
conversion is checked as notsteady = max(max(abs(K-oldK))) > riccati_tol; where K = P(:,mf)*inv(F); is the gain matrix and the first Kold=0;
One problem with that is that, however unlikely, the first K may be sufficiently small, close to 0, leading to a wrong inference that the conversion to steady state occurred in the first step. To avoid that (unlikely) situation, Kold may be set to Inf or some other very large value instead or, the check should take place only if t>1, though setting the first Kold=Inf is a more straight forward change in Matlab kalman_filter.m.
your are right. Thanks for point it out. I will make the change.
- Though Harvey (1989) and some other authors assumes convergence
when the whole P matrix converges (and the whole P convergence was checked in the initial C++ Kalmn Filte implementations) I wander if we should implement the above gain matrix convergence as a sufficient criteria in the new C++ KalmnFilter instead.
If so, I can make checks work for t>0 only.
K is a smaller matrix than P, so testing the difference between K and Kold is faster than between P and Pold. The metric of the two tests is also different probably, that a tighter criterium should be used on K than on P, but otherwise the two tests should be equivalent. Stephane has an idea on how to calibrate the tolerance criterium, but he will not turn to it for a while. For the time being, implement the test on K rather than on P.
All the best,
Michel
Thanks Michel .
- Though Harvey (1989) and some other authors assumes convergence
when the whole P matrix converges (and the whole P convergence was checked in the initial C++ Kalmn Filte implementations) I wander if we should implement the above gain matrix convergence as a sufficient criteria in the new C++ KalmnFilter instead.
If so, I can make checks work for t>0 only.
K is a smaller matrix than P, so testing the difference between K and Kold is faster than between P and Pold. The metric of the two tests is also different probably, that a tighter criterium should be used on K than on P, but otherwise the two tests should be equivalent. Stephane has an idea on how to calibrate the tolerance criterium, but he will not turn to it for a while. For the time being, implement the test on K rather than on P.
The implemented algorithm compares only the upper triangles of the symmetric n*n P matrices so that comparing n*n_obs gain matrices (K in kalman_fileter.m) is faster when number of observables n_obs < (n+1)/2 which is still in majority of cases so I will change KF to compare Ks instead.
Best regards George
Thanks Michel .
- Though Harvey (1989) and some other authors assumes convergence
when the whole P matrix converges (and the whole P convergence was checked in the initial C++ Kalmn Filte implementations) I wander if we should implement the above gain matrix convergence as a sufficient criteria in the new C++ KalmnFilter instead.
If so, I can make checks work for t>0 only.
K is a smaller matrix than P, so testing the difference between K and Kold is faster than between P and Pold. The metric of the two tests is also different probably, that a tighter criterium should be used on K than on P, but otherwise the two tests should be equivalent. Stephane has an idea on how to calibrate the tolerance criterium, but he will not turn to it for a while. For the time being, implement the test on K rather than on P.
The implemented algorithm compares only the upper triangles of the symmetric n*n P matrices so that comparing n*n_obs gain matrices (K in kalman_fileter.m) is faster when number of observables n_obs < (n+1)/2 which is still in majority of cases so I will change KF to compare Ks instead.
Best regards George