A Note on Optimal Intervals in Normal Populations
Abstract
In the setting of one and two normal populations, the shortest confidence interval (SCI) involving location parameters coincides with the classic equal-tails confidence interval (ETCI). However, for confidence intervals involving scale parameters, the ETCI fails to provide the SCI and results can differ notably. In order to obtain such SCIs, either constrained optimization problems or nonlinear systems of equations have to be solved. In this setting, two tables are provided to find the SCIs at 95% confidence, which can be then used in classrooms to compare the results with the ETCIs usually obtained by the students and provided by the statistical software.
Full text
Bolet´ın de Estad´ıstica e Investigaci´on Operativa Vol. 31, No. 2, Julio 2015, pp. 108-117 Estad´ıstica A Note on Optimal Intervals in Normal Populations Jose M. Gavilan and Francisco J. Ortega Department of Applied Economics I University of Seville !ga[email protected], ![email protected] Abstract In the setting of one and two normal populations, the shortest confidence interval (SCI) involving location parameters coincides with the classic equal-tails confidence interval (ETCI). However, for confidence intervals involving scale parameters, the ETCI fails to provide the SCI and results can differ notably. In order to obtain such SCIs, either constrained optimization problems or nonlinear systems of equations have to be solved. In this setting, two tables are provided to find the SCIs at 95% confidence, which can be then used in classrooms to compare the results with the ETCIs usually obtained by the students and provided by the statistical software. Keywords: Confidence intervals, Normal populations, Shortest confidence interval. AMS Subject classifications: 62F99 1. Introduction Given a real-valued random variable X of probability density function (pdf) f(x;θ),x∈R,where θ∈Θis an unknown parameter (a fixed real quantity) to be estimated, a confidence interval (CI) at confidence level 1 −αis a random interval [q∗ 1,q∗ 2] built from a random sample X1,X 2,...,X nsuch that P(q∗ 1<θ<q ∗ 2)=1−α.(1.1) The most common way of obtaining a CI for θis the well-known method of the pivotal quantity (see for example Casella and Berger, 2002) which is based on a random variable Q=Q(X1,X 2,...,X n;θ),called the pivot or pivotal quantity, whose distribution is independent of θ. Therefore, it is possible to find two quantiles q1and q2of Qsuch that P(q1<Q<q 2)=1−α,(1.2) c 2015 SEIO
A Note on Optimal Intervals in Normal Populations 109 and then convert this relation into a relation as in (1.1) to obtain the CI for θ. The length of the CI is given by ℓ=q∗ 2−q∗ 1. When, for a given α, it is not possible to select another pair (q1,q 2) to reduce the length, then the CI is called the shortest confidence interval (SCI) for θbased on Qand its length is denoted by ℓSCI. On the other hand, if the quantities (q1,q 2) are chosen such that P(Q<q 1)=α1and P(Q>q 2)=α2,(1.3) where α1∈[0,α] and α1+α2=α, then many other CIs at level 1 −αare obtained. In the particular case in which α1=α2=α/2,the CI is named the equal-tails confidence interval (ETCI) for θbased on Q, and its length is denoted by ℓETCI. The ETCI and the SCI sometimes coincide. Specifically, this happens provided that the distribution of the pivotal quantity is symmetric and concave on the right-hand side of the point of symmetry (Kirmani, 1990); this also holds true when the distribution of the pivot is symmetric and unimodal1(Casella and Berger, 2002). It is clear that, in general, the SCI is preferable to the ETCI since it is more accurate, however only the ETCI is usually obtained in classrooms and it is the only interval provided by the statistical software. In this paper, the particular case of one and two normal populations is analysed, for which the pivots for the location and scale parameters and their corresponding ETCIs are well-known. When the ETCI obtained is not the SCI, then the difference in length between the two options is studied. The results can be used in the classroom to obtain the ECTI in a straightforward way. 2. Confidence intervals in normal populations In normal populations, the CIs involving location parameters are based on pivotal quantities that follow a normal distribution when the scale parameters are known, and on pivotal quantities that follow a tdistribution when the scale parameters are unknown. Therefore, taking into consideration that the normal and the tdistributions are symmetric and unimodal, the ETCIs are the SCIs. Example 2.1. CI for the mean of one normal population. Let us consider a population X∼N(µ, σ)(normal distribution of mean µand standard deviation σ). It is well known that the expression t=¯ X−µ S√n, where ¯ Xis the sample mean and Sthe sample standard deviation, is a pivotal quantity for µwhich follows a distribution t(n−1) (distribution twith n−1 1Apdff(x) is unimodal if there exists x∗such that f(x) is non-decreasing for x≤x∗and f(x) is non-increasing for x≥x∗.
110 J. M. Gavilan, F. J. Ortega degrees of freedom). Therefore, the SCI for µat confidence level 1−αis given by the ETCI !¯ X−t1−α/2(n−1) S √n,¯ X+t1−α/2(n−1) S √n", where t1−α/2(n−1) is the quantile of order 1−α/2of the distribution t(n−1). For the particular case of the sample of size n= 10 in Table 1, which has been generated from a normal distribution with µ=0and σ=5using, in software R, the function rnorm() with seed equal to 100, the SCI and ETCI at 95% confidence obtained is (-2.0968, 1.9172) whose length is 4.0140. Figure 1 illustrates that, indeed, this CI is the SCI for µbased on the considered pivot. Table 1: Random sample of size n= 10 generated from a centred normal distribution with σ=5,using in software R, the function rnorm() with seed equal to 100. -2.5109618 0.6576558 -0.3945854 4.4339240 0.5848564 1.5931504 -2.9089534 3.5726636 -4.1262971 -1.7993107 Figure 1: Lengths of the CIs at 95% confidence for µfrom the sample in Table 1 as a function of α1,whereα1∈[0,0.05] and q1is the α1-quantile of the distribution t(n−1) of the pivotal quantity Q, see (1.2)-(1.3). 0.00 0.01 0.02 0.03 0.04 0.05 4.0 4.5 5.0 5.5 6.0 6.5 7.0 With regard to the CIs involving scale parameters in normal populations, the situation is different. These are based on pivotal quantities Qthat follow chi-squared distributions (for one population) and Fdistributions (for two populations). These distributions are unimodal but not symmetrical. Therefore the
A Note on Optimal Intervals in Normal Populations 111 ETCI does not provide the SCI. In order to obtain the SCI based on the pivot Q,q1and q2should be chosen to minimize the length ℓ=q∗ 2−q∗ 1subject to the constraint of maintaining a probability of coverage 1 −α, as given in (1.2). In these two cases, the length of the intervals built on such a pivot has the following structure ℓ=q∗ 2−q∗ 1=k!1 q2−1 q1",(2.1) where kdepends only on the random sample. Therefore, the constrained optimization problem is equivalent to solving the system of nonlinear equations given by (1.2) and the equation q2 1f(q1)=q2 2f(q2) (Ferentinos and Karakostas, 2006). Let us consider the case of one normal population X∼N(µ, σ). To obtain CIs for the variance σ2, the pivot Q=(n−1)S2 σ2is usually utilized, which follows a distribution χ2(n−1) (chi-squared with n−1 degrees of freedom). In this case, the CIs at level 1 −αare given by !(n−1)S2 χ2 1−α2(n−1),(n−1)S2 χ2 α1(n−1)", where χ2 α1(n−1) is the α1-quantile of the distribution χ2(n−1) and α1∈[0,α] with α1+α2=α. As aforementioned, the length of the interval is as in (2.1): specifically, it is given by ℓ=(n−1)S2!1 χ2 α1(n−1) −1 χ2 1−α2(n−1)", which can be minimized and tabulated for each nand α. This table could be used in a classroom to obtain SCIs for given samples and for its comparison with the corresponding ETCIs. Table 2 shows the values of α1, in up to four decimal places, to be chosen in order to obtain the SCIs at 95% confidence for several sample sizes. Table 2: Optimal values of α1to obtain the SCI at 95% confidence for the variance of a normal population according to the sample size, and ratios of the lengths of the corresponding ETCIs and SCIs. n3 4 5 6 7 8 9 10 11 12 α1.0499 .0499 .0497 .0494 .0491 .0488 .0484 .0480 .0476 .0473 ℓETCI/ℓSCI 2.0192 1.6175 1.4472 1.3525 1.2918 1.2493 1.2179 1.1936 1.1743 1.1585 n13 14 15 16 17 18 19 20 21 22 α1.0469 .0465 .0462 .0458 .0455 .0452 .0449 .0446 .0443 .0441 ℓETCI/ℓSCI 1.1454 1.1343 1.1248 1.1165 1.1093 1.1030 1.0973 1.0922 1.0877 1.0835
112 J. M. Gavilan, F. J. Ortega It is important to observe that the ratio between the two lengths, ℓETCI/ℓSCI, does not depend on the values of the sample but only on the sample size and the level of confidence. Therefore, this quantity can also be obtained and tabulated. In Table 2, such ratios are offered for several sample sizes for CIs at 95% confidence. To visualize the results in this setting, in Figure 2, the optimal values α1and the ratios ℓETCI/ℓSCI are represented as a function of the sample size n. Let us consider a specific example. Figure 2: Optimal values α1(left-hand side) and ratios ℓETCI/ℓSCI (right-hand side) corresponding to the CIs at 95% confidence for the variance of a normal population as a function of the sample size n. 20 40 60 80 100 0.035 0.040 0.045 0.050 20 40 60 80 100 1.0 1.2 1.4 1.6 1.8 2.0 Example 2.2. CIs for the variance of one normal population. Let us use the sample in Table 1 and the values in Table 2 to obtain the SCI at 95% confidence for the variance σ2of the considered normal population. In this particular case in which the sample size is n= 10, the SCI is obtained according to the values in Table 2 by taking α1=0.0480, which is very different from the equal-tails case, α1=0.0250. The SCI obtained is (2.7188,21.5770), whose length is 18.8582, while the ETCI is (3.7241,26.2341), whose length is 22.5100 (19.36% greater than the length of the SCI as established in Table 2). Figure 3 shows the lengths obtained in this example for the values of α1. Therefore the difference between the length of the SCI and the ETCI can be very significant, and hence the SCI should always be provided. As a matter of fact, knowing that the pivot in this case is Q=nS2 σ2∼χ2(n−1), it is possible to obtain the expected difference between the lengths of the SCI and the ETCI
A Note on Optimal Intervals in Normal Populations 113 as follows: E(ℓSCI −ℓETCI)=E#(n−1)S2$%& 1 χ2 α∗ 1(n−1) −1 χ2 1−α∗ 2(n−1)' −&1 χ2 α/2(n−1) −1 χ2 1−α/2(n−1)'( =(n−1)σ2%& 1 χ2 α∗ 1(n−1) −1 χ2 1−α∗ 2(n−1)' −&1 χ2 α/2(n−1) −1 χ2 1−α/2(n−1)'(, where α∗ 1is the value to be chosen to obtain the SCI. From this expression, it is clear that the greater σ2is the greater the expected difference between the two CIs becomes. On the other hand, by taking into consideration the Central Limit Theorem, it can be stated that as the sample size ngrows, the differences between the two intervals decrease, since the considered pivot (a chi-squared distribution with n−1 degrees of freedom) approaches a normal distribution, which is symmetric and unimodal. This is also seen from the ratio ℓETCI/ℓSCI shown in Table 2 and Figure 2. Therefore, for small sample sizes with great dispersion, significant differences between the lengths of the SCI and the ETCI are expected. Figure 3: Lengths of the CIs for σ2at 95% confidence from the sample in Table 1 as a function of α1. 0.00 0.01 0.02 0.03 0.04 0.05 20 40 60 80 100 A very similar analysis can be carried out when an CI for the ratio of the variances of two independent normal distributions X1∼N(µ1,σ1) and X2∼
114 J. M. Gavilan, F. J. Ortega Table 3: Optimal values of α1to obtain the SCI at 95% confidence for the ratio of variances of two normal populations according to the sample sizes. n1\n25 6 7 8 9 10 11 12 13 5 .0500 .0499 .0499 .0499 .0498 .0498 .0498 .0498 .0498 6 .0499 .0499 .0498 .0498 .0497 .0497 .0496 .0496 .0496 7 .0499 .0498 .0497 .0496 .0495 .0495 .0494 .0494 .0493 8 .0499 .0498 .0496 .0495 .0494 .0493 .0492 .0491 .0491 9 .0499 .0497 .0495 .0493 .0492 .0491 .0490 .0489 .0488 10 .0499 .0496 .0494 .0492 .0490 .0489 .0487 .0486 .0486 11 .0498 .0496 .0493 .0490 .0488 .0486 .0485 .0484 .0483 12 .0498 .0495 .0492 .0489 .0486 .0485 .0483 .0482 .0481 13 .0498 .0494 .0491 .0487 .0485 .0483 .0481 .0479 .0478 N(µ2,σ2) is obtained from two samples of sizes n1and n2respectively. In this case, the pivot used is S2 1/S2 2 σ2 1/σ2 2∼F(n1−1,n 2−1) , where F(n1−1,n 2−1) is a distribution Fwith n1−1 and n2−1 degrees of freedom. The CIs at a level of confidence of 1 −αare given by !S2 1/S2 2 F1−α2(n1−1,n 2−1),S2 1/S2 2 Fα1(n1−1,n 2−1)", where S2 1and S2 2are the sample variances. The length of these intervals are again as in (2.1); specifically they are as follows: ℓ=S2 1 S2 2!1 Fα1(n1−1,n 2−1) −1 F1−α2(n1−1,n 2−1)", which can be minimized and tabulated for fixed sample sizes and levels of confidence. Table 3 shows, in up to four decimal places, the choices of α1to obtain the SCI at 95% confidence for several sample sizes. To visualize the results in this setting, in Figure 4, the optimal values α1are represented for several sample sizes n1and n2. It is easy to verify, by taking into account the distribution of the pivot, that the greater σ2 1/σ2 2is the greater the expected difference between the lengths of the SCI and the ETCI becomes. Therefore, the greatest differences are expected for small sample sizes with a high ratio between the two population variances. Let us finish this Section with a numerical example.
A Note on Optimal Intervals in Normal Populations 115 Example 2.3. CIs for the ratio of variances of two normal populations. Let us consider the sample with n1= 10 in Table 1 from a normal population with mean 0 and variance 25 and a new sample with n2= 10 from a normal population with mean 0 and variance 1, obtained from software, R using the function rnorm() with seed equal to 50. This new sample is shown in Table 4. Figure 4: Optimal values α1to obtain the SCI at 95% confidence for the ratio of variances of two normal populations for the sample sizes n2∈{5,25,50,75,100} as a function of the sample size n1. 20 40 60 80 100 0.035 0.040 0.045 0.050 n2=5 n2=25 n2=50 n2=75 n2=100 Table 4: Random sample of size n2= 10 generated from a centred normal distribution with σ2= 1, using in software R, the function rnorm() with seed equal to 50. 0.54966989 -0.84160374 0.03299794 0.52414971 -1.72760411 -0.27786453 0.36082844 -0.59091244 0.97559055 -1.44574995 According to the results in Table 3, the SCI at 95% confidence for the ratio of the two population variances is obtained with α1=0.0489.Thisinterval is (0.9879,31.2075) whose length is 30.2196 and the ETCI is (2.4191,39.2105) whose length is 36.7914 (21.75% greater than the SCI), which again proves that the SCI should always be provided. Figure 5 shows the lengths of all the intervals at 95% confidence with these two samples and based on the considered pivot. Again, it should be borne in mind that, in general, the ratio of the two lengths ℓETCI/ℓSCI does not depend on the values of the sample, but only on the sample sizes and the level of confidence. Therefore, this quantity could also be obtained
116 J. M. Gavilan, F. J. Ortega and tabulated. For this specific example, such a ratio is given by ℓETCI/ℓSCI = 1 Fα∗ 1(n1−1,n 2−1) −1 F1−α∗ 2(n1−1,n 2−1) 1 Fα 2 (n1−1,n 2−1) −1 F1− α 2 (n1−1,n 2−1) = = 1 F0.0489 (9,9) −1 F0.9989 (9,9) 1 F0.025 (9,9) −1 F0.975 (9,9) =1.2175 as obtained previously. Figure 5: Lengths of the CIs at 95% confidence for the ratio of the variances of the two considered normal populations, obtained from the samples in Tables 1 and 4, as a function of α1. 0.00 0.01 0.02 0.03 0.04 0.05 40 60 80 120 160 3. Conclusions In this paper, the task of building SCIs in one and two normal populations is considered. For the case of the location parameter, the SCIs are the ETCIs since the distributions of the pivots utilized are symmetric and unimodal. With regard to the CIs involving the scale parameters, the ETCIs do not provide the SCIs, and, in order to obtain the SCIs, constrained optimization problems or nonlinear systems of equations have to be solved. It is shown that significant differences between the lengths of the SCIs and the corresponding ETCIs can be observed; in fact, the greatest expected differences in one population between the SCIs and the corresponding ETCIs are obtained for small sample sizes from