gdkrmr / WeightedOnlineStats.jl

Weighted version of OnlineStats.jl
MIT License
10 stars 4 forks source link

track mean weights instead of total weight #13

Closed gdkrmr closed 5 years ago

gdkrmr commented 5 years ago

Summing up weights will result in loss of precision.

o.W += w

Question: Is it better to carry around the mean of the weights and the number of samples?

o.\muW = smooth(o.W, w, 1/o.n)
o.n += 1

o.W := o.\muW * o.n

Mu best guess is that these have have the same rate of producing errors.