MCPcopy Create free account
hub / github.com/microsoft/SandDance / bootstrapCI

Function bootstrapCI

docs/app/js/sanddance-app.js:119170–119186  ·  view source on GitHub ↗
(array, samples, alpha, f)

Source from the content-addressed store, hash-verified

119168 random = r;
119169}
119170function bootstrapCI(array, samples, alpha, f) {
119171 if (!array.length) return [
119172 undefined,
119173 undefined
119174 ];
119175 const values = Float64Array.from(numbers(array, f)), n = values.length, m = samples;
119176 let a, i, j, mu;
119177 for(j = 0, mu = Array(m); j < m; ++j){
119178 for(a = 0, i = 0; i < n; ++i)a += values[~~(random() * n)];
119179 mu[j] = a / n;
119180 }
119181 mu.sort((0, _d3Array.ascending));
119182 return [
119183 (0, _d3Array.quantile)(mu, alpha / 2),
119184 (0, _d3Array.quantile)(mu, 1 - alpha / 2)
119185 ];
119186}
119187// Dot density binning for dot plot construction.
119188// Based on Leland Wilkinson, Dot Plots, The American Statistician, 1999.
119189// https://www.cs.uic.edu/~wilkinson/Publications/dotplots.pdf

Callers

nothing calls this directly

Calls 3

numbersFunction · 0.70
randomFunction · 0.70
fromMethod · 0.45

Tested by

no test coverage detected