mean-cl-boot

Mean with a bootstrap percentile confidence interval.

Resamples values with replacement n-boot times, computes the bootstrap mean for each resample, and returns the requested central percentiles of the bootstrap distribution. The resampling indices are drawn from a deterministic noise sequence seeded by seed, so identical inputs always produce identical bounds.

Usage

mean-cl-boot(
  values,
  conf: 0.95,
  n-boot: 1000,
  seed: 0,
)

Parameters

Parameter Default Description
values Array of numbers; non-numeric entries are dropped.
conf 0.95 Confidence level in the open interval (0, 1).
n-boot 1000 Number of bootstrap resamples.
seed 0 Integer seed for the deterministic resampling sequence.

Returns

Dict (y, ymin, ymax); all-none if values has no numerics.

Examples

Default 95% bootstrap interval with 1000 resamples.

#let s = mean-cl-boot((2, 3, 4, 5, 6, 7))

Bump n-boot for a smoother bound and pin seed to keep results reproducible across renders.

#let s = mean-cl-boot((2, 3, 4, 5, 6, 7), n-boot: 5000, seed: 42)
Back to top