rlabbe / filterpy

Python Kalman filtering and optimal estimation library. Implements Kalman filter, particle filter, Extended Kalman filter, Unscented Kalman filter, g-h (alpha-beta), least squares, H Infinity, smoothers, and more. Has companion book 'Kalman and Bayesian Filters in Python'.
MIT License
3.22k stars 612 forks source link

FixedLagSmoother use of xSmooth is inconsistent and breaks Saver #274

Open rlabbe opened 2 years ago

rlabbe commented 2 years ago

This could be a two part problem. But first, FixedLagSmoother stores the smoothed data in xSmooth. This is an unpythonic name. It also grows endlessly. As I add log likelihood and mahalanobis to this code this problem only deepens. I am not entirely sure on the interface I want, but in general I probably want to have a state/property that retrieves the smoothed (lagged) output and another for the most recent one. The lists should always be of length N.

If all that is done the saver will probably work fine. Right now you have to ignore xSmooth, and then the saver only has the unsmoothed data in x.

I note that the class currently contains x_s for the smoothed state, but it is never assigned to.