joshday / OnlineStats.jl

⚡ Single-pass algorithms for statistics
https://joshday.github.io/OnlineStats.jl/latest/
MIT License
831 stars 62 forks source link

Fix inequality in reservoir sampling #222

Closed Drvi closed 3 years ago

Drvi commented 3 years ago

I noticed the reservoir sampling was never reassigning the kth element, this is just a single letter fix.

Up: before MR Below: after image

joshday commented 3 years ago

Oh yikes...good catch! And thanks for the fix!