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
ˉX∼N(μ,σ2n).
A transformation that removes μ from the distribution of ˉX is simply
ˉX−μ∼N(0,σ2n).
However, a more practical pivot is
Z:=ˉX−μσ/√n∼N(0,1)
since its distribution is “clean” and does not depend on σ.
Now we must find the constants c1 and c2 such that
P(c1≤Z≤c2)=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(X≥xα)=α.
The constants c1 and c2 verify
P(Z≥c1)=1−α/2andP(Z≥c2)=α/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\).](inference_files/figure-html/ci-zalpha-1.png)
Figure 5.3: Representation of the probability P(−zα/2≤Z≤zα/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−μσ/√n≤zα/2)=P(−zα/2σ√n≤ˉX−μ≤zα/2σ√n)=P(−ˉX−zα/2σ√n≤−μ≤−ˉX+zα/2σ√n)=P(ˉX−zα/2σ√n≤μ≤ˉX+zα/2σ√n).
Therefore, a confidence interval for μ is
CI1−α(μ)=[ˉX−zα/2σ√n,ˉX+zα/2σ√n].
We represent it in a compact way as
CI1−α(μ)=[ˉX∓zα/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
X∼N(μ,122), with unknown μ.
From the sample we have that
n=8,ˉX=902,α/2=0.025,zα/2≈1.96.
Then, a confidence interval for μ at 0.95 confidence is
CI0.95(μ)=[ˉX∓zα/2σ√n]=[902∓zα/212√8]≈[893.68,910.32].
In R, the previous computations can be simply done as:
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 S′2, and produce
T:=ˉX−μS′/√n.
T is a pivot, since Theorem 2.3 provides the μ-free distribution of T, tn−1. If we split evenly the significance level α between the two tails of the distribution, then the constants c1 and c2 are
P(c1≤T≤c2)=1−α,
corresponding to the critical values c1=tn−1;1−α/2 and c2=tn−1;α/2. Since Student’s t is also symmetric, then c1=−c2=−tn−1;α/2, hence
1−α=P(−tn−1;α/2≤ˉX−μS′/√n≤tn−1;α/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\).](inference_files/figure-html/ci-talpha-1.png)
Figure 5.4: Representation of the probability P(−tn−1;α/2≤tn−1≤tn−1;α/2)=1−α (in green) and its complementary (in orange) for α=0.10 and n=10.
Solving μ in the inequalities, we get
1−α=P(ˉX−tn−1;α/2S′/√n≤μ≤ˉX+tn−1;α/2S′/√n).
Then, a confidence interval for the mean μ at confidence level 1−α is
CI1−α(μ)=[ˉX∓tn−1;α/2S′√n].
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 S′2=143.43. Using t7;0.025≈2.365, the confidence interval for μ is
CI0.95(μ)=[ˉX∓t7;0.025S′√n]≈[902∓2.365×√143.438]≈[891.99,912.01].
In R, the previous computations can be simply done as:
5.2.3 Confidence interval for the variance
We already have an unbiased estimator of σ2, the quasivariance S′2. In addition, by Theorem 2.2 we have a pivot
U:=(n−1)S′2σ2∼χ2n−1.
Then, we only need to compute the constants c1 and c2 such that
P(c1≤U≤c2)=1−α.
Splitting the probability α evenly to both sides of the χ2 distribution,67 we have that c1=χ2n−1;1−α/2 and c2=χ2n−1;α/2. Once the constants are computed, solving for σ2 in the inequalities
1−α=P(χ2n−1;1−α/2≤(n−1)S′2σ2≤χ2n−1;α/2)=P(χ2n−1;1−α/2(n−1)S′2≤1σ2≤χ2n−1;α/2(n−1)S′2)=P((n−1)S′2χ2n−1;α/2≤σ2≤(n−1)S′2χ2n−1;1−α/2)
yields the confidence interval for σ2:
CI1−α(σ2)=[(n−1)S′2χ2n−1;α/2,(n−1)S′2χ2n−1;1−α/2].
Observe that χ2n−1;1−α/2<χ2n−1;α/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\).](inference_files/figure-html/ci-chialpha-1.png)
Figure 5.5: Representation of the probability P(χ2n−1;1−α/2≤χ2n−1≤χ2n−1;α/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
S′2=10.57,α/2=0.05,n=3.
Then, the confidence interval for σ2 is
CI0.90(σ2)=[(n−1)S′2χ22;0.05,(n−1)S′2χ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 χ2n−1 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:
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.↩︎
The definition for discrete rv’s involve considering the smallest xα such that P(X≥xα)≥α.↩︎
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.↩︎