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

residual_resample issue #290

Open siyangsong opened 10 months ago

siyangsong commented 10 months ago

I noticed the definition of the residual in residual resampling should be

residual = N*weights - num_copies

while the current code has

https://github.com/rlabbe/filterpy/blob/3b51149ebcff0401ff1e10bf08ffca7b6bbc4a33/filterpy/monte_carlo/resampling.py#L70C1-L70C62