Search for probability and statistics terms on Statlect
StatLect

Confidence interval for the variance

by , PhD

This lecture shows how to derive confidence intervals for the variance of a normal distribution.

We analyze two different cases:

  1. when the mean of the distribution is known;

  2. when the mean is unknown.

For these two cases we derive the level of confidence and we show how to adjust it.

Two solved exercises can be found at the end of the lecture.

The theory needed to understand the derivations is presented in the page on interval estimation.

Table of Contents

Known mean

We start with the case in which the mean is known.

The sample

The sample is made of independent draws from a normal distribution.

Specifically, we observe the realizations of n independent random variables X_1, ..., X_n, all having a normal distribution with:

The confidence interval

We use the following estimator of variance:[eq1]

The confidence interval is[eq2]where $z_{1}$ and $z_{2}$ are strictly positive constants and $z_{1}<z_{2}$. The choice of these constants is discussed below.

Coverage probability

The coverage probability of the confidence interval $T_{n}$ is[eq3]where Z is a Chi-square random variable with n degrees of freedom.

Proof

The coverage probability can be written as[eq4]where we have defined[eq5]In the lecture on variance estimation, we have shown that [eq6] has a Gamma distribution with parameters n and sigma^2, given the assumptions on the sample made above. Multiplying a Gamma random variable with parameters n and sigma^2 by [eq7], we obtain a Chi-square random variable with n degrees of freedom, which in this case is the distribution of Z.

Level of confidence

The coverage probability does not depend on the unknown parameter sigma^2.

Therefore, the level of confidence of the interval estimator $T_{n}$ coincides with the coverage probability:[eq8]where Z is a Chi-square random variable with n degrees of freedom.

How to adjust the level of confidence

Note that[eq9]where F is the distribution function of a Chi-square random variable with n degrees of freedom.

If $c$ is the desired level of confidence, then we need to choose $z_{1}$ and $z_{2}$ so as to solve the equation[eq10]

As this is a single equation in two unknowns, there are infinitely many choices of $z_{1}$ and $z_{2}$ that solve the equation.

Possible choices are:

  1. set $z_{1}=0$, which implies [eq11] and [eq12];

  2. numerically search for a couple of values $z_{1}$ and $z_{2}$ that not only solve the equation, but also minimize the length of the confidence interval.

Unknown mean

We now relax the assumption that the mean of the distribution is known.

The sample

The sample is made of the realizations of n independent variables X_1, ..., X_n, all having a normal distribution with:

The confidence interval

To construct interval estimators of the variance sigma^2, we use the sample mean[eq13]and either the unadjusted sample variance[eq14]or the adjusted sample variance[eq15]We consider the following confidence interval for the variance:[eq16]where $z_{1}$ and $z_{2}$ are strictly positive constants and $z_{1}<z_{2}$.

Below we will see how to choose $z_{1}$ and $z_{2}$.

Coverage probability

The coverage probability is[eq17]where $Z_{n-1}$ is a Chi-square random variable with $n-1$ degrees of freedom.

Proof

The coverage probability can be written as[eq18]where we have defined[eq19]In the lecture on variance estimation, we have proved that the unadjusted sample variance $S_{n}^{2}$ has a Gamma distribution with parameters $n-1$ and [eq20]. Therefore, $Z_{n-1}$ has a Gamma distribution with parameters $n-1$ and $h$ where[eq21]But a Gamma distribution with parameters $n-1$ and $n-1$ is the same as a Chi-square distribution with $n-1$ degrees of freedom, which in this case is the distribution of $Z_{n-1}$.

Confidence coefficient

The coverage probability does not depend on the unknown parameters mu and sigma^2.

Therefore, the level of confidence is equal to the coverage probability:[eq22]where $Z_{n-1}$ is a Chi-square distribution with $n-1$ degrees of freedom.

How to adjust the level of confidence

The level of confidence is the same found for the case of known mean. The only difference is in the number of degrees of freedom.

Therefore, the methods to choose $z_{1}$ and $z_{2}$ are those already illustrated above.

Solved exercises

Below you can find some exercises with explained solutions.

Exercise 1

Suppose that you observe a sample of 100 independent draws from a normal distribution having known mean $mu =0$ and unknown variance sigma^2.

Denote the 100 draws by X_1, ..., $X_{100}$.

Suppose that:[eq23]

Find a confidence interval for sigma^2 at 90% confidence.

Hint: the distribution function [eq24] of a Chi-square random variable Z with 100 degrees of freedom is such that[eq25]

Solution

Consider the confidence interval[eq2]The level of confidence is[eq27]where Z is a Chi-square random variable with n degrees of freedom and [eq28] are strictly positive constants. If we set[eq29]then[eq30]which is equal to our desired level of confidence. Thus, the confidence interval for sigma^2 is[eq31]

Exercise 2

Suppose that you observe a sample of 100 independent draws from a normal distribution having unknown mean mu and unknown variance sigma^2.

Denote the 100 draws by X_1, ..., $X_{100}$.

Suppose that their adjusted sample variance is[eq32]

Find a confidence interval for sigma^2. Set the level of confidence at 99%.

Hint: a Chi-square random variable Z with $99$ degrees of freedom has a distribution function [eq33] such that[eq34]

Solution

Let the confidence interval be[eq35]Then, the level of confidence is[eq27]where Z is a Chi-square random variable with $n-1$ degrees of freedom and [eq37] are strictly positive constants. If we set[eq38]then[eq39]which is equal to the desired level of confidence. Thus, the confidence interval for sigma^2 is[eq40]

How to cite

Please cite as:

Taboga, Marco (2021). "Confidence interval for the variance", Lectures on probability theory and mathematical statistics. Kindle Direct Publishing. Online appendix. https://www.statlect.com/fundamentals-of-statistics/set-estimation-variance.

The books

Most of the learning materials found on this website are now available in a traditional textbook format.