TOPICS
Search

Confidence Interval


A confidence interval is an interval in which a measurement or trial falls corresponding to a given probability. Usually, the confidence interval of interest is symmetrically placed around the mean, so a 50% confidence interval for a symmetric probability density function would be the interval [-a,a] such that

 1/2=int_(-a)^aP(x)dx.
(1)
ConfidenceIntervalProbability

For a normal distribution, the probability that a measurement falls within n standard deviations (nsigma) of the mean mu (i.e., within the interval [mu-nsigma,mu+nsigma]) is given by

P(mu-nsigma<x<mu+nsigma)=1/(sigmasqrt(2pi))int_(mu-nsigma)^(mu+nsigma)e^(-(x-mu)^2/(2sigma^2))dx
(2)
=2/(sigmasqrt(2pi))int_mu^(mu+nsigma)e^(-(x-mu)^2/(2sigma^2))dx.
(3)

Now let u=(x-mu)/sqrt(2)sigma, so du=dx/sqrt(2)sigma. Then

P(mu-nsigma<x<mu+nsigma)=2/(sigmasqrt(2pi))sqrt(2)sigmaint_0^(n/sqrt(2))e^(-u^2)du
(4)
=2/(sqrt(pi))int_0^(n/sqrt(2))e^(-u^2)du
(5)
=erf(n/(sqrt(2))),
(6)

where erf(x) is the so-called erf function. The following table summarizes the probabilities P(mu-x_n<x<mu+x_n) that measurements from a normal distribution fall within [mu-x_n,mu+x_n] for x_n=nsigma with small values of n.

x_nP(mu-x_n<x<mu+x_n)
sigma0.6826895
2sigma0.9544997
3sigma0.9973002
4sigma0.9999366
5sigma0.9999994
ConfidenceIntervals

Conversely, to find the probability-P confidence interval centered about the mean for a normal distribution in units of sigma, solve equation (5) for n to obtain

 n=sqrt(2)erf^(-1)(P),
(7)

where erf^(-1)(x) is the inverse erf function. The following table then gives the values of x_P such that [mu-x_P,mu+x_P] is the probability-P confidence interval for a few representative values of P. These values can be returned by NormalCI[0, 1, ConfidenceLevel -> P] in the Wolfram Language package HypothesisTesting` .

Px_P
0.8001.28155sigma
0.9001.64485sigma
0.9501.95996sigma
0.9902.57583sigma
0.9952.80703sigma
0.9993.29053sigma

See also

Confidence Limits, Alpha Value, Erf, Inverse Erf, Normal Distribution, P-Value, Significance, Standard Deviation Explore this topic in the MathWorld classroom

Explore with Wolfram|Alpha

References

Kenney, J. F. and Keeping, E. S. "Confidence Limits for the Binomial Parameter" and "Confidence Interval Charts." §11.4 and 11.5 in Mathematics of Statistics, Pt. 1, 3rd ed. Princeton, NJ: Van Nostrand, pp. 167-169, 1962.

Referenced on Wolfram|Alpha

Confidence Interval

Cite this as:

Weisstein, Eric W. "Confidence Interval." From MathWorld--A Wolfram Web Resource. https://mathworld.wolfram.com/ConfidenceInterval.html

Subject classifications