5.2 Confidence intervals on a normal population

We assume in this section the rv X follows a N(μ,σ2) distribution from which a srs (X1,,Xn) is extracted. The confidence intervals derived in this section arise from the sampling distributions obtained in Section 2.2 for normal populations. We will apply the pivotal quantity method repeatedly to these sampling distributions.

5.2.1 Confidence interval for the mean with known variance

Let us fix the significance level α. For applying the pivotal quantity method we need an estimator of μ with known distribution. For example, ˆμ=ˉX, which verifies

ˉXN(μ,σ2n).

A transformation that removes μ from the distribution of ˉX is simply

ˉXμN(0,σ2n).

However, a more practical pivot is

Z:=ˉXμσ/nN(0,1)

since its distribution is “clean” and does not depend on σ.

Now we must find the constants c1 and c2 such that

P(c1Zc2)=1α.

If split evenly the probability α at both sides of the distribution,65 then c1 and c2 are the constants that verify

Φ(c1)=α/2andΦ(c2)=1α/2,

that is, c1 is the lower α/2-quantile of N(0,1) and c2 is the lower (1α/2)-quantile of the same distribution. c1 and c2 are known as critical values.

Definition 5.3 (Critical value) A critical value α of a continuous66 rv X is the value of the variable that accumulates α probability to its right, or in other words, is the upper α-quantile of X. It is denoted by xα and is such that

P(Xxα)=α.

The constants c1 and c2 verify

P(Zc1)=1α/2andP(Zc2)=α/2,

that is, c1=z1α/2 and c2=zα/2. Given the symmetry of the standard normal distribution with respect to 0, it is verified that z1α/2=zα/2, that is, c1=c2. Example 2.8 illustrated how to compute the critical values of a N(0,1) in R. In terms of the cdf Φ of N(0,1), and connecting with (5.4), we have

Φ(z1α/2)=Φ(zα/2)=α/2andΦ(zα/2)=1α/2.

Representation of the probability \(\mathbb{P}(-z_{\alpha/2}\leq Z\leq z_{\alpha/2})=1-\alpha\) (in green) and its complementary (in orange) for \(\alpha=0.10\).

Figure 5.3: Representation of the probability P(zα/2Zzα/2)=1α (in green) and its complementary (in orange) for α=0.10.

Once obtained c1=zα/2 and c2=zα/2, we solve for μ in the inequalities inside the probability:

1α=P(zα/2ˉXμσ/nzα/2)=P(zα/2σnˉXμzα/2σn)=P(ˉXzα/2σnμˉX+zα/2σn)=P(ˉXzα/2σnμˉX+zα/2σn).

Therefore, a confidence interval for μ is

CI1α(μ)=[ˉXzα/2σn,ˉX+zα/2σn].

We represent it in a compact way as

CI1α(μ)=[ˉXzα/2σn].

Example 5.2 A gunpowder manufacturer developed a new formula that was tested in eight bullets. The resultant initial velocities, measured in meters per second, were

916,892,895,904,913,916,895,885.

Assuming that the initial velocities have normal distribution with σ=12 meters per second, find a confidence interval at significance level α=0.05 for the initial mean velocity of the bullets that employ the new gunpowder.

We know that

XN(μ,122), with unknown μ.

From the sample we have that

n=8,ˉX=902,α/2=0.025,zα/21.96.

Then, a confidence interval for μ at 0.95 confidence is

CI0.95(μ)=[ˉXzα/2σn]=[902zα/2128][893.68,910.32].

In R, the previous computations can be simply done as:

# Sample
X <- c(916, 892, 895, 904, 913, 916, 895, 885)

# n, mean, sigma, alpha, z_{\alpha/2}
n <- length(X)
X_bar <- mean(X)
sigma <- 12
alpha <- 0.05
z <- qnorm(alpha / 2, lower.tail = FALSE)

# CI
X_bar + c(-1, 1) * z * sigma / sqrt(n)
## [1] 893.6846 910.3154

5.2.2 Confidence interval for the mean with unknown variance

In this case (5.3) is not a pivot: besides depending on μ, the statistic also depends on another unknown parameter, σ2, which makes impossible to encapsulate μ between two computable limits. However, we can estimate σ2 unbiasedly with S2, and produce

T:=ˉXμS/n.

T is a pivot, since Theorem 2.3 provides the μ-free distribution of T, tn1. If we split evenly the significance level α between the two tails of the distribution, then the constants c1 and c2 are

P(c1Tc2)=1α,

corresponding to the critical values c1=tn1;1α/2 and c2=tn1;α/2. Since Student’s t is also symmetric, then c1=c2=tn1;α/2, hence

1α=P(tn1;α/2ˉXμS/ntn1;α/2).

Example 2.11 illustrated how to compute probabilities in a Students’t distribution.

Representation of the probability \(\mathbb{P}(-t_{n-1;\alpha/2}\leq t_{n-1}\leq t_{n-1;\alpha/2})=1-\alpha\) (in green) and its complementary (in orange) for \(\alpha=0.10\) and \(n=10\).

Figure 5.4: Representation of the probability P(tn1;α/2tn1tn1;α/2)=1α (in green) and its complementary (in orange) for α=0.10 and n=10.

Solving μ in the inequalities, we get

1α=P(ˉXtn1;α/2S/nμˉX+tn1;α/2S/n).

Then, a confidence interval for the mean μ at confidence level 1α is

CI1α(μ)=[ˉXtn1;α/2Sn].

Example 5.3 Compute the same confidence interval asked in the Example 5.2 but assuming that the variance of the initial velocities is unknown.

If the variance is unknown, then we can estimate it with S2=143.43. Using t7;0.0252.365, the confidence interval for μ is

CI0.95(μ)=[ˉXt7;0.025Sn][9022.365×143.438][891.99,912.01].

In R, the previous computations can be simply done as:

# Sample
X <- c(916, 892, 895, 904, 913, 916, 895, 885)

# n, mean, S', alpha, t_{\alpha/2;n-1}
n <- length(X)
X_bar <- mean(X)
S_prime <- sd(X)
alpha <- 0.05
t <- qt(alpha / 2, df = n - 1, lower.tail = FALSE)

# CI
X_bar + c(-1, 1) * t * S_prime / sqrt(n)
## [1] 891.9877 912.0123

5.2.3 Confidence interval for the variance

We already have an unbiased estimator of σ2, the quasivariance S2. In addition, by Theorem 2.2 we have a pivot

U:=(n1)S2σ2χ2n1.

Then, we only need to compute the constants c1 and c2 such that

P(c1Uc2)=1α.

Splitting the probability α evenly to both sides of the χ2 distribution,67 we have that c1=χ2n1;1α/2 and c2=χ2n1;α/2. Once the constants are computed, solving for σ2 in the inequalities

1α=P(χ2n1;1α/2(n1)S2σ2χ2n1;α/2)=P(χ2n1;1α/2(n1)S21σ2χ2n1;α/2(n1)S2)=P((n1)S2χ2n1;α/2σ2(n1)S2χ2n1;1α/2)

yields the confidence interval for σ2:

CI1α(σ2)=[(n1)S2χ2n1;α/2,(n1)S2χ2n1;1α/2].

Observe that χ2n1;1α/2<χ2n1;α/2 but in the confidence interval these critical values appear in the denominators in reverse order.

Representation of the probability \(\mathbb{P}(\chi^2_{n-1;1-\alpha/2}\leq \chi^2_{n-1}\leq \chi^2_{n-1;\alpha/2})=1-\alpha\) (in green) and its complementary (in orange) for \(\alpha=0.10\) and \(n=10\).

Figure 5.5: Representation of the probability P(χ2n1;1α/2χ2n1χ2n1;α/2)=1α (in green) and its complementary (in orange) for α=0.10 and n=10.

Example 5.4 A practitioner wants to verify the variability of an equipment employed for measuring the volume of an audio source. Three independent measurements recorded with this equipment were

4.1,5.2,10.2.

Assuming that the measurements have a normal distribution, obtain the confidence interval of σ2 with confidence 0.90.

From the three measurements we obtain

S2=10.57,α/2=0.05,n=3.

Then, the confidence interval for σ2 is

CI0.90(σ2)=[(n1)S2χ22;0.05,(n1)S2χ22;0.95][2×10.575.991,2×10.570.103][3.53,205.24].

Recall that since n is small, then the critical value c1=χ2n;1α/2 of the χ2n1 distribution is close to zero (see Figure 5.5), and hence the length of the interval is large, illustrating the little information available.

The previous computations can be done as:

# Sample
X <- c(4.1, 5.2, 10.2)

# n, S'^2, alpha, c1, c2
n <- length(X)
S2_prime <- var(X)
alpha <- 0.10
c1 <- qchisq(1 - alpha / 2, df = n - 1, lower.tail = FALSE)
c2 <- qchisq(alpha / 2, df = n - 1, lower.tail = FALSE)

# CI
(n - 1) * S2_prime / c(c2, c1)
## [1]   3.528353 206.069821

  1. This makes a lot of sense in normal distributions due to the shape of the N(0,1) pdf: symmetric and decaying monotonically from 0.↩︎

  2. The definition for discrete rv’s involve considering the smallest xα such that P(Xxα)α.↩︎

  3. This is due to tradition and simplicity. Unlike in the normal or Student’s t cases, splitting α evenly at both tails does not give the shortest interval containing 1α probability. However, the shortest confidence interval with 1α coverage is more convoluted.↩︎