Skip to content

meanConfidenceInterval

meanConfidenceInterval(values, level?): ConfidenceInterval

Defined in: confidence-interval.ts:46

Normal-approximation confidence interval for the mean of a sample: mean ± z · s / √n, with z the (1 + level) / 2 standard normal quantile and s the sample standard deviation.

The approximation assumes the sampling distribution of the mean is close to normal — fine for a symmetric or mildly skewed sample of reasonable size, optimistic for the heavy right tail timing measurements usually have. See medianConfidenceInterval for a distribution-free alternative.

O(n).

readonly number[]

The sample. Not modified.

number = 0.95

Confidence level in (0, 1). Default 0.95.

ConfidenceInterval

The interval, centered on the sample mean.

When the sample has fewer than two values, or level is outside (0, 1).