OnlineStats.jl icon indicating copy to clipboard operation
OnlineStats.jl copied to clipboard

Can "fit!" accept a Weight variable per Observation?

Open evveric opened this issue 6 years ago • 1 comments

Let's say I have a "Mean()" object.

I can fit!(o, 1), but If I want to say, this observation has weight = 150%, or only 10%, --> this is not doable right?

FYI, right now I force my program to only have "Integer Custom weight per Observation"

If I see this 1 variable has weight = 200%, I will call fit!(o, 1) Two times, then by definition, it will double the weight of 1 in the final Mean.

But this is a dirty solution. Is there a generic way to add the "Weight" per observation to all fit! function?

Thank you.

evveric avatar Nov 18 '19 08:11 evveric

Not built into OnlineStats (yet). I have some ideas but I never came up with an interface I liked. The complexity lies with multiple types of weighting (e.g. 1) statistical weighting like you are discussing here and 2) OnlineStats' weighting of EqualWeight, ExponentialWeight, etc.).

I think https://github.com/gdkrmr/WeightedOnlineStats.jl has what you are looking for.

joshday avatar Nov 18 '19 15:11 joshday