Kalman-and-Bayesian-Filters-in-Python
Kalman-and-Bayesian-Filters-in-Python copied to clipboard
Some bugs found in 12-Particle-Filters.ipynb
Hi, Thanks for such a nice project. If my understanding is correct, then there are some bugs for coding in the 'Resampling Methods' section of '12-Particle-Filters.ipynb'. And if I am wrong, please ignore and close it. (1) In Residual Resampling: 'residual = w - num_copies' should be 'residual = N*np.asarray(weights) - num_copies' in the residual_resample() function.
(2) Should there be a line as
'cumulative_sum[-1] = 1. # ensures sum is exactly one'
to avoid round-off errors in the implementation of the 'Stratified Resampling' and the 'Systematic Resampling' parts?
(3) How about using 'np.random.rand()' OR 'np.random.random()' to replace random()?
Best, Xh