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.3k stars 615 forks source link

indexing issue in rts_smoother #265

Open mjsobrep opened 2 years ago

mjsobrep commented 2 years ago

It looks like there is an indexing issue on the Fs: https://github.com/rlabbe/filterpy/blob/a437893597957764fb6b415bfb5640bb117f5b99/filterpy/kalman/kalman_filter.py#L995 I'm not sure why there are the k+1 indeces. I would expect this to be the same as the calculation of P in the forward pass: https://github.com/rlabbe/filterpy/blob/a437893597957764fb6b415bfb5640bb117f5b99/filterpy/kalman/kalman_filter.py#L478

Comparing to the standalone smoother: https://github.com/rlabbe/filterpy/blob/a437893597957764fb6b415bfb5640bb117f5b99/filterpy/kalman/kalman_filter.py#L1779 the k+1 terms are not there.