Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Traditional statistical weighting #129

Open
joshday opened this issue Aug 8, 2018 · 5 comments
Open

Traditional statistical weighting #129

joshday opened this issue Aug 8, 2018 · 5 comments

Comments

@joshday
Copy link
Owner

joshday commented Aug 8, 2018

Add the option to put in StatsBase-like weights.

@jw3126
Copy link

jw3126 commented Sep 8, 2018

Continuing #131: So the rough plan would be to have

struct OnlineWeight <: Weight end
    total_weight::Float64
end

function fit!(stat::MyMean{OnlineWeight}, obs, wt)
    total_weight = stat.weight.total_weight + wt
    μ = stat.μ * (total_weight - wt)/wt + obs * wt/total_weight
    stat.μ = μ
    stat.weight.total_weight = total_weight
    stat.n += 1
end

?

@joshday
Copy link
Owner Author

joshday commented Sep 10, 2018

The biggest hurdle is that an OnlineStats.Weight is a fundamentally different thing than StatsBase.AbstractWeights. I'll need to think through it more, but I probably won't have time this week.

@gdkrmr
Copy link
Contributor

gdkrmr commented Oct 27, 2018

I really would like to have this!

@gdkrmr
Copy link
Contributor

gdkrmr commented Nov 5, 2018

This is still WIP: https://github.com/gdkrmr/WeightedOnlineStats.jl

@yakir12
Copy link

yakir12 commented Nov 9, 2018

I would love this too... @gdkrmr, gonna try and use your WeightedOnlineStats.jl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants