daru
https://github.com/sciruby/daru
Ruby
Data Analysis in RUby
Daru::Vector#bootstrap
== Bootstrap
Generate +nr+ resamples (with replacement) of size +s+
from vector, computing each estimate from +estimators+
over each resample.
+estimators+ could be
a) Hash with variable names as keys and lambdas as values
a.bootstrap(:log_s2=>lambda {|v| Math.log(v.variance)},1000)
b) Array with names of method to bootstrap
a.bootstrap([:mean, :sd],1000)
c) A single method to bootstrap
a.jacknife(:mean, 1000)
If s is nil, is set to vector size by default.
Returns a DataFrame where each vector is a vector
of length +nr+ containing the computed resample estimates.Edit
git clone [email protected]:sciruby/daru.git
cd daru
open lib/daru/vector.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-Daru--Vector-bootstrap-for-pr
# Commit to gitgit add lib/daru/vector.rbgit commit -m "better docs for Daru::Vector#bootstrap"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-Daru--Vector-bootstrap-for-pr
hub pull-request
# Celebrate!