BootstrapCIResult

data class BootstrapCIResult(val percentile: ConfidenceInterval, val basic: ConfidenceInterval, val bca: ConfidenceInterval, val observedStatistic: Double, val nResamples: Int, val confidenceLevel: Double)(source)

The result of a bootstrap confidence interval computation, containing three CI methods.

All three intervals are computed from the same set of bootstrap resamples, so they can be compared directly without re-running the bootstrap.

Example:

val result = bootstrapCI(
doubleArrayOf(23.0, 25.0, 27.0, 30.0, 32.0, 28.0),
nResamples = 10_000,
random = Random(42),
) { it.average() }
result.percentile // ConfidenceInterval(lower=24.83..., upper=30.33...)
result.bca // ConfidenceInterval(lower=24.96..., upper=30.49...)
result.basic // ConfidenceInterval(lower=24.66..., upper=30.16...)

Constructors

Link copied to clipboard
constructor(percentile: ConfidenceInterval, basic: ConfidenceInterval, bca: ConfidenceInterval, observedStatistic: Double, nResamples: Int, confidenceLevel: Double)

Properties

Link copied to clipboard

the basic (pivotal) confidence interval, which reflects the bootstrap distribution around the observed statistic. Defined as twice the observed statistic minus the opposite-tail quantile of the bootstrap distribution.

Link copied to clipboard

the bias-corrected and accelerated (BCa) confidence interval. Adjusts for both median bias and skewness of the bootstrap distribution using a jackknife acceleration factor. Generally the most accurate of the three methods.

Link copied to clipboard

the confidence level used to compute the intervals.

Link copied to clipboard

the number of bootstrap resamples that were generated.

Link copied to clipboard

the value of the statistic computed on the original data.

Link copied to clipboard

the percentile confidence interval, computed from quantiles of the bootstrap distribution. Simple and intuitive but does not correct for bias or skewness.