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).
Parameters
Section titled “Parameters”values
Section titled “values”readonly number[]
The sample. Not modified.
level?
Section titled “level?”number = 0.95
Confidence level in (0, 1). Default 0.95.
Returns
Section titled “Returns”The interval, centered on the sample mean.
Throws
Section titled “Throws”When the sample has fewer than two values, or level is
outside (0, 1).