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

Need some help to reproduce pykalman behavior on simple linear example #262

Open antoinecollet5 opened 2 years ago

antoinecollet5 commented 2 years ago

I want to switch from pykalman to filterpy because the later is not maintained anymore.

I try to reproduce a basic filtering and smoothing example that I did with pykalman (original code from Anton):

linear_case_pykalman.ipynb

However, I struggle to make it work with filterpy and I do not really get why... It has to do with missing values handing I guess.

linear_case_filterpy.ipynb

Thanks in advance for the help !

Eheran1 commented 2 years ago

Page not found in both cases. Seems like they are here now. But where is the issue?

antoinecollet5 commented 2 years ago

Salut @Eheran1,

Thank you I fixed the two links.

Well, indeed, the second link relies on PR #263 which solves the issue. Here is the original notebook (using filterpy 1.4.5 from pypi). As you can see, the non handling of NaN causes problems and is not really compatible with a numpy approach.

Note that the PR has not been merged so the issue cannot be closed.