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

Bootstrap resampling from an arbitrary number of distributions? #51

Open
harryscholes opened this issue Jun 21, 2019 · 3 comments
Open

Comments

@harryscholes
Copy link

harryscholes commented Jun 21, 2019

Implementing this functionality would would allow you to do things like calculate the mean difference between two distributions:

using Statistics

xs = rand(1000)
ys = rand(1000)

bootstrap((x,y)->mean(x)-mean(y), (xs, ys), BasicSampling(1000)) # mock API

Which would be equivalent(ish) to the following (minus the nice extras that Bootstrap.jl provides):

using Statistics, StatsBase

map(_->mean(sample(xs, size(xs)))-mean(sample(ys, size(ys))), 1:1000)
@juliangehring
Copy link
Owner

Nice idea, that would definitely be a useful feature to support!

@juliangehring
Copy link
Owner

As a "workaround", one could currently get the same in multiple steps:

bs1 = bootstrap(x->mean(x), xs, BasicSampling(1000))
bs2 = bootstrap(y->mean(y), ys, BasicSampling(1000))
z = straps(bs1)[1] - straps(bs2)[1]

@harryscholes
Copy link
Author

Yes, I think it would be a great feature to include! I'll have a look into it at the JuliaCon hackathon

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

2 participants