joshday / OnlineStats.jl

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

Merging histograms does not merge `out` #218

Closed lyon-fnal closed 3 years ago

lyon-fnal commented 3 years ago

Hi - When I merge two histograms (Hist), the "n" for the merged histogram is not the sum of the "ns" for the two original histograms. This is because while merge adds the counts arrays, it does not add the out arrays. Since n = sum(counts) + sum(out) and out is only from one of the histograms, the n for the merged histogram is incorrect.

Was this intentional or an oversight? If the latter, it's an easy fix. Do you want me to make a pull request?

Thanks! -- Adam

joshday commented 3 years ago

That was a silly oversight...thanks for catching it and putting up a fix!

lyon-fnal commented 3 years ago

Awesome! Thanks!

lyon-fnal commented 3 years ago

Would you consider making a release (maybe 1.5.7) with this fix? You've got some other nice changes too that may be nice to get out there. Thanks!

joshday commented 3 years ago

Thanks for the nudge...could've sworn I did this already...

lyon-fnal commented 3 years ago

Thanks and no worries!

I remember this quote, but not the source... "I'm not worried about forgetting things that have happened. What worries me are things that never happened that I remember vividly!" :-)