text
stringlengths
270
6.81k
ite. Let f be a density on the interval 230 Section 4.5: Monte Carlo Approximations a b, such that f x algorithm for generating X1 X2 0 for every x a b and suppose we have a convenient i.i.d. with distribution given by f. We have that b a g x dx b a g x f x f x dx E g X f X when X is distributed with density f. So we can estimate b a g x dx by Mn 1 n n i 1 g Xi f Xi 1 n n i 1 Ti g Xi f Xi. In effect, this is what we did in Example 4.5.3 ( f is the where Ti Uniform[0 1] density), in Example 4.5.4 ( f is the Exponential 25 density), and in Example 4.5.6 ( f is the N 0 1 density). But note that there are many other possible choices. In Example 4.5.3, we could have taken f to be any beta density. In Example 4.5.4, we could have taken f to be any gamma density, and similarly in Example 4.5.6. Most statistical computer packages have commands for generating from these distributions. In a given problem, what is the best one to use? In such a case, we would naturally use the algorithm that was most efficient. For the algorithms we have been discussing here, this means that if, based on a sample of n algorithm 1 leads to an estimate with standard error n, and algorithm 2 n, then algorithm 1 is more efficient than leads to an estimate with standard error algorithm 2 whenever 2 Naturally, we would prefer algorithm 1 because the intervals (4.4.3) or (4.4.4) will tend to be shorter for algorithm 1 for the same sample size. Actually, a more refined comparison of efficiency would also take into account the total amount of computer time used by each algorithm, but we will ignore this aspect of the problem here. See Problem 4.5.21 for more discussion of efficiency and the choice of algorithm in the context of the integration problem. 1 1 2 Summary of Section 4.5 An unknown quantity can be approximately computed using a Monte Carlo ap­ proximation, whereby independent replications of a random experiment (usually on a computer) are averaged to estimate the quantity. Monte Carlo approximations
can be used to approximate complicated sums, in­ tegrals, and sampling distributions, all by choosing the random experiment ap­ propriately. EXERCISES 4.5.1 Describe a Monte Carlo approximation of cos2 x e x 2 2 dx 4.5.2 Describe a Monte Carlo approximation of the Binomial m 2 3 distribution.) 4.5.3 Describe a Monte Carlo approximation of 0 e 5x 14x 2 the Exponential 5 distribution.). (Hint: Remember dx (Hint: Remember Chapter 4: Sampling Distributions and Limits 231 4.5.4 Suppose X1 X2 Consider Mn is unknown., where Suppose we know that 10. How large must n be to guarantee that Mn will be within 0 1 of the true value are i.i.d. with distribution Poisson Xn n as an estimate of X2 X1 of with virtual certainty, i.e., when is 3 standard deviations smaller than 0 1? 4.5.5 Describe a Monte Carlo approximation of have available an algorithm for generating from the Poisson 5 distribution. j 0 sin j 2 5 j j!. Assume you 10 0 e x 4 2 n. 400 i 1 Xi dx (Hint: Remember the X400. Suppose we compute that the sample average is M400 15,400. In terms of this: 4.5.6 Describe a Monte Carlo approximation of Uniform[0 10] distribution.) 4.5.7 Suppose we repeat a certain experiment 2000 times and obtain a sample average of 5 and a standard error of 17. In terms of this, specify an interval that is virtually certain to contain the experiment’s (unknown) true mean. 4.5.8 Suppose we repeat a certain experiment 400 times and get i.i.d. response values 6 and X1 X2 furthermore that (a) Compute the standard error (b) Specify an interval that is virtually certain to contain the (unknown) true mean the Xi. 1 4.5.9 Suppose a certain experiment has probability but is unknown. Suppose we repeat the experiment 1000 times, of which 400 are successes and 600 are failures. Compute an interval of values that are virtually certain to contain. 4.5.10 Suppose a certain experiment has probability but of successes. (a) In terms of (b) For what value of (c) What is this largest possible value of Var Y? (d) Compute the smallest integer
n such that we can be sure that Var Y regardless of the value of 4.5.11 Suppose X and Y are random variables with joint density given by f X Y x y C g x y for 0 stant C, where 1 is unknown. Suppose we repeat the experiment n times, and let Y be the fraction 0 for other x y), for appropriate con­ is Var Y the largest? of success, where 0 of success, where 0 1 (with f X Y x y, what is Var Y? 0 01, x y of. g x y x 2 y3 sin x y cos x y exp x 2 y (a) Explain why dx dy dx dy 1 0 g x y dx dy (b) Describe a Monte Carlo algorithm to approximately compute E X. 4.5.12 Let g x y (a) Prove that I (b) Use part (a) to describe a Monte Carlo algorithm to approximately compute I. 4 0 g x y dy dx. 20 E[g X Y ] where X Uniform[0 5] and Y Uniform[0 4]. x y, and consider the integral I cos 5 0 232 Section 4.5: Monte Carlo Approximations 4.5.13 Consider the integral J 1 0 0 h x y dy d x, where h x y e y2 cos x y E[eY h X Y ], where X Uniform[0 1] and Y (a) Prove that J (b) Use part (a) to describe a Monte Carlo algorithm to approximately compute J. (c) If X Uniform[0 1] and Y Exponential 5, then prove that Exponential 1. J 1 5 E[e5Y h X Y ] (d) Use part (c) to describe a Monte Carlo algorithm to approximately compute J. (e) Explain how you might use a computer to determine which is better, the algorithm in part (b) or the algorithm in part (d). COMPUTER EXERCISES 1 0 cos x 3 sin x 4 dx based on a 105, if possible). Assess the error in the approximation. 4.5.14 Use a Monte Carlo algorithm to approximate large sample (take n 4.5.15 Use a Monte Carlo algorithm to approximate 0 25 cos x 4 e 25x dx based on a large sample (take n 4.5.16 Use a Monte Carlo algorithm to approximate large sample (take n 4.5.17 Suppose X 3X the approximation
. 105, if possible). Assess the error in the approximation. N 0 1. Use a Monte Carlo algorithm to approximate P X 2 105, if possible). Assess the error in the approximation. 105, if possible). Assess the error in 0 based on a large sample (take n 3 55 j based on a j 0 j 2 2 PROBLEMS where 1 4 for all x 2 Suppose we know, however, that x [0 1] ) are i.i.d. with unknown mean is unknown. Determine 4.5.18 Suppose that X1 X2 are i.i.d. Bernoulli of a lower bound on n so that the probability that the estimate Mn will be within the unknown value of is about 0.9974. This allows us to run simulations with high confidence that the error in the approximation quoted is less than some prescribed value. (Hint: Use the fact that x 1 4.5.19 Suppose that X1 X2 and unknown variance 2 0 is a known value. Determine of a lower bound on n so that the probability that the estimate Mn will be within the unknown value of is about 0 9974. This allows us to run simulations with high confidence that the error in the approximation quoted is less than some prescribed value. 4.5.20 Suppose X1 X2 known, and consider Zn order statistics). (a) Prove that E Zn are i.i.d. with distribution Uniform[0 n 1 n is un­ (see Section 2.8.4 on 1 X n as an estimate of and compute Var Zn 2 0, where ], where 2 Chapter 4: Sampling Distributions and Limits 233 (b) Use Chebyshev’s inequality to show that Zn converges in probability to (c) Show that E 2Mn as estimators of Which would you use to estimate and compare Mn and Zn with respect to their efficiencies and why? b 4.5.21 (Importance sampling) Suppose we want to approximate the integral a g x dx, where we assume this integral is finite. Let f be a density on the interval a b such that f x a b and is such that we have a convenient algorithm for generating X1 X2 (a) Prove that i.i.d. with distribution given by f 0 for every x Mn f 1 n
n i 1 a s g Xi f Xi b a g x dx (We refer to f as an importance sampler and note this shows that every f satisfying the above conditions, provides a consistent estimator Mn f of (b) Prove that b a g x dx ) Var Mn f 1 n b g2 x f x a dx 2 g x dx b a (c) Suppose that g x tance sampling with respect to f leads to the estimator h x f x, where f is as described above. Show that impor­ Mn f 1 n n i 1 h Xi f (d) Show that if there exists c such that g x Var Mn (e) Determine the standard error of Mn f assess the error in the approximation Mn f when Var Mn f c f x for all x a b then and indicate how you would use this to COMPUTER PROBLEMS Y 3 3, where X Gamma 1 1 based on a large sample (take n 4.5.22 Use a Monte Carlo algorithm to approximate P X 3 105, N 1 2 independently of Y if possible). Assess the error in the approximation How large does n have to be to guarantee the estimate is within 0 01 of the true value with virtual certainty? (Hint: Problem 4.5.18.) 4.5.23 Use a Monte Carlo algorithm to approximate E X 3 independently of Y ble). Assess the error in the approximation. 4.5.24 For the integral of Exercise 4.5.3, compare the efficiencies of the algorithm based on generating from an Exponential 5 distribution with that based on generating from an N 0 1 7 distribution. Gamma 1 1 based on a large sample (take n N 1 2 105, if possi­ Y 3, where X 234 Section 4.6: Normal Distribution Theory CHALLENGES 4.5.25 (Buffon’s needle) Suppose you drop a needle at random onto a large sheet of lined paper. Assume the distance between the lines is exactly equal to the length of the needle. (a) Prove that the probability that the needle lands touching a line is equal to 2. (Hint: Let D be the distance from the higher end of the needle to the line just below it, and let A be the angle the needle makes with that line. Then what are the distributions of D and A? Under what conditions on D and A will the needle be touching a line?) (b
) Explain how this experiment could be used to obtain a Monte Carlo approximation for the value of 4.5.26 (Optimal importance sampling) Consider importance sampling as described in Problem 4.5.21. (a) Prove that Var Mn f is minimized by taking. f x g x b a g x dx a b. Calculate the minimum variance and show that the minimum variance is 0 when g x 0 for all x (b) Why is this optimal importance sampler typically not feasible? (The optimal im­ portance sampler does indicate, however, that in our search for an efficient importance sampler, we look for an f that is large when g is large and small when g is small.) DISCUSSION TOPICS 4.5.27 An integral like 0 x 2 cos x 2 e x dx can be approximately computed using a numerical integration computer package (e.g., using Simpson’s rule). What are some advantages and disadvantages of using a Monte Carlo approximation instead of a nu­ merical integration package? 4.5.28 Carry out the Buffon’s needle Monte Carlo experiment, described in Challenge 4.5.25, by repeating the experiment at least 20 times. Present the estimate of so? What could be done to make the obtained. How close is it to the true value of estimate more accurate? 4.6 Normal Distribution Theory Because of the central limit theorem (Theorem 4.4.3), the normal distribution plays an extremely important role in statistical theory. For this reason, we shall consider a number of important properties and distributions related to the normal distribution. These properties and distributions will be very important for the statistical theory in later chapters of this book. We already know that if X1 N 1 d c2 2 (see Exercise 2.6.3) and X1 2 1 independent of X2 X2 N 2 N 1 2 2, then 2 2 1 cX1 d N c 1 Chapter 4: Sampling Distributions and Limits 235 (see Problem 2.9.14). Combining these facts and using induction, we have the 2 2 following result. Theorem 4.6.1 Suppose Xi independent random variables. Let Y b. Then N i 2 i for i i ai Xi 1 2 n and that they are b for some constants ai and Y N ai i b i a2 i 2 i i This immediately implies the following. N Corollary 4.6.1 Suppose
Xi independent random variables. If X 2 X1 for i 1 2 n and that they are Xn n, then X N 2 n A more subtle property of normal distributions is the following. Theorem 4.6.2 Suppose Xi are independent. Let U and bi. Then Cov U V if U and V are independent. N i 2 i for i n i 1 ai Xi and V 1 2 n and also that the Xi n i 1 bi Xi for some constants ai 0 if and only i ai bi 2 i. Furthermore, Cov U V PROOF The formula for Cov U V follows immediately from the linearity of co­ variance (Theorem 3.3.2) because we have Cov U V Cov ai Xi b j X j ai b j Cov Xi ai bi Cov Xi Xi n i 1 ai bi Var Xi n i 1 ai bi 2 i 0 for i (note that Cov Xi X j independent, then we must have Cov U V It remains to prove that, if Cov U V 0 by Corollary 3.3.2. 0, then U and V are independent. This involves a two­dimensional change of variable, as discussed in the advanced Section 2.9.2, so we refer the reader to Section 4.7 for this part of the proof. j, by independence). Also, if U and V are Theorem 4.6.2 says that, for the special case of linear combinations of independent normal distributions, if Cov U V 0 then U and V are independent. However, it is important to remember that this property is not true in general, and there are random variables X and Y such that Cov X Y 0 even though X and Y are not independent (see Example 3.3.10). Furthermore, this property is not even true of normal distribu­ tions in general (see Problem 4.6.13). 236 Section 4.6: Normal Distribution Theory Note that using linear algebra, we can write the equations U n i 1 bi Xi of Theorem 4.6.2 in matrix form as V n i 1 ai Xi and U V A X1 X2 Xn A a1 b1 a2 b2 an bn where (4.6.1) i 1 for all i, we have that Cov U V Furthermore, the rows of A are orthogonal if and only if 0. Now, in the case 1 for all i, then Theorem 4.
6.2 can be interpreted as saying that if U and V are given by (4.6.1), then U and V are independent if and only if the rows of A are orthogonal. Linear algebra is used extensively in more advanced treatments of these ideas. i ai bi i ai bi. Hence, if i 4.6.1 The Chi­Squared Distribution We now introduce another distribution, related to the normal distribution. Definition 4.6.1 The chi­squared distribution with n degrees of freedom (or chi­ 2 n ) is the distribution of the random variable squared n or where X1 Xn are i.i.d., each with the standard normal distribution N 0 1. Most statistical packages have built­in routines for the evaluation of chi­squared prob­ abilities (also see Table D.3 in Appendix D). One property of the chi­squared distribution is easy. Theorem 4.6.3 If Z 2 n, then E Z n. PROOF Write Z E Xi X 2 1. It follows by linearity that, where Xi are i.i.d. n. 1 1 N 0 1. Then The density function of the chi­squared distribution is a bit harder to obtain. We begin with the case n 1. Theorem 4.6.4 Let Z 2 1. Then 2e z 2 for z 1 2 0, with f Z z ). 0 for z 0. That is, Z Gamma 1 2 1 2 (using Chapter 4: Sampling Distributions and Limits 237 PROOF Because Z compute that, for z 0, 2 1, we can write Z X 2 where X N 0 1. We then z f Z s ds P Z z P X 2 z P But because X rewrite this as N 0 1 with density function s z 2 X z 1 2 e s2 2 we can z f Z s ds z z s ds z s ds z s ds Because this is true for all z fundamental theorem of calculus and the chain rule) to obtain 0, we can differentiate with respect to z (using the as claimed. In Figure 4.6.1, we have plotted the 2 1 density. Note that the density becomes infinite at 0. 4 f 3 2 1 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 z Figure 4.6.
1: Plot of the 2 1 density. Theorem 4.6.5 Let Z 2 n. Then Z Gamma n 2 1 2. That is, f Z z 1 2n 2 n 2 z n 2 1e z 2 for z 0, with f Z z 0 for z 0. 238 Section 4.6: Normal Distribution Theory 2 n, we can write Z PROOF Because Z are i.i.d. N 0 1. But this means that X 2 we have X 2 i i.i.d. Gamma 1 2 1 2 for i independent random variables, each having distribution Gamma, where the Xi 1 2 1. Hence, by Theorem 4.6.4, n. Therefore, Z is the sum of n i are i.i.d. 1 2 X 2 2 Now by Appendix C (see Problem 3.4.20), the moment­generating function of a Gamma 1 2 and has moment­generating function given by random variable is given by m s 1 2 and applying Theorem 3.4.5, the variable Y s Putting for mY We recognize this as the moment­generating function of the Gamma n 2 for s 1 2 distribution. Therefore, by Theorem 3.4.6, we have that X 2 1 Gamma n 2 1 2, as claimed. X 2 2 X 2 n This result can also be obtained using Problem 2.9.15 and induction. Note that the 2 2 density is the same as the Exponential 2 density. In Figure 2 are asymmetric and 4.6.2, we have plotted several skewed to the right. As the degrees of freedom increase, the central mass of probability moves to the right. 2 densities. Observe that the f 0.20 0.15 0.10 0.05 0.00 0 2 4 6 8 10 12 14 16 18 20 z Figure 4.6.2: Plot of the 2 3 (solid line) and the 2 7 (dashed line density functions. One application of the chi­squared distribution is the following. Theorem 4.6.6 Let X1 Xn be i.i.d. N X Then n 1 S2 1 n 2 X1 Xn and S2 2. Put n 1 n 1 i 1 Xi X 2 2 n 1 and furthermore, S2 and X are independent. Chapter 4: Sampling Distributions and Limits 239 PROOF See Section 4.7 for the proof of this
result. Because the 2 n 1 distribution has mean n 1, we obtain the following. Corollary 4.6.2 E S2 2. PROOF Theorems 4.6.6 and 4.6.3 imply that E n E S2 2. 1 S2 2 n 1 and that Theorem 4.6.6 will find extensive use in Chapter 6. For example, this result, to­ gether with Corollary 4.6.1, gives us the joint sampling distribution of the sample mean X and the sample variance S2 when we are sampling from an N 2 distribution. If then X is a natural estimator of this quantity and, similarly, S2 is a we do not know 1 in S2 natural estimator of rather than n precisely because we want E S2 2 to hold, as in Corollary 4.6.2. Actually, this property does not depend on sampling from a normal distribution. It can 2 be shown that anytime X1 then E S2 2 when it is unknown. Interestingly, we divide by n Xn is a sample from a distribution with variance 2 4.6.2 The t Distribution The t distribution also has many statistical applications. Definition 4.6.2 The t distribution with n degrees of freedom (or Student n t n ), is the distribution of the random variable or where X X1 (Equivalently, Z Xn are i.i.d., each with the standard normal distribution N 0 1. X Y n, where Y 2 n.) Most statistical packages have built­in routines for the evaluation of t n probabilities (also see Table D.4 in Appendix D). The density of the t n distribution is given by the following result. Theorem 4.6.7 Let U t n. Then fU u n 1 2 n 2 1 u2 n n 1 2 1 n for all u R1. PROOF For the proof of this result, see Section 4.7. The following result shows that, when n is large, the t n distribution is very similar to the N 0 1 distribution. 240 Section 4.6: Normal Distribution Theory Theorem 4.6.8 As n standard normal distribution., the t n distribution converges in distribution to a PROOF Let Z1 numbers, Z 2 1 distribution of, by the strong law of large Zn Z be i.i.d. N 0 1 As n n
n converges with probability 1 to the constant 1. Hence, the 4.6.2) converges to the distribution of Z, which is the standard normal distribution. By Defi­ nition 4.6.2, we have that (4.6.2) is distributed t n In Figure 4.6.3, we have plotted several t densities. Notice that the densities of the t distributions are symmetric about 0 and look like the standard normal density. 0.4 f 0.3 0.2 0.1 ­10 ­8 ­6 ­4 ­2 0 2 4 6 8 10 u Figure 4.6.3: Plot of the t 1 (solid line) and the t 30 (dashed line density functions. The t n distribution has longer tails than the N 0 1 distribution. For example, the t 1 distribution (also known as the Cauchy distribution) has 0.9366 of its probability 10 10 whereas the N 0 1 distribution has all of its probability in the interval there (at least to four decimal places). The t 30 and the N 0 1 densities are very similar. 4.6.3 The F Distribution Finally, we consider the F distribution. Chapter 4: Sampling Distributions and Limits 241 Definition 4.6.3 The F distribution with m and n degrees of freedom (or F m n ) is the distribution of the random variable where X1 (Equivalently, Z Xm Y1 Yn are i.i.d., each with the standard normal distribution. 2 m and Y 2 n.) X m Y n, where X Most statistical packages have built­in routines for the evaluation of F m n probabil­ ities (also see Table D.5 in Appendix D). The density of the F m n distribution is given by the following result. Theorem 4.6.9 Let U F m n. Then fU for u 0, with fU u 0 for u 0. PROOF For the proof of this result, see Section 4.7. In Figure 4.6.4, we have plotted several F m n densities. Notice that these densities are skewed to the right. f 0.6 0.4 0.2 0. 10 u Figure 4.6.4: Plot of the F 2 1 (solid line) and the F 3 10 (dashed line) density functions. The following results are useful when it is
necessary to carry out computations with the F m n distribution. Theorem 4.6.10 If Z F m n then 1 Z F n m 242 Section 4.6: Normal Distribution Theory PROOF Using Definition 4.6.3, we have and the result is immediate from the definition. Therefore, if Z and P 1 Z F m n, then is the cdf of the F n m distribution evaluated at 1 z. In many statistical applications, n can be very large. The following result then gives a useful approximation for that case. Theorem 4.6.11 If Zn distribution as n. F m n then m Zn converges in distribution to a 2 m PROOF Using Definition 4.6.3, we have By Definition 4.6.1, X 2 1 strong law of large numbers implies that Y 2 1 surely to 1. This establishes the result. X 2 m 2 m By Theorem 4.6.3, E Y 2 i 1 so the n converges almost Y 2 n Y 2 2 Finally, Definitions 4.6.2 and 4.6.3 immediately give the following result. Theorem 4.6.12 If Z t n then Z 2 F 1 n Summary of Section 4.6 Linear combinations of independent normal random variables are also normal, with appropriate mean and variance. Two linear combinations of the same collection of independent normal random variables are independent if and only if their covariance equals 0. The chi­squared distribution with n degrees of freedom is the distribution corre­ sponding to a sum of squares of n i.i.d. standard normal random variables. It has mean n. It is equal to the Gamma n 2 1 2 distribution. The t distribution with n degrees of freedom is the distribution corresponding to a standard normal random variable, divided by the square­root of 1 n times an independent chi­squared random variable with n degrees of freedom. Its density function was presented. As n, it converges in distribution to a standard normal distribution. The F distribution with m and n degrees of freedom is the distribution corre­ sponding to m n times a chi­squared distribution with m degrees of freedom, divided by an independent chi­squared distribution with n degrees of freedom. Chapter 4: Sampling Distributions and Limits 243 Its density function was presented. If t has a
t n distribution, then t 2 is distrib­ uted F 1 n. EXERCISES N 8 52 be independent. Let U X1 5X2 N 7 2 be independent. N 3 22 and X2 N 3 5 and Y 6X1 C X2, where C is a constant. 4.6.1 Let X1 and V (a) What are the distributions of U and V? (b) What value of C makes U and V be independent? 4.6.2 Let X (a) What is the distribution of Z 4X (b) What is the covariance of X and Z? 4.6.3 Let X 0 C2 C3 4.6.4 Let X 1. 4.6.5 Let X 4.6.6 Let X1 X2 that 0 C4 C5 so that C1 X C2 N 3 5 and Y 2 n and Y 2 n and Y 2 C3 Y Y 3? 2 n N 7 2 be independent. Find values of C1 2 C4 N 0 1 be independent. Prove that X 2 C5. Y 2 2 m be independent. Prove that X Y 2 n m. X4n be i.i.d. with distribution N 0 1. Find a value of C such 4n F n 3n Xn 1 be i.i.d. with distribution N 0 1. Find a value of C such C X 2 2 X1.6.7 Let X1 X2 that 4.6.8 Let X C4 C5 C6 so that N 3 5 and Y N 7 2 be independent. Find values of C1 C2 C3 C1 X C2 C3 Y C4 2 C5 t C6 4.6.9 Let X C4 C5 C6 C7 so that N 3 5 and Y N 7 2 be independent. Find values of C1 C2 C3 C1 X C2 C3 Y C4 C5 F C6 C7 X100 be independent, each with the standard normal distribu­ 4.6.10 Let X1 X2 tion. (a) Compute the distribution of X 2 1. (b) Compute the distribution of X 2 3 (c) Compute the distribution of X10 (d) Compute the distribution of 3X 2 10 X 2 5. [X 2 20 [X 2 20 X 2 30 X 2 30 X 2
40] 3. X 2 40]. 244 Section 4.6: Normal Distribution Theory (e) Compute the distribution of 30 70 X 2 1 X 2 71 X 2 2 X 2 72 X 2 70 X 2 100 4.6.11 Let X1 X2 1 61 X1 X2 X61 be independent, each distributed as N X61 and 2. Set X S2 1 60 X1 X 2 X2 X 2 X61 X 2 y K X 0 05. 2 S2 has S2 has a t as usual. (a) For what values of K and m is it true that the quantity Y distribution with m degrees of freedom? (b) With K as in part (a), find y such that P Y (c) For what values of a and b and c is it true that the quantity W a X an F distribution with b and c degrees of freedom? (d) For those values of a and b and c, find a quantity 4.6.12 Suppose the core temperature (in degrees celsius, when used intensively) of the latest Dell desktop computer is normally distributed with mean 40 and standard deviation 5, while for the latest Compaq it is normally distributed with mean 45 and standard deviation 8. Suppose we measure the Dell temperature 20 times (on separate days) and obtain measurements D1 D2 D20, and we also measure the Compaq temperature 30 times and obtain measurements C1 C2 (a) Compute the distribution of D (b) Compute the distribution of C (c) Compute the distribution of Z (d) Compute P C (e) Let U D20 D 2. What is P U 633 25? D1 C1 C D. D. D1 D 2 D20 20. C30 30. D2 D 2 so that P W 0 05. C30. PROBLEMS 1 2. Assume X and Y 1 1 0, and let P Y XY. 4.6.13 Let X are independent. Let Z (a) Prove that Z (b) Prove that Cov X Z (c) Prove directly that X and Z are not independent. (d) Why does this not contradict Theorem 4.6.2? 4.6.14 Let Z that the t n distribution is symmetric about 0. 4.6.15 Let Xn with probability 1. 4.6.16 (The general chi­squared distribution
) Prove that for t n. Prove that P Z F n 2n for n 1 2 3 P Z x. Prove that Xn x for x f z 1 2 2 2 z 2 1e z 2 R1, namely, prove 1 in probability and 0 the function Chapter 4: Sampling Distributions and Limits 245 defines a probability distribution on 0 distribution, i.e., it generalizes the distribution in Section 4.6.2 by allowing the degrees of freedom to be an arbitrary positive real number. (Hint: The distribution is the same as a Gamma 4.6.17 (MV) (The general t distribution) Prove that for This distribution is known as the 2 1 2 distribution.) 0 the function 2 2 f u defines a probability distribution on 1 2 2 U u2 1 1 2 1 by showing that the random variable X Y N 0 1 independent of Y, as in Problem 4.6.16. has this density when X This distribution is known as the t distribution, i.e., it generalizes the distribution in Section 4.6.3 by allowing the degrees of freedom to be an arbitrary positive real number. (Hint: The proof is virtually identical to that of Theorem 4.6.7.) 4.6.18 (MV) (The general F distribution) Prove that for 0 the function defines a probability distribution on 0 by showing that the random variable U X Y 2 2 independent of Y as in Problem has this density whenever X 4.6.16. This distribution is known as the F distribution, i.e., it generalizes the distribution in Section 4.6.4 by allowing the numerator and denominator degrees of freedom to be arbitrary positive real numbers. (Hint: The proof is virtually identical to that of Theorem 4.6.9). 1 then 4.6.19 Prove that when X E X 2. You can assume the existence of these integrals — see Challenge 4.6.21. (Hint: To evaluate the second moment, use Y as defined in Problem 4.6.17, and as defined in Problem 4.6.18.) 0 Further prove that when 2, Var X F 1 X 2 t 4.6.20 Prove that when X 2 2 2 Var X F then E X 2 2 4 when 4. 2 when 2 and CHALLENG
ES 4.6.21 Following Problem 4.6.19, prove that the mean of X does not exist whenever 1 1. Further prove that the variance of X does not exist whenever 0 0 and is infinite when 1 2. 4.6.22 Prove the identity (4.7.1) in Section 4.7, which arises as part of the proof of Theorem 4.6.6. 246 Section 4.7: Further Proofs (Advanced) 4.7 Further Proofs (Advanced) Proof of Theorem 4.3.1 Z with probability 1. Then Zn be random variables. Suppose We want to prove the following result. Let Z Z1 Z2 Zn Z in probability. That is, if a sequence of random variables converges almost surely, then it converges in probability to the same limit. Assume P Zn Z 1. Fix 0, and let An s : Zm Z n. Then An is a decreasing sequence of events. Furthermore, if s m then Zn s Z s as n. Hence, P n 1 An P Zn Z 0 for some n 1 An, 0 Hence, 0, we By continuity of probabilities, we have limn P Zn Z see that Zn P An Z in probability. 0 as n Proof of Theorem 4.4.1 P An P n 1 An. Because this is true for any We show that if Xn Suppose Xn P Xn Choose any limn x P X, then Xn D X. X in probability and that P X x 0. We wish to show that P X x. 0. Now, if Xn x then we must have either X x or X Xn. Hence, by subadditivity, P Xn x P X x P X Xn Replacing x by x in this equation, we see also that P X x P Xn x P X Xn Rearranging and combining these two inequalities, we have P X x P X Xn P Xn x P X x P X Xn This is the key. We next let n This means that limn P X. x We then let. Because Xn X in probability, we know that lim n P X Xn 0 P Xn x is “sandwiched” between P X x and 0. By continuity of probabilities, P X x lim 0 P X x and lim 0 P X x P X x This means that
limn x. P Xn x is “sandwiched” between P X x and P X But because P X P Xn x limn x P X 0, we must have P X x, as required. x P X x. Hence, Chapter 4: Sampling Distributions and Limits 247 Proof of Theorem 4.4.3 (The central limit theorem) We must prove the following. LetX1 X2 variance N 0 1. Set Sn 2. Let Z X1 be i.i.d. with finite mean and finite Xn, and Zn Sn n n 2 Then as n Z. Recall that the standard normal distribution has moment­generating function given, the sequence Zn converges in distribution to the Z, i.e., Zn D by m Z s exp s2 2. We shall now assume that m Zn s is finite for s 0. (This assumption can be eliminated by using characteristic functions instead of moment­ generating functions.) Assuming this, we will prove that for each real number s, we have limn m Z s, where m Zn s is the moment­generating function of Zn. It then follows from Theorem 4.4.2 that Zn converges to Z in distribution. Var Yi To proceed, let Yi s0 for some s0. Then E Yi m Zn s Xi 0 and E Y 2 i 1. Also, we have Zn 1 n Y1 Yn. Let mY s all i, because they are i.i.d.). Then using independence, we compute that E esYi be the moment­generating function of Yi (which is the same for lim n m Zn s lim n lim n lim n lim n lim n E es Zn E esY1 lim n n esY2 E es Y1 Yn n n esYn n E esY1 n E esY2 n E esYn n mY s n mY s n mY s n mY s n n Now, we know from Theorem 3.5.3 that mY 0 E e0 1. Also, mY 0 1. But then expanding mY s in a Taylor series E Yi around s 0 and mY 0 0, we see that E Y 2 i mY s 1 0s 1 2! s2 o s2 1 s2 2 o s2
where o s2 stands for a quantity that, as s namely, o s2 0 as s 0. This means that s 0, goes to 0 faster than s2 does — mY s2 2n o 1 n where now o 1 n stands for a quantity that, as n does., goes to 0 faster than 1 n 248 Section 4.7: Further Proofs (Advanced) Finally, we recall from calculus that, for any real number c, limn ec. It follows from this and the above that 1 c n n lim n mY s 2 n n lim n 1 s2 2n n es2 2 That is, limn m Zn s es2 2, as claimed. Proof of Theorem 4.6.2 N i We prove the following. Suppose X i n Xi are independent. Let U i 1 ai Xi and V ai and bi. Then Cov U V only if U and V are independent. i ai bi 2 i for i 1 2 n and also that the n i 1 bi Xi, for some constants 0 if and 2 i. Furthermore, Cov U V It was proved in Section 4.6 that Cov U V if U and V are independent. It remains to prove that, if Cov U V are independent. For simplicity, we take n the general case is similar but messier. We therefore have 2 and 1 2 i ai bi 2 i and that Cov U V 0 0, then U and V 1; 2 2 0 and 2 1 U a1 X1 a2 X2 and V b1 X1 b2 X2 The Jacobian derivative of this transformation is J x1 x2 U X1 V X2 V X1 U X2 a1b2 b1a2 Inverting the transformation gives X1 b2U a2V b1a2 a1b2 and X2 a1V a1b2 b1U b1a2 Also, f X1 X2 x1 x2 Hence, from the multidimensional change of variable theorem (Theorem 2.9.2), we have fU V u f X1 X2 x1 x2 exp b2u 1 2 b2u a1b2 a2 a2 b1a2 a1 a1b2 b1u b1a2 J x1 x2 2 a1 a1b2 b1u 2 b1a2 2 a1b2 b1a2
1 2 But b2u a2 2 a1 b1u 2 b2 1 2 u2 b2 a2 1 2 a2 2 2 a1b1 a2b2 u and Cov U V a1b1 a2b2. Hence, if Cov U V 0, then b2u a2 2 a1 b1u 2 b2 1 2 u2 b2 a2 1 2 a2 2 Chapter 4: Sampling Distributions and Limits 249 and fU V u exp b2 1 exp b2 1 2 u2 2 a1b2 b2 b2 2 u2 a2 1 2 a1b2 b1a2 2 a1b2 2 2 a1b2 a2 2 b1a2 b1a2 2 2 exp a2 1 a2 2 2 2 a1b2 b1a2 2. b1a2 It follows that we can factor fU V u this implies (see Problem 2.8.19) that U and V are independent. as a function of u times a function of. But Proof of Theorem 4.6.6 We want to prove that when X 1 Xn are i.i.d. N 2 and X then n 1 S2 We have 1 n 2 X1 Xn and S2 n 1 n 1 i 1 Xi X 2 2 n 1 and, furthermore, that S2 and X are independent. n 1 2 S2 n i 1 Xi X 2. We rewrite this expression as (see Challenge 4.6.22) n 1 2 S2 X1 X2 2 2 X1 X2 2X3 2 X1 X2 2 3 2 3X4 X3 3 4 X1 X2 Xn 1 n 1 Xn n 1 n 2. (4.7.1) Now, by Theorem 4.6.1, each of the n 1 expressions within brackets in (4.7.1) has the standard normal distribution. Furthermore, by Theorem 4.6.2, the expressions within brackets in (4.7.1) are all independent of one another and are also all indepen­ dent of X. It follows that n 1 S2 2 is independent of X. It also follows, by the definition of the chi­squared distribution, that n 1 S2 2 2 n 1. Proof of Theorem 4.6.7 We want to show that when
U t n, then fU u n 1 2 n 2 1 u2 n n 1 2 1 n for all u R1. 250 Section 4.7: Further Proofs (Advanced) Because U t n, we can write U Y n, where X and Y are independent 2 n. It follows that X and Y have joint density given by X with X N 0 1 and Y f X Y x y e x2 2 y n 2 2 2n 2 1e y 2 n 2 when y 0 (with f X Y x y 0 for y 0). Let V Y We shall use the multivariate change of variables formula (Theo­ Y n V. We compute the Jacobian term of U and V. Because U U V n and Y rem 2.9.2) to compute the joint density fU V u and V as Y, it follows that X X det 1 y n x n y3 2 0 1 1 y n J x y det u x u y Hence, fU V u f X Y u x y n u2 2n n 2 e 2 2n 2 J 1 u 2 1e 1e 2 1 u2 n for 0 (with fU V u 0 for 0). Finally, we compute the marginal density of U : fU u fU u2 n 1 1 u2 1e 2 1 u2 n d n 1 2 1e 2 d 1 n 0 1 n where we have made the substitution then used the definition of the gamma function to obtain the result. 1 u2 n 2 to get the third equality and Proof of Theorem 4.6.9 We want to show that when U F m n, then fU Chapter 4: Sampling Distributions and Limits 251 for u 0, with fU u 0 for u 0. Because U independent with X density given by F n m, we can write U 2 m and Y X m Y n, where X and Y are 2 n. It follows that X and Y have joint f X Y x y x m 2 1e x 2 y n 2 m 2 2n 2 1e y 2 n 2 2m 2 when x y Let V 0 (with f X Y x y Y and use the multivariate change of variables formula (Theorem 2.9.2) X m Y n and V. We compute the Jacobian term as of U and V. Because U to compute the joint density fU V u V Y,
it follows that X m n U V and Y 0 for x 0 or y 0). n my 0 1 m n J x y det u x u y x y det n my n X mY 2 Hence, fU 1e 2 1 e m n u m 2 2n 2 m 2 2m 1e 2 1 mu n for u 0 (with fU V u 0 for u 0 or 0). Finally, we compute the marginal density of U as fU u fU 1e 2 1 mu 1e d m n u n m 2 m n where we have used the substitution the final result follows from the definition of the gamma function. 1 mu n 2 to get the third equality, and Chapter 5 Statistical Inference CHAPTER OUTLINE Section 1 Why Do We Need Statistics? Section 2 Section 3 Statistical Models Section 4 Data Collection Section 5 Some Basic Inferences Inference Using a Probability Model In this chapter, we begin our discussion of statistical inference. Probability theory is primarily concerned with calculating various quantities associated with a probability model. This requires that we know what the correct probability model is. In applica­ tions, this is often not the case, and the best we can say is that the correct probability measure to use is in a set of possible probability measures. We refer to this collection as the statistical model. So, in a sense, our uncertainty has increased; not only do we have the uncertainty associated with an outcome or response as described by a probability measure, but now we are also uncertain about what the probability measure is. Statistical inference is concerned with making statements or inferences about char­ acteristics of the true underlying probability measure. Of course, these inferences must be based on some kind of information; the statistical model makes up part of it. Another important part of the information will be given by an observed outcome or response, which we refer to as the data. Inferences then take the form of various statements about the true underlying probability measure from which the data were obtained. These take a variety of forms, which we refer to as types of inferences. The role of this chapter is to introduce the basic concepts and ideas of statistical inference. The most prominent approaches to inference are discussed in Chapters 6, 7, and 8. Likelihood methods require the least structure as described in Chapter 6. Bayesian methods, discussed in Chapter 7, require some additional ingredients. Infer­ ence methods based on measures of performance and loss
functions are described in Chapter 8. 253 254 Section 5.1: Why Do We Need Statistics? 5.1 Why Do We Need Statistics? While we will spend much of our time discussing the theory of statistics, we should always remember that statistics is an applied subject. By this we mean that ultimately statistical theory will be applied to real­world situations to answer questions of practical importance. What is it that characterizes those contexts in which statistical methods are useful? Perhaps the best way to answer this is to consider a practical example where statistical methodology plays an important role. EXAMPLE 5.1.1 Stanford Heart Transplant Study In the paper by Turnbull, Brown, and Hu entitled “Survivorship of Heart Transplant Data” (Journal of the American Statistical Association, March 1974, Volume 69, 74– 80), an analysis is conducted to determine whether or not a heart transplant program, instituted at Stanford University, is in fact producing the intended outcome. In this case, the intended outcome is an increased length of life, namely, a patient who receives a new heart should live longer than if no new heart was received. It is obviously important to ensure that a proposed medical treatment for a disease leads to an improvement in the condition. Clearly, we would not want it to lead to a deterioration in the condition. Also, if it only produced a small improvement, it may not be worth carrying out if it is very expensive or causes additional suffering. We can never know whether a particular patient who received a new heart has lived longer because of the transplant. So our only hope in determining whether the treat­ ment is working is to compare the lifelengths of patients who received new hearts with the lifelengths of patients who did not. There are many factors that inuence a patient’s lifelength, many of which will have nothing to do with the condition of the patient’s heart. For example, lifestyle and the existence of other pathologies, which will vary greatly from patient to patient, will have a great inuence. So how can we make this comparison? One approach to this problem is to imagine that there are probability distributions that describe the lifelengths of the two groups. Let these be given by the densities fT and fC, where T denotes transplant and C denotes no transplant. Here we have used C as our label because this group is serving as a control in the study to provide some comparison to the treatment (a heart transplant
). Then we consider the lifelength of a patient who received a transplant as a random observation from fT and the lifelength of a patient who did not receive a transplant as a random observation from fC We want to compare fT and fC in some fashion, to determine whether or not the transplant treatment is working. For example, we might compute the mean lifelengths of each distribution and compare these. If the mean lifelength of fT is greater than fC, then we can assert that the treatment is working. Of course, we would still have to judge whether the size of the improvement is enough to warrant the additional expense and patients’ suffering. If we could take an arbitrarily large number of observations from fT and fC, then we know, from the results in previous chapters, that we could determine these distribu­ tions with a great deal of accuracy. In practice, however, we are restricted to a relatively small number of observations. For example, in the cited study there were 30 patients Chapter 5: Statistical Inference 255 10 X 49 5 17 2 39 84 7 0 35 36 11 12 13 14 15 16 17 18 19 20 X 1400 5 34 15 11 2 1 39 8 101 21 22 23 24 25 26 27 28 29 30 X 2 148 1 68 31 1 20 118 91 427 Table 5.1: Survival times (X) in days and status (S) at the end of the study for each patient (P) in the control group. in the control group (those who did not receive a transplant) and 52 patients in the treatment group (those who did receive a transplant). For each control patient, the value of X — the number of days they were alive after the date they were determined to be a candidate for a heart transplant until the termination date of the study — was recorded. For various reasons, these patients did not receive new hearts, e.g., they died before a new heart could be found for them. These data, together with an indicator for the status of the patient at the termination date of the study, are presented in Table 5.1. The indicator value S a denotes that the patient was alive at the end of the study and S d denotes that the patient was dead. For each treatment patient, the value of Y the number of days they waited for the transplant after the date they were determined to be a candidate for a heart transplant, and the value of Z the number of days they were alive after the date they received
the heart transplant until the termination date of the study, were both recorded. The Z These survival times for the treatment group are then given by the values of Y data, together with an indicator for the status of the patient at the termination date of the study, are presented in Table 5.2. We cannot compare fT and fC directly because we do not know these distributions. But we do have some information about them because we have obtained values from each, as presented in Tables 5.1 and 5.2. So how do we use these data to compare fT and fC to answer the question of central importance, concerning whether or not the treatment is effective? This is the realm of statistics and statistical theory, namely, pro­ viding methods for making inferences about unknown probability distributions based upon observations (samples) obtained from them. We note that we have simplified this example somewhat, although our discussion presents the essence of the problem. The added complexity comes from the fact that typically statisticians will have available additional data on each patient, such as their age, gender, and disease history. As a particular example of this, in Table 5.2 we have the values of both Y and Z for each patient in the treatment group. As it turns out, this additional information, known as covariates, can be used to make our comparisons more accurate. This will be discussed in Chapter 10. 256 Section 5.1: Why Do We Need Statistics 10 11 12 13 14 15 16 17 18 Y 0 35 50 11 25 16 36 27 19 17 7 11 2 82 24 70 15 16 Z 15 3 624 46 127 61 1350 312 24 10 1024 39 730 136 1379 1 836 60 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 Y 50 22 45 18 4 1 40 57 0 1 20 35 82 31 40 9 66 20 Z 1140 1153 54 47 0 43 971 868 44 780 51 710 663 253 147 51 479 322 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 Y 77 2 26 32 13 56 2 9 4 30 3 26 4 45 25 5 Z 442 65 419 362 64 228 65 264 25 193 196 63 12 103 60 43 Table 5.2: The number of days until transplant (Y ), survival times in days after trans­ plant (Z), and status (S) at the end of the study for each patient (P
) in the treatment group. The previous example provides some evidence that questions of great practical im­ portance require the use of statistical thinking and methodology. There are many sit­ uations in the physical and social sciences where statistics plays a key role, and the reasons are just like those found in Example 5.1.1. The central ingredient in all of these is that we are faced with uncertainty. This uncertainty is caused both by vari­ ation, which can be modeled via probability, and by the fact that we cannot collect enough observations to know the correct probability models precisely. The first four chapters have dealt with building, and using, a mathematical model to deal with the first source of uncertainty. In this chapter, we begin to discuss methods for dealing with the second source of uncertainty. Summary of Section 5.1 Statistics is applied to situations in which we have questions that cannot be an­ swered definitively, typically because of variation in data. Probability is used to model the variation observed in the data. Statistical infer­ ence is concerned with using the observed data to help identify the true proba­ bility distribution (or distributions) producing this variation and thus gain insight into the answers to the questions of interest. Chapter 5: Statistical Inference 257 EXERCISES 5.1.1 Compute the mean survival times for the control group and for the treatment groups in Example 5.1.1. What do you conclude from these numbers? Do you think it is valid to base your conclusions about the effectiveness of the treatment on these numbers? Explain why or why not. 5.1.2 Are there any unusual observations in the data presented in Example 5.1.1? If so, what effect do you think these observations have on the mean survival times computed in Exercise 5.1.1? 5.1.3 In Example 5.1.1, we can use the status variable S as a covariate. What is the practical significance of this variable? 5.1.4 A student is uncertain about the mark that will be received in a statistics course. The course instructor has made available a database of marks in the course for a number of years. Can you identify a probability distribution that may be relevant to quantifying the student’s uncertainty? What covariates might be relevant in this situation? 5.1.5 The following data were generated from an N 1 distribution by a student. Unfortunately
, the student forgot which value of was used, so we are uncertain about the correct probability distribution to use to describe the variation in the data? Explain your reasoning. Can you suggest a plausible value for 5.1.6 Suppose you are interested in determining the average age of all male students at a particular college. The registrar of the college allows you access to a database that lists the age of every student at the college. Describe how you might answer your question. Is this a statistical problem in the sense that you are uncertain about anything and so will require the use of statistical methodology? 5.1.7 Suppose you are told that a characteristic X follows an N 1 1 distribution and 1 and 2 are unknown. In a characteristic Y follows an N 2 1 distribution where addition, you are given the results x1 xm of m independent measurements on X yn of n independent measurements on Y Suggest a method for determin­ and y1 ing whether or not 2 are equal. Can you think of any problems with your approach? distribution 5.1.8 Suppose we know that a characteristic X follows an Exponential and you are required to determine xn from this distribution. Suggest a method for doing this. Can you think of any problems with your approach? based on i.i.d. observations x1 1 and PROBLEMS 5.1.9 Can you identify any potential problems with the method we have discussed in Example 5.1.1 for determining whether or not the heart transplant program is effective in extending life? 5.1.10 Suppose you are able to generate samples of any size from a probability distrib­ ution P for which it is very difficult to compute P C for some set C. Explain how you 258 Section 5.2: Inference Using a Probability Model might estimate P C based on a sample. What role does the size of the sample play in your uncertainty about how good your approximation is? Does the size of P C play a role in this? COMPUTER PROBLEMS 3 5.1.11 Suppose we want to obtain the distribution of the quantity Y when X N 0 1 Here we are faced with a form of mathematical uncertainty because it is very difficult to determine the distribution of Y using mathematical methods. Pro­ pose a computer method for approximating the distribution function of Y and estimate P Y 1 2 What is the relevance of statistical methodology to your approach? X 4 2X 3 DISCUSSION TOPICS
5.1.12 Sometimes it is claimed that all uncertainties can and should be modeled using probability. Discuss this issue in the context of Example 5.1.1, namely, indicate all the things you are uncertain about in this example and how you might propose probability distributions to quantify these uncertainties. 5.2 Inference Using a Probability Model In the first four chapters, we have discussed probability theory, a good part of which has involved the mathematics of probability theory. This tells us how to carry out various calculations associated with the application of the theory. It is important to keep in mind, however, our reasons for introducing probability in the first place. As we discussed in Section 1.1, probability is concerned with measuring or quantifying uncertainty. Of course, we are uncertain about many things, and we cannot claim that prob­ ability is applicable to all these situations. Let us assume, however, that we are in a situation in which we feel probability is applicable and that we have a probability measure P defined on a collection of subsets of a sample space S for a response s In an application of probability, we presume that we know P and are uncertain about a future, or concealed, response value s S In such a context, we may be required, or may wish, to make an inference about the unknown value of s This can take the form of a prediction or estimate of a plausible value for s e.g., under suitable conditions, we might take the expected value of s as our prediction In other contexts, we may be asked to construct a subset that has a high probability of containing s and is in some sense small, e.g., find the region that contains at least 95% of the probability and has the smallest size amongst all such regions. Alternatively, we might be asked to assess whether or not a stated value s0 is an implausible value from the known P, e.g., assess whether or not s0 lies in a region assigned low probability by P and so is implausible. These are examples of inferences that are relevant to applications of probability theory. EXAMPLE 5.2.1 As a specific application, consider the lifelength X in years of a machine where it is Chapter 5: Statistical Inference 259 known that X Exponential 1 (see Figure 5.2.1). 1.0 f 0.8 0.6 0.4 0.2 0. 10 x
Figure 5.2.1: Plot of the Exponential(1) density f. Then for a new machine, we might predict its lifelength by E X 1 year. Further­ more, from the graph of the Exponential 1 density, it is clear that the smallest interval containing 95% of the probability for X is 0 c where c satisfies 0 95 c 0 e x dx 1 e c ln 0 05 2 9957 This interval gives us a reasonable range of probable or c 5 lifelengths for the new machine. Finally, if we wanted to assess whether or not x0 is a plausible lifelength for a newly purchased machine, we might compute the tail probability as P X 5 e x dx e 5 0 0067 5 which, in this case, is very small and therefore indicates that x0 5 is fairly far out in the tail. The right tail of this density is a region of low probability for this distribution, so x0 5 can be considered implausible. It is thus unlikely that a machine will last 5 years, so a purchaser would have to plan to replace the machine before that period is over. In some applications, we receive some partial information about the unknown s S In such a case, we replace P by the conditional probability taking the form s C C when deriving our inferences. Our reasons for doing this are many, measure P and, in general, we can say that most statisticians agree that it is the right thing to do. It is important to recognize, however, that this step does not proceed from a mathematical theorem; rather it can be regarded as a basic axiom or principle of inference. We will refer to this as the principle of conditional probability, which will play a key role in some later developments. EXAMPLE 5.2.2 Suppose we have a machine whose lifelength is distributed as in Example 5.2.1, and 260 Section 5.2: Inference Using a Probability Model the machine has already been running for one year. Then inferences about the lifelength of the machine are based on the conditional distribution, given that X 1. The density of this conditional distribution is given by e 1. The predicted lifelength is now x 1 for x E X X 1 xe x 1 dx x 1 xe 1 e x 1 dx 2. 1 1 The fact that the additional lifelength is the same as the predicted lifelength before the machine starts working is a
special characteristic of the Exponential distribution. This will not be true in general (see Exercise 5.2.4). The tail probability measuring the plausibility of the value x0 5 is given by P X 5 X 1 e x 1 dx e 4 0 0183, 5 which indicates that x0 5 is a little more plausible in light of the fact that the machine has already survived one year. The shortest interval containing 0 95 of the conditional probability is now of the form 1 c, where c is the solution to 0 95 c e 1 x 1 dx e e 1 e c which implies that c ln e 1 0 95e 1 3 9957. Our main point in this section is simply that we are already somewhat familiar with inferential concepts. Furthermore, via the principle of conditional probability, we have a basic rule or axiom governing how we go about making inferences in the context where the probability measure P is known and s is not known. Summary of Section 5.2 Probability models are used to model uncertainty about future responses. We can use the probability distribution to predict a future response or assess whether or not a given value makes sense as a possible future value from the distribution. EXERCISES 5.2.1 Sometimes the mode of a density (the point where the density takes its maximum value) is chosen as a predictor for a future value of a response. Determine this predictor in Examples 5.2.1 and 5.2.2 and comment on its suitability as a predictor. 5.2.2 Suppose it has been decided to use the mean of a distribution to predict a future response. In Example 5.2.1, compute the mean­squared error (expected value of the square of the error between a future value and its predictor) of this predictor, prior to observing the value. To what characteristic of the distribution of the lifelength does this correspond? Chapter 5: Statistical Inference 261 10X where X Uniform[0 1]. N 10 2 What value would you record as a prediction of a 5.2.3 Graph the density of the distribution obtained as a mixture of a normal distribu­ tion with mean 4 and variance 1 and a normal distribution with mean 4 and variance 1 where the mixture probability is 0 5. Explain why neither the mean nor the mode is a suitable predictor in this case. (Hint: Section 2.5.4.) 5.2.4 Repeat the calculations of Examples 5.2.1 and 5.2.
2 when the lifelength of a machine is known to be distributed as Y 5.2.5 Suppose that X future value of X? How would you justify your choice? 5.2.6 Suppose that X probability for a future response. (Hint: Consider a plot of the density.) 5.2.7 Suppose that X of a future value of X? How would you justify your choice? 5.2.8 Suppose that X future value of X? How would you justify your choice? 5.2.9 Suppose that X Geometric 1 3 What value would you record as a prediction of a future value of X? 5.2.10 Suppose that X follows the following probability distribution. Poisson 5 What value would you record as a prediction of a N 10 2 Record the smallest interval containing 0.95 of the Gamma 3 6 What value would you record as a prediction a) Record a prediction of a future value of X (b) Suppose you are then told that X that uses this information. 2 Record a prediction of a future value of X PROBLEMS 5.2.11 Suppose a fair coin is tossed 10 times and the response X measured is the number of times we observe a head. (a) If you use the expected value of the response as a predictor, then what is the predic­ tion of a future response X? (b) Using Table D.6 (or a statistical package), compute a shortest interval containing at least 0.95 of the probability for X Note that it might help to plot the probability function of X first. (c) What region would you use to assess whether or not a value s0 is a possible future value? (Hint: What are the regions of low probability for the distribution?) Assess whether or not x 5.2.12 In Example 5.2.1, explain (intuitively) why the interval 0 2 9957 is the short­ est interval containing 0.95 of the probability for the lifelength. 5.2.13 (Problem 5.2.11 continued) Suppose we are told that the number of heads ob­ served is an even number. Repeat parts (a), (b), and (c). 5.2.14 Suppose that a response X is distributed Beta a b with a b 1 fixed (see Problem 2.4.16) Determine the mean and the mode (point where density takes its maximum) of this distribution and assess which is
the most accurate predictor of a 8 is plausible. 262 Section 5.3: Statistical Models future X when using mean­squared error, i.e., the expected squared distance between X and the prediction. 5.2.15 Suppose that a response X is distributed N 0 1 and that we have decided to predict a future value using the mean of the distribution. (a) Determine the prediction for a future X (b) Determine the prediction for a future Y (c) Comment on the relationship (or lack thereof) between the answers in parts (a) and (b). Geometric 1 3 Determine the shortest interval containing 5.2.16 Suppose that X 0.95 of the probability for a future X (Hint: Plot the probability function and record the distribution function.) 5.2.17 Suppose that X 5 What value would you record as a prediction of a future value of X? Determine the shortest interval containing 0.95 of the probability for a future X (Hint: Plot the probability function and record the distribution function.) Geometric 1 3 and we are told that X X 2 DISCUSSION TOPICS 5.2.18 Do you think it is realistic for a practitioner to proceed as if he knows the true probability distribution for a response in a problem? 5.3 Statistical Models In a statistical problem, we are faced with uncertainty of a different character than that arising in Section 5.2. In a statistical context, we observe the data s, but we are uncertain about P. In such a situation, we want to construct inferences about P based on s. This is the inverse of the situation discussed in Section 5.2. How we should go about making these statistical inferences is probably not at all obvious. In fact, there are several possible approaches that we will discuss in subse­ quent chapters. In this chapter, we will develop the basic ingredients of all the ap­ proaches. Common to virtually all approaches to statistical inference is the concept of the statistical model for the data s This takes the form of a set P : of probability measures, one of which corresponds to the true unknown probability measure P that produced the data s In other words, we are asserting that there is a random mechanism generating s and we know that the corresponding probability measure P is one of the probability measures in P : The statistical model P : corresponds to the information a statistician brings to the application about what the true probability measure is, or at least what one is willing to assume
about it. The variable is called the parameter of the model, and the set indexes the probability measures in the model, i.e., P 1 2 If the probability measures P can all be presented via probability functions or (for convenience we will not distinguish between the discrete and density functions f is called the parameter space. Typically, we use models where P 2 if and only if 1 Chapter 5: Statistical Inference 263 continuous case in the notation), then it is common to write the statistical model as. f : From the definition of a statistical model, we see that there is a unique value such that P is the true probability measure. We refer to this value as the true parameter value. It is obviously equivalent to talk about making inferences about the true parameter value rather than the true probability measure, i.e., an inference about is at once an inference about the true probability distribution. So, for the true value of example, we may wish to estimate the true value of that are likely to contain the true value, or assess whether or not the data are in agreement with some particular value 0 suggested as being the true value. These are types of inferences, just like those we discussed in Section 5.2, but the situation here is quite different. construct small regions in EXAMPLE 5.3.1 Suppose we have an urn containing 100 chips, each colored either black B or white W. Suppose further that we are told there are either 50 or 60 black chips in the urn. The chips are thoroughly mixed, and then two chips are withdrawn without replacement. The goal is to make an inference about the true number of black chips in the urn, having observed the data s s1 s2 where si is the color of the ith chip drawn. where In this case, we can take the statistical model to be P : is 50 60 and P is the probability the number of black chips in the urn, so that measure on S B B B W W B W W corresponding to Therefore, P50 assigns the probability 50 49 100 99 to each of the sequences B B and W W and the probability 50 50 100 99 to each of the sequences B W and W B and P60 assigns the probability 60 59 100 99 to the sequence B B, the probability 40 39 100 99 to the sequence W W and the probability 60 40 100 99 to each of the sequences B W and W B. The choice of the parameter is somewhat arbitrary, as we could have easily la­
belled the possible probability measures as P1 and P2 respectively. The parameter is in essence only a label that allows us to distinguish amongst the possible candidates for the true probability measure. It is typical, however, to choose this label conveniently so that it means something in the problem under discussion. : We note some additional terminology in common usage. If a single observed value for a response X has the statistical model Xn f (recall that sample here means that the Xi are independent and identically distributed f xn for some — see Definition 2.8.6) has joint density given by f x2 Xn We refer to. This specifies the statistical model for the response X1 this as the statistical model for a sample. Of course, the true value of for the statistical model for a sample is the same as that for a single observation. Sometimes, rather than referring to the statistical model for a sample, we speak of a sample from the statistical model, then a sample X1 x1 : f f Note that, wherever possible, we will use uppercase letters to denote an unobserved value of a random variable X and lowercase letters to denote the observed value. So an observed sample X1 Xn will be denoted x1 xn 264 Section 5.3: Statistical Models EXAMPLE 5.3.2 Suppose there are two manufacturing plants for machines. It is known that machines built by the first plant have lifelengths distributed Exponential 1, while machines man­ ufactured by the second plant have lifelengths distributed Exponential 2 3. The den­ sities of these distributions are depicted in Figure 5.3.1. 1.0 f 0.8 0.6 0.4 0.2 0. Figure 5.3.1: Plot of the Exponential 1 (solid line and Exponential 1 5 (dashed line) densities. You have purchased five of these machines knowing that all five came from the same plant, but you do not know which plant. Subsequently, you observe the lifelengths of these machines, obtaining the sample x1 and want to make inferences about the true P. x5 In this case, the statistical model for a single observation comprises two probability measures P1 P2, where P1 is the Exponential 1 probability measure and P2 is the Exponential 2 3 probability measure. Here we take
the parameter to be 1 2 Clearly, longer observed lifelengths favor 2. For example, if x1 x5 then intuitively we are more certain that 2 than if x1 x5 The subject of statistical inference is concerned with making statements like this more precise and quantifying our uncertainty concerning the validity of such assertions. We note again that the quantity serves only as a label for the distributions in the model. The value of has no interpretation other than as a label and we could just as easily have used different values for the labels. In many applications, however, the is taken to be some characteristic of the distribution that takes a unique parameter Chapter 5: Statistical Inference 265 to be the mean value for each distribution in the model. Here, we could have taken and then the parameter space would be 1 1 5 Notice that we could just as well have used the first quartile, or for that matter any other quantile, to have labelled the distributions, provided that each distribution in the family yields a unique value for the characteristic chosen. Generally, any 1–1 transformation of a parameter is acceptable as a parameterization of a statistical model. When we relabel, we refer to this as a reparameterization of the statistical model. We now consider two important examples of statistical models. These are important because they commonly arise in applications. distribution with xn is a sample from a Bernoulli EXAMPLE 5.3.3 Bernoulli Model Suppose that x1 [0 1] unknown. We could be observing the results of tossing a coin and recording Xi equal to 1 whenever a head is observed on the ith toss and equal to 0 otherwise. Alternatively, we could be observing items produced in an industrial process and recording Xi equal to 1 whenever the ith item is defective and 0 otherwise. In a biomedical application, 1 might indicate that a treatment on a patient has been successful, the response Xi 0 indicates a failure. In all these cases, we want to know the true value whereas Xi of as this tells us something important about the coin we are tossing, the industrial process, or the medical treatment, respectively. Now suppose we have no information whatsoever about the true probability. Ac­ [0 1], the set of all possible values cordingly, we take the parameter space to be for. The probability function for the ith sample item is given by and the probability function for the sample is given by f xi xi 1 1 xi n i 1 f xi n i
1 xi 1 1 xi nx 1 n 1 x. This specifies the model for a sample. Note that we could parameterize this model by any 1–1 function of. 2 would work (as it is 1–1 on ), as would ln 1 For example, R unknown, where R EXAMPLE 5.3.4 Location­Scale Normal Model 2 distribution with Suppose that x1 R1. For example, we may have observations of heights in centimeters of individuals in a population and feel that it is reasonable to assume that the distribution of heights in the population is normal with some unknown mean and standard deviation. xn is a sample from an N 0 2 The density for the sample is then given by n i 1 f 2 xi 2 2 n 2 exp n 2 exp xi 2 2 n 1 2 2 s2 266 Section 5.3: Statistical Models because (Problem 5.3.13) n i 1 xi 2 n x 2 n i 1 xi x 2 (5.3.1) where is the sample mean, and is the sample variance. x 1 n n i 1 xi s2 n 1 n 1 i 1 xi x 2 Alternative parameterizations for this model are commonly used. For example, is a convenient or ln rather than using choice. Note that ln 2, sometimes ranges in R1 as 2 or varies in R Actually, we might wonder how appropriate the model of Example 5.3.4 is for the distribution of heights in a population, for in any finite population the true distribution is discrete (there are only finitely many students). Of course, a normal distribution may provide a good approximation to a discrete distribution, as in Example 4.4.9. So, in Example 5.3.4, we are also assuming that a continuous probability distribution can provide a close approximation to the true discrete distribution. As it turns out, such approximations can lead to great simplifications in the derivation of inferences, so we use them whenever feasible. Such an approximation is, of course, not applicable in Example 5.3.3. Also note that heights will always be expressed in some specific unit, e.g., centime­ ters; based on this, we know that the population mean must be in a certain range of values, e.g., So we often do have additional information about the
true value of the parameter for a model, but it is somewhat imprecise, e.g., we also probably have 100 300. In Chapter 7, we will discuss ways of incorporating such information into our analysis. but the statistical model allows for any value for 0 300 Where does the model information P : come from in an application? For example, how could we know that heights are approximately normally distributed in Example 5.3.4? Sometimes there is such information based upon previous experience with related applications, but often it is an assumption that requires checking before inference procedures can be used. Procedures designed to check such assumptions are referred to as model­checking procedures, which will be discussed in Chapter 9. In practice, model­checking procedures are required, or else inferences drawn from the data and statistical model can be erroneous if the model is wrong. Summary of Section 5.3 In a statistical application, we do not know the distribution of a response, but we know (or are willing to assume) that the true probability distribution is one of a Chapter 5: Statistical Inference 267 : f where f is the density or probability set of possible distributions function (whichever is relevant) for the response. The set of possible distribu­ tions is called the statistical model. The set ter of the model. Because each value of distribution in the model, we can talk about the true value of true distribution via f is called the parame­ corresponds to a distinct probability as this gives the is called the parameter space, and the variable EXERCISES Xn 5.3.1 Suppose there are three coins — one is known to be fair, one has probability 1 3 of yielding a head on a single toss, and one has probability 2 3 for head on a single toss. A coin is selected (not randomly) and then tossed five times. The goal is to make an inference about which of the coins is being tossed, based on the sample. Fully describe a statistical model for a single response and for the sample. 5.3.2 Suppose that one face of a symmetrical six­sided die is duplicated but we do not know which one. We do know that if 1 is duplicated, then 2 does not appear; otherwise, 1 does not appear. Describe the statistical model for a single roll. 5.3.3 Suppose we have two populations (I and II) and that variable X is known to be distributed N 10 2 on population I and distributed N 8 3
on population II. A sam­ ple X1 is generated from one of the populations; you are not told which population the sample came from, but you are required to draw inferences about the true distribution based on the sample. Describe the statistical model for this problem. Could you parameterize this model by the population mean, by the population vari­ ance? Sometimes problems like this are called classification problems because making inferences about the true distribution is equivalent to classifying the sample as belong­ ing to one of the populations. 5.3.4 Suppose the situation is as described in Exercise 5.3.3, but now the distribution for population I is N 10 2 and the distribution for population II is N 10 3. Could you parameterize the model by the population mean? By the population variance? Justify your answer. 5.3.5 Suppose that a manufacturing process produces batteries whose lifelengths are known to be exponentially distributed but with the mean of the distribution completely unknown. Describe the statistical model for a single observation. Is it possible to parameterize this model by the mean? Is it possible to parameterize this model by the variance? Is it possible to parameterize this model by the coefficient of variation (the coefficient of variation of a distribution equals the standard deviation divided by the mean)? 5.3.6 Suppose it is known that a response X is distributed Uniform[0 0 is unknown. Is it possible to parameterize this model by the first quartile of the distribution? (The first quartile of the distribution of a random variable X is the point c satisfying P X 5.3.7 Suppose it is known that a random variable X follows one of the following dis­ tributions. 0 25 ) Explain why or why not. ], where c 268 Section 5.3: Statistical Models? 1 while P2 C c 1 What is the true value of the parameter? What (a) What is the parameter space (b) Suppose we observe a value X is the true distribution of X? (c) What could you say about the true value of the parameter if you had observed X 5.3.8 Suppose we have a statistical model P1 P2, where P1 and P2 are probability measures on a sample space S Further suppose there is a subset C S such that 1 Discuss how you would make an inference about the P1 C true
distribution of a response s after you have observed a single observation. 5.3.9 Suppose you know that the probability distribution of a variable X is either P1 or P2 If you observe X 0 001, then what would you guess as the true distribution of X? Give your reasoning for this conclusion. 5.3.10 Suppose you are told that class #1 has 35 males and 65 females while class #2 has 45 males and 55 females. You are told that a particular student from one of these classes is female, but you are not told which class she came from. (a) Construct a statistical model for this problem, identifying the parameter, the para­ meter space, and the family of distributions. Also identify the data. (b) Based on the data, do you think a reliable inference is feasible about the true para­ meter value? Explain why or why not. (c) If you had to make a guess about which distribution the data came from, what choice would you make? Explain why. 0 75 while P2 X 1 and P1 X 1 1 PROBLEMS 1 ln as the parameter and record the relevant parameter space. 5.3.11 Suppose in Example 5.3.3 we parameterize the model by. Record the statistical model using this parameterization, i.e., record the probability function using 5.3.12 Suppose in Example 5.3.4 we parameterize the model by Record the statistical model using this parameterization, i.e., record the density func­ tion using 5.3.13 Establish the identity (5.3.1). 5.3.14 A sample X1 [0 1] unknown, but only T statistical model for the observed data. 5.3.15 Suppose it is known that a response X is distributed N n i 1 Xi is observed by the statistician. Describe the as the parameter and record the relevant parameter space. Xn is generated from a Bernoulli distribution with 2 where ln 2 R1 R and quartile of each distribution in this model from the values parameterize the model by the first quartile? Explain your answer. is completely unknown. Show how to calculate the first Is it possible to 2 Chapter 5: Statistical Inference 269 2 2 where Y N 0 2 5.3.16 Suppose response X is known to be distributed N Y and 2 0 are completely unknown. Describe the statistical model for an obser­ vation
X Y If Y is not observed, describe the statistical model for X 5.3.17 Suppose we have a statistical model P1 P2, where P1 is an N 10 1 distrib­ ution while P2 is an N 0 1 distribution. (a) Is it possible to make any kind of reliable inference about the true distribution based on a single observation? Why or why not? (b) Repeat part (a) but now suppose that P1 is an N 1 1 distribution. 5.3.18 Suppose we have a statistical model P1 P2, where P1 is an N 1 1 distri­ bution while P2 is an N 0 1 distribution. Further suppose that we had a sample x1 x100 from the true distribution. Discuss how you might go about making an inference about the true distribution based on the sample. DISCUSSION TOPICS 5.3.19 Explain why you think it is important that statisticians state very clearly what they are assuming any time they carry out a statistical analysis. 2 0 distributions 5.3.20 Consider the statistical model given by the collection of N 2 R1 is considered completely unknown, but where 0 is assumed known. Do you think this is a reasonable model to use in an application? Give your reasons why or why not. 5.4 Data Collection The developments of Sections 5.2 and 5.3 are based on the observed response s being a realization from a probability measure P In fact, in many applications, this is an assumption. We are often presented with data that could have been produced in this way, but we cannot always be sure. When we cannot be sure that the data were produced by a random mechanism, then the statistical analysis of the data is known as an observational study. In an observa­ tional study, the statistician merely observes the data rather than intervening directly in generating the data, to ensure that the randomness assumption holds. For example, suppose a professor collects data from his students for a study that examines the rela­ tionship between grades and part­time employment. Is it reasonable to regard the data collected as having come from a probability distribution? If so, how would we justify this? It is important for a statistician to distinguish carefully between situations that are observational studies and those that are not. As the following discussion illustrates, there are qualifications that must be applied to the analysis of an observational study. While statistical analyses of observational studies are valid and indeed important
, we must be aware of their limitations when interpreting their results. 270 Section 5.4: Data Collection 5.4.1 Finite Populations For example, we could take X of objects, called the population, and a real­valued we Suppose we have a finite set function X (sometimes called a measurement) defined on have a real­valued quantity X So for each that measures some aspect or feature of could be the set of all students currently enrolled full­time at a in centimeters. Or, for the particular university, with X 1 denotes, where X same 2 denotes male. Here, height is a quantitative variable, because its female and X values mean something on a numerical scale, and we can perform arithmetic on these values, e.g., calculate a mean. On the other hand, gender is an example of a categorical variable because its values serve only to classify, and any other choice of unique real numbers would have served as well as the ones we chose. The first step in a statistical analysis is to determine the types of variables we are working with because the relevant statistical analysis techniques depend on this. the height of student to be the gender of student The population and the measurement together produce a population distribution over the population. This is specified by the population cumulative distribution func­ tion FX : R1 [0 1] where FX x : X x N with A being the number of elements in the set A and N is the proportion of elements in with their measurement less than or equal to x Consider the following simple example where we can calculate FX exactly. Therefore, FX x EXAMPLE 5.4.1 Suppose that suppose that X the following measurements were obtained. is a population of N is a measure of the fertility of plot 20 plots of land of the same size. Further on a 10­point scale and that Then we have FX x 0 3 20 6 20 9 20 11 20 15 20 19 20 because, for example, 6 out of the 20 plots have fertility measurements less than or equal to 4. The goal of a statistician in this context is to know the function FX as precisely If we know FX exactly, then we have identified the distribution of X as possible. Chapter 5: Statistical Inference 271 One way of knowing the distribution exactly is to conduct a census, wherein, over the statistician goes out and observes X and then calculates FX Sometimes this is feasible, but often it is not possible
or even desirable, due to the costs involved in the accurate accumulation of all the measurements — think of how difficult it might be to collect the heights of all the students at your school. for every While sometimes a census is necessary, even mandated by law, often a very accu­ rate approximation to FX can be obtained by selecting a subset 1 n for some n defined by N We then approximate FX x by the empirical distribution function FX ] X i Rk for some k For example, if We could also measure more than one aspect of to produce a multivariate mea­ is again the population of surement X : is the height in cen­ students, we might have X in kilograms We will dis­ timeters of student cuss multivariate measurements in Chapter 10, where our concern is the relationships amongst variables, but we focus on univariate measurements here. X2 is the weight of student where X1 and X2 X1 There are two questions we need to answer now — namely, how should we select the subset 1 n and how large should n be? 5.4.2 Simple Random Sampling n. Suppose we select this subset We will first address the issue of selecting according to some given rule based on the unique label that each possesses. For example, if the label is a number, we might order the numbers and then take the n elements with the smallest labels. Or we could order the numbers and take every other element until we have a subset of n etc. 1 There are many such rules we could apply, and there is a basic problem with all If we want FX to approximate FX for the full population, then, when we of them. employ a rule, we run the risk of only selecting from a subpopulation. For example, if we use student numbers to identify each element of a population of students, and more senior students have lower student numbers, then, when n is much smaller than N and we select the students with smallest student numbers FX is really only approximating the distribution of X in the population of senior students at best. This distribution could be very different from FX Similarly, for any other rule we employ, even if we cannot imagine what the subpopulation could be, there may be such a selection effect, or bias, induced that renders the estimate invalid. 1 n This is the qualification we need to apply when analyzing the results of observa­ tional studies. In an observational study, the
data are generated by some rule, typically 272 Section 5.4: Data Collection unknown to the statistician; this means that any conclusions drawn based on the data X 1 X n may not be valid for the full population. 1 There seems to be only one way to guarantee that selection effects are avoided, n must be selected using randomness. For simple random namely, the set i in such a way sampling, this means that a random mechanism is used to select the that each subset of n has probability 1 N n of being chosen. For example, we might place N chips in a bowl, each with a unique label corresponding to a population ele­ ment, and then randomly draw n chips from the bowl without replacement. The labels Alterna­ on the drawn chips identify the individuals that have been selected from tively, for the randomization, we might use a table of random numbers, such as Table D.1 in Appendix D (see Table D.1 for a description of how it is used) or generate random values using a computer algorithm (see Section 2.10). Note that with simple random sampling X 1 1 we then have ticular, when n X n is random. In par­ P X 1 x FX x namely, the probability distribution of the random variable X 1 is the same as the population distribution. EXAMPLE 5.4.2 Consider the context of Example 5.4.1. When we randomly select the first plot from, it is clear that each plot has probability 1 20 of being selected. Then we have P X 1 x : X x 20 FX x for every x R1 Prior to observing the sample, we also have P X 2 however, the distribution of X 2 given that X 1 one population member, with measurement value x1 then N FX x of individuals left in with X x1 Therefore, x FX x Consider, x1 Because we have removed 1 is the number P X 2 x X 1 x1 1 N FX x N 1 N FX x N 1 x x x1 x1 Note that this is not equal to FX x So with simple random sampling, X 1 and X 2 are not independent. Observe, however, that when N is large, then P X 2 x X 1 x1 FX x so that X 1 and X 2 are approximately independent and identically distributed (i.i.d.). Similar calculations lead to the conclusion that, when N is large and n is small relative to N, then with simple random
sampling from the population, the random variables X 1 X n Chapter 5: Statistical Inference 273 are approximately i.i.d. and with distribution given by FX So we will treat the observed values x1 as a sample (in the sense of Definition 2.8.6) from FX In this text, unless we indicate otherwise, we will always assume that n is small relative to N so that this approximation makes sense. xn of X 1 X n Under the i.i.d. assumption, the weak law of large numbers (Theorem 4.2.1) implies that the empirical distribution function FX satisfies FX x 1 n n i 1 I x] X i P FX x as n cumulative distribution function (cdf) FX. So we see that FX can be considered as an estimate of the population Whenever the data have been collected using simple random sampling, we will re­ fer to the statistical investigation as a sampling study. It is a basic principle of good statistical practice that sampling studies are always preferred over observational stud­ ies, whenever they are feasible. This is because we can be sure that, with a sampling n will apply to the pop­ study, any conclusions we draw based on the sample of interest. With observational studies, we can never be sure that the sample ulation data have not actually been selected from some proper subset of For example, if you were asked to make inferences about the distribution of student heights at your school but selected some of your friends as your sample, then it is clear that the estimated cdf may be very unlike the true cdf (possibly more of your friends are of one gender than the other). 1 Often, however, we have no choice but to use observational data for a statistical analysis. Sampling directly from the population of interest may be extremely difficult or even impossible. We can still treat the results of such analyses as a form of evidence, but we must be wary about possible selection effects and acknowledge this possibility. Sampling studies constitute a higher level of statistical evidence than observational studies, as they avoid the possibility of selection effects. In Chapter 10, we will discuss experiments that constitute the highest level of sta­ tistical evidence. Experiments are appropriate when we are investigating the possibility of cause–effect relationships existing amongst variables defined on populations. The second question we need to address concerns the choice of the sample size n It seems natural that we would like to choose as large
a sample as possible. On the other hand, there are always costs associated with sampling, and sometimes each sample value is very expensive to obtain. Furthermore, often the more data we collect, the more difficulty we have in making sure that the data are not corrupted by various errors that can arise in the collection process. So our answer, concerning how large n need be, is that we want it chosen large enough so that we obtain the accuracy necessary but no larger. Accordingly, the statistician must specify what accuracy is required, and then n is determined. We will see in the subsequent chapters that there are various methods for specifying the required accuracy in a problem and then determining an appropriate value for n Determining n is a key component in the implementation of a sampling study and is often referred to as a sample­size calculation. 274 If we define Section 5.4: Data Collection namely, f X x is the proportion of population members satisfying X see that f X plays the role of the probability function because x, then we FX x f X z z x We refer to f X as the population relative frequency function. Now, estimated, based on the sample 1 by n f X x may be namely, the proportion of sample members satisfying X x With categorical variables, f X x estimates the population proportion f X x in the category specified by x. With some quantitative variables, however, f X is not an appropriate quantity to estimate, and an alternative function must be considered. 5.4.3 Histograms Quantitative variables can be further classified as either discrete or continuous vari­ ables. Continuous variables are those that we can measure to an arbitrary precision as we increase the accuracy of a measuring instrument. For example, the height of an individual could be considered a continuous variable, whereas the number of years of education an individual possesses would be considered a discrete quantitative variable. For discrete quantitative variables, f X is an appropriate quantity to describe a popula­ tion distribution, but we proceed differently with continuous quantitative variables. Suppose that X is a continuous quantitative variable. In this case, it makes more sense to group values into intervals, given by h1 h2] h2 h3] hm 1 hm] where the hi are chosen to satisfy h1 covering the range of possible values for X Then we define h2 hm with h1 hm effectively h X x 0 hi hi 1] : X
N hi 1 hi x hi hi 1] otherwise and refer to h X as a density histogram function. Here, h X x is the proportion of in the interval hi hi 1] population elements containing x divided by the length of the interval. that have their measurement X In Figure 5.4.1, we have plotted a density histogram based on a sample of 10,000 from an N 0 1 distribution (we are treating this sample as the full population) and Chapter 5: Statistical Inference 275 5 Note that the vertical lines are only h11 using the values h1 artifacts of the plotting software and do not represent values of h X as these are given by the horizontal lines. 5 h2 4 0.4 0.3 y t i s n e D 0.2 0.1 0.0 -4 -2 0 x 2 4 Figure 5.4.1: Density histogram function for a sample of 10,000 from an N 0 1 distribution using the values h1 5 h2 h11 5. 4 If x hi hi 1], then h X x hi 1 population that have their measurement X hi gives the proportion of individuals in the in hi hi 1]. Furthermore, we have h j FX h j h X x dx for each interval endpoint and FX h j FX hi h j hi h X x dx when hi h j If the intervals hi hi 1] are small, then we expect that FX b FX a b a h X x dx for any choice of a b Now suppose that the lengths hi 1 hi are small and N is very large. Then it makes sense to imagine a smooth, continuous function f X e.g., perhaps a normal or gamma density function, that approximates h X in the sense that b a f X x dx b a h X x dx for every a b Then we will also have b a f X x d x FX b FX a 276 for every a distribution. Section 5.4: Data Collection b We will refer to such an f X as a density function for the population In essence, this is how many continuous distributions arise in practice. In Figure 5.4.2, we have plotted a density histogram for the same values used in Figure 5.4.1, but 5 We note this time we used the interval endpoints h1 that Figure 5.4.2 looks much more like a continuous function than does Figure 5.4.1. 5 h2 4 75 h41 y t i s n e D 0
.4 0.3 0.2 0.1 0.0 -4.5 -3.0 -1.5 0.0 x 1.5 3.0 4.5 Figure 5.4.2: Density histogram function for a sample of 10,000 from an N 0 1 distribution using the values h1 5 h2 4 75 h41 5. 5.4.4 Survey Sampling Finite population sampling provides the formulation for a very important application of statistics, namely, survey sampling or polling. Typically, a survey consists of a set of Each question questions that are asked of a sample corresponds to a measurement, so if there are m questions, the response from a respon­ dent A very important example of survey sampling is the pre­election polling that is undertaken to predict the outcome of a vote. Also, many consumer product companies engage in extensive mar­ ket surveys to try to learn what consumers want and so gain information that can lead to improved sales. is the m­dimensional vector X1 n from a population Xm X2 1 Typically, the analysis of the results will be concerned not only with the population distributions of the individual Xi over the population but also the joint population dis­ tributions. For example, the joint cumulative distribution function of X1 X2 is given by F X1 X2 x1 x2 : X1 x1 X2 N x2 namely, F X1 X2 x1 x2 is the proportion of the individuals in the population whose X1 measurement is no greater than x1 and whose X2 measurement is no greater than x2 Of course, we can also define the joint distributions of three or more measurements. Chapter 5: Statistical Inference 277 These joint distributions are what we use to answer questions like, is there a relationship between X1 and X2 and if so,what form does it take? This topic will be extensively discussed in Chapter 10. We can also define f X1 X2 for the joint distribution, and joint density histograms are again useful when X1 and X2 are both continuous quantitative variables. EXAMPLE 5.4.3 Suppose there are four candidates running for mayor in a particular city. A random sample of 1000 voters is selected; they are each asked if they will vote and, if so, which of the four candidates they will vote for. Additionally, the respondents are asked their age. We denote the answer to the question of whether or not they
will vote by X1 0 meaning no. For those voting, we denote with X1 by X2 the response concerning which candidate they will vote for, with X2 i indicating candidate i Finally, the age in years of the respondent is denoted by X3 In addition to the distributions of X1 and X2 the pollster is also interested in the joint distributions of X1 X3 and X2 X3, as these tell us about the relationship between voter participation and age in the first case and candidate choice and age in the second case. 1 meaning yes and X1 There are many interesting and important aspects to survey sampling that go well beyond this book. For example, it is often the case with human populations that a ran­ domly selected person will not respond to a survey. This is called nonresponse error, and it is a serious selection effect. The sampler must design the study carefully to try to mitigate the effects of nonresponse error. Furthermore, there are variants of simple random sampling (see Challenge 5.4.20) that can be preferable in certain contexts, as these increase the accuracy of the results. The design of the actual questionnaire used is also very important, as we must ensure that responses address the issues intended without biasing the results. Summary of Section 5.4 Simple random sampling from a population means that we randomly select in such a way that each subset of n has the same a subset of size n from probability — namely, 1 n — of being selected. Data that arise from a sampling study are generated from the distribution of the measurement of interest X over the whole population rather than some sub­ population. This is why sampling studies are preferred to observational studies. When the sample size n is small relative to we can treat the observed values of X as a sample from the distribution of X over the population. EXERCISES 5.4.1 Suppose we have a population X given by 10 and quantitative measurement 6 3 7 3 8 1 9 2 10 4 278 Section 5.4: Data Collection X and 2 X 3 (without replacement) from the population Calculate FX f X 5.4.2 Suppose you take a sample of n in Exercise 5.4.1. (a) Can you consider this as an approximate i.i.d. sample from the population distribu­ tion? Why or why not? (b) Explain how you would actually physically carry out the sampling from the popu­ lation in this case. (Hint:
Table D.1.) (c) Using the method you outlined in part (b), generate three samples of size n calculate X for each sample. 5.4.3 Suppose you take a sample of n Exercise 5.4.1. (a) Can you consider this as an approximate i.i.d. sample from the population distribu­ tion? Why or why not? (b) Explain how you would actually physically carry out the sampling in this case. (c) Using the method you outlined in part (b), generate three samples of size n calculate X for each sample. 5.4.4 Suppose we have a finite population where a (a) Determine f X 0 and f X 1 Can you identify this population distribution? (b) For a simple random sample of size n determine the probability that n f X 0 (c) Under the assumption of i.i.d. sampling, determine the probability that n f X 0 5.4.5 Suppose the following sample of size of n process. x x 20 is obtained from an industrial 4 (with replacement) from the population in and a measurement X : N and 3 and 3 and a) Construct a density histogram for this data set using the intervals 1 4 5] 4 5 5 5] 5 5 6 5] 6 5 10] (b) Construct a density histogram for this data set using the intervals 1 3 5] 3 5 4 5] 4 5 6 5] 6 5 10] (c) Based on the results of parts (a) and (b), what do you conclude about histograms? 5.4.6 Suppose it is known that in a population of 1000 students, 350 students will vote for party A 550 students will vote for party B and the remaining students will vote for party C (a) Explain how such information can be obtained. (b) If we let X : A B C be such that X then explain why we cannot represent the population distribution of X by FX (c) Compute f X (d) Explain how one might go about estimating f X prior to the election. (e) What is unrealistic about the population distribution specified via f X? (Hint: Does it seem realistic, based on what you know about voting behavior?) is the party that will vote for, Chapter 5: Statistical Inference 279, the variable X, and f X What kind of variable is X? to be files stored on
a computer at a particular time. is the type of file as indicated by its extension, e.g.,.mp3. Is X a 5.4.7 Consider the population Suppose that X categorical or quantitative variable? 5.4.8 Suppose that you are asked to estimate the proportion of students in a college of 15 000 students who intend to work during the summer. (a) Identify the population (b) How could you determine f X exactly? (c) Why might you not be able to determine f X exactly? Propose a procedure for estimating f X in such a situation. (d) Suppose you were also asked to estimate the proportion of students who intended to work but could not find a job. Repeat parts (a), (b), and (c) for this situation. 5.4.9 Sometimes participants in a poll do not respond truthfully to a question. For example, students who are asked “Have you ever illegally downloaded music?” may not respond truthfully even if they are assured that their responses are confidential. Suppose a simple random sample of students was chosen from a college and students were asked this question. (a) If students were asked this question by a person, comment on how you think the results of the sampling study would be affected. (b) If students were allowed to respond anonymously, perhaps by mailing in a ques­ tionnaire, comment on how you think the results would be affected. (c) One technique for dealing with the respondent bias induced by such questions is to have students respond truthfully only when a certain random event occurs. For example, we might ask a student to toss a fair coin three times and lie whenever they obtain two heads. What is the probability that a student tells the truth? Once you have completed the study and have recorded the proportion of students who said they did cheat, what proportion would you record as your estimate of the proportion of students who actually did cheat? 5.4.10 A market research company is asked to determine how satisfied owners are with their purchase of a new car in the last 6 months. Satisfaction is to be measured by re­ spondents choosing a point on a seven­point scale 1 2 3 4 5 6 7, where 1 denotes completely dissatisfied and 7 denotes completely satisfied (such a scale is commonly called a Likert scale). (a) Identify
(b) It is common to treat a variable such as X as a quantitative variable. Do you think this is correct? Would it be correct to treat X as a categorical variable? (c) A common criticism of using such a scale is that the interpretation of a statement such as 3 “I’m somewhat dissatisfied” varies from one person to another. Comment on how this affects the validity of the study., the variable X, and f X COMPUTER EXERCISES 5.4.11 Generate a sample of 1000 from an N 3 2 distribution. (a) Calculate FX for this sample. 280 Section 5.4: Data Collection 5 10 5 10 (b) Plot a density histogram based on these data using the intervals of length 1 over the range (c) Plot a density histogram based on these data using the intervals of length 0 1 over the range (d) Comment on the difference in the look of the histograms in parts (b) and (c). To what do you attribute this? (e) What limits the size of the intervals we use to group observations when we are plotting histograms? 5.4.12 Suppose we have a population of 10,000 elements, each with a unique label from the set 1 2 3 (a) Generate a sample of 500 labels from this population using simple random sam­ pling. (b) Generate a sample of 500 labels from this population using i.i.d. sampling. 10 000. PROBLEMS 1 0 f2 f2 : and N and f1 and f X 2 f1 and f X 2 f X 1 and f X 2 and a measurement X : 0 1 2, b This problem 5.4.13 Suppose we have a finite population where generalizes Exercise 5.4.4. (a) Determine f X 0 (b) For a simple random sample of size n determine the probability that f0 (c) Under the assumption of i.i.d. sampling, determine the probability that f0 5.4.14 Suppose X is a quantitative measurement defined on a finite population. (a) Prove that the population mean equals over all population elements X. (b) Prove that the population variance is given by 2 X average of X 5.4.15 Suppose we have the situation described in Exercise 5.4.4, and we take
a simple random sample of size n from where (a) Prove that the mean of f X 0 is given by f X 0 n f X 0 and b) Prove that the variance of f X 0 is given by (Hint: Note that we can write ) 2 over all population elements i.e., the average of X x x equals x x f X x Bernoulli 2 f X x i.e., the equals 5.4.1) (Hint: Use the hint in part (a), but note that the I 0 X i Theorem 3.3.4(b) and evaluate Cov I 0 X i (c) Repeat the calculations in parts (a) and (b), but this time assume that you take a sample of n with replacement. (Hint: Use Exercise 5.4.4(c).) (d) Explain why the factor N correction factor. are not independent. Use in terms of f X 0.) 1 in (5.4.1) is called the finite population I 0 X i n N Chapter 5: Statistical Inference 281 and we do not know N In 0 1 and we know a where a is known Based on a simple random sample of n from 5.4.16 Suppose we have a finite population addition, suppose we have a measurement variable X : that N f X 0 determine an estimator of N (Hint: Use a function of f X 0 ) 5.4.17 Suppose that X is a quantitative variable defined on a population take a simple random sample of size n from (a) If we estimate the population mean prove that E X distribution of each X i?) (b) Under the assumption that i.i.d. sampling makes sense, show that the variance of X equals 5.4.18 Suppose we have a finite population addition, suppose we have a measurement variable X : Based on a simple random sample of n from X is defined in Problem 5.4.14(a). (Hint: What is the R1 and we know T determine an estimator of 2 X is defined in Problem 5.4.14(b). X by the sample mean X and we do not know 2 X n, where n i 1 X i and that we X where N In 1 n X N (Hint: Use a function of X ) 5.4.19
Under i.i.d. sampling, prove that as n (Hint: f X x CHALLENGES i 1 1 and into two subpopulations and that we can partition 5.4.20 (Stratified sampling) Suppose that X is a quantitative variable defined on a pop­ ulation 2, such that a proportion p of the full population is in 1 Let fi X denote the conditional population distribution of X on (a) Prove that f X x (b) Establish that 2X, where 2 (c) Establish that p 1 2X (d) Suppose that it makes sense to assume i.i.d. sampling whenever we take a sample from either the full population or either of the subpopulations, i.e., whenever the sam­ ple sizes we are considering are small relative to the sizes of these populations. We implement stratified sampling by taking a simple random sample of size ni from sub­ p X2, where Xi is the sample population mean based on the sample from i Prove that E pX1 i X is the mean of X on p p f1X x p 1X p 2 1X i We then estimate X by p X1 p f2X x p X2 1 1 p p X 2 X 2X 1X 1 1 2 X and i Var pX1 1 p X2 p2 2 1X n1 1 p 2 2 2X n2 (e) Under the assumptions of part (d), prove that Var pX1 1 p X2 Var X pn n2 when X is based on a simple random sample of size n from the full population and n1 (f) Under what conditions is there no benefit to proportional stratified sampling? What do you conclude about situations in which stratified sampling will be most beneficial? p n This is called proportional stratified sampling. 1 282 Section 5.5: Some Basic Inferences DISCUSSION TOPICS 5.4.21 Sometimes it is argued that it is possible for a skilled practitioner to pick a more accurate representative sample of a population deterministically rather than by employ­ ing simple random sampling. This argument is based in part on the argument that it is always possible with simple random sampling that we could get a very unrepresenta­ tive sample through pure chance and that this can be avoided
by an expert. Comment on this assertion. 5.4.22 Suppose it is claimed that a quantitative measurement X defined on a finite population is approximately distributed according to a normal distribution with un­ known mean and unknown variance. Explain fully what this claim means. 5.5 Some Basic Inferences Now suppose we are in a situation involving a measurement X whose distribution is unknown, and we have obtained the data x1 x2 i.e., observed n values of X Hopefully, these data were the result of simple random sampling, but perhaps they were collected as part of an observational study. Denote the associated unknown population relative frequency function, or an approximating density, by f X and the population distribution function by FX. xn What we do now with the data depends on two things. First, we have to determine what we want to know about the underlying population distribution. Typically, our interest is in only a few characteristics of this distribution — the mean and variance. Second, we have to use statistical theory to combine the data with the statistical model to make inferences about the characteristics of interest. We now discuss some typical characteristics of interest and present some informal estimation methods for these characteristics, known as descriptive statistics. These are often used as a preliminary step before more formal inferences are drawn and are justified on simple intuitive grounds. They are called descriptive because they are estimating quantities that describe features of the underlying distribution. 5.5.1 Descriptive Statistics Statisticians often focus on various characteristics of distributions. We present some of these in the following examples. EXAMPLE 5.5.1 Estimating Proportions and Cumulative Proportions Often we want to make inferences about the value f X x or the value FX x for a specific x Recall that f X x is the proportion of population members whose X mea­ surement equals x In general, FX x is the proportion of population members whose X measurement is less than or equal to x Now suppose we have a sample x1 x2 from f X. A natural estimate of f X x is given by f X x, the proportion of sample values equal to x A natural estimate of FX x is given by FX x the proportion of sample values less than or equal to x otherwise known as the empirical distribution function evaluated at x n i 1 I x] xi n 1 xn Chapter 5: Statistical Inference 283 Suppose we obtained the following sample of n 10 data
values In this case, f X x 0 1 whenever x is a data value and is 0 otherwise. To compute FX x we simply count how many sample values are less than or equal to x and divide by n 0 2, and FX 4 10. For example, FX 0 FX 0 9 10 0 10 2 10 0 9. 3 An important class of characteristics of the distribution of a quantitative variable X is given by the following definition. [0 1], the pth quantile (or 100 pth percentile) x p for Definition 5.5.1 For p the distribution with cdf FX is defined to be the smallest number x p satisfying p FX x p For example, if your mark on a test placed you at the 90th percentile, then your mark equals x0 9 and 90% of your fellow test takers achieved your mark or lower. Note that by the definition of the inverse cumulative distribution function (Definition 2.10.1), we FX x can write x p min x : p When FX is strictly increasing and continuous, then F 1 X p is the unique value x p F 1 X p satisfying FX x p p. (5.5.1) Figure 5.5.1 illustrates the situation in which there is a unique solution to (5.5.1). When FX is not strictly increasing or continuous (as when X is discrete), then there may be more than one, or no, solutions to (5.5.1). Figure 5.5.2 illustrates the situation in which there is no solution to (5.5.1). FX 1 p Figure 5.5.1: The pth quantile x p when there is a unique solution to (5.5.1). xp x 284 Section 5.5: Some Basic Inferences FX 1 p Figure 5.5.2: The pth quantile x p determined by a cdf FX when there is no solution to (5.5.1). xp x So, when X is a continuous measurement, a proportion p of the population have F 1 X 0 5 0 75 are the first and third their X measurement less than or equal to x p. As particular cases, x0 5 is the median, while x0 25 quartiles, respectively, of the distribution. 0 25 and x0 75 F 1 X F 1 X EXAMPLE 5.
5.2 Estimating Quantiles A natural estimate of a population quantile x p p. Note, however, that FX is not continuous, so there may not be a solution to (5.5.1) using FX. Applying Definition 5.5.1, however, leads to the following estimate. First, order the x n (see is the i n ­th quantile of the empirical distribution, xn to obtain the order statistics x 1 p is to use x p observed sample values x1 Section 2.8.4). Then, note that x i because F 1 X F 1 X FX x i i n and FX x is x p x i whenever i n whenever x x i. In general, we have that the sample pth quantile i 1 n p i n. (5.5.2) A number of modifications to this estimate are sometimes used. For example, if we find i such that (5.5.2) is satisfied and put 5.5.3) then x p is the linear interpolation between x i 1 and x i. When n is even, this defin­ ition gives the sample median as x0 5 x n 2 ; a similar formula holds when n is odd (Problem 5.5.21). Also see Problem 5.5.22 for more discussion of (5.5.3). Quite often the sample median is defined to be x0 odd n even, (5.5.4) Chapter 5: Statistical Inference 285 namely, the middle value when n is odd and the average of the two middle values when n is even. For n large enough, all these definitions will yield similar answers. The use of any of these is permissible in an application. Consider the data in Example 5.5.1. Sorting the data from smallest to largest, the order statistics are given by the following table 10 1 5 5 0 Then, using (5.5.3), the sample median is given by x0 5 quartiles are given by x 5 1 5, while the sample x0 25 x 2 0 3 10 x 3 10 0 4 x 2 0 25 0 2 0 3 0 25 0 2 0 05 and x0 75 x 7 2 2 10 x 8 10 3 3 0 75 x 7 2 2 0 75 0 7 0 7
2 75 So in this case, we estimate that 25% of the population under study has an X measure­ ment less than 0.05, etc. EXAMPLE 5.5.3 Measuring Location and Scale of a Population Distribution Often we are asked to make inferences about the value of the population mean and the population variance X 1 2 X 1 X X 2 X where is a finite population and X is a real­valued measurement defined on it. These are measures of the location and spread of the population distribution about the mean, respectively. Note that calculating a mean or variance makes sense only when X is a quantitative variable. When X is discrete, we can also write x f X x X x because f X x equals the number of elements continuous case, using an approximating density f X we can write with X x In the X x f X x dx Similar formulas exist for the population variance of X (see Problem 5.4.14). 286 Section 5.5: Some Basic Inferences It will probably occur to you that a natural estimate of the population mean X is given by the sample mean x 1 n n i 1 xi Also, a natural estimate of the population variance 2 X is given by the sample variance s2 n 1 n 1 xi x 2 (5.5.5) i 1 Later we will explain why we divided by n 1 in (5.5.5) rather than n. Actually, it makes little difference which we use, for even modest values of n The sample standard deviation is given by s the positive square root of s2 For the data in Example 5.1.1, we obtain x 2 097 X and population standard deviation X serve as a pair, in which X measures where the distribution is located on the real line and X measures X Clearly, the greater the value of how much spread there is in the distribution about 1 73 and s The population mean X the more variability there is in the distribution. Alternatively, we could use the population median x0 5 as a measure of location of the distribution and the population interquartile range x0 75 x0 25 as a measure of the amount of variability in the distribution around the median. The median and interquartile range are the preferred choice to measure these aspects of the distribution whenever the distribution is skewed, i.e., not symmetrical. This is because the median is insensitive to very extreme values, while the mean is not. For example, house prices
in an area are well known to exhibit a right­skewed distribution. A few houses selling for very high prices will not change the median price but could result in a big change in the mean price. When we have a symmetric distribution, the mean and median will agree (provided the mean exists). The greater the skewness in a distribution, however, the greater will be the discrepancy between its mean and median. For example, in Figure 5.5.3 we have 2 4 distribution. This distribution is skewed to the right, and plotted the density of a the mean is 4 while the median is 3.3567. 0.03 f 0.02 0.01 0.00 0 5 10 15 20 x Figure 5.5.3: The density f of a 2 4 distribution. Chapter 5: Statistical Inference 287 (IQR) given by I Q R sample median to be x0 5 We estimate the population interquartile range by the sample interquartile range x0 25. For the data in Example 5.5.1, we obtain the x0 75 If we change the largest value in the sample from x 10 500 0 the 1 5 but note that the sample mean goes from 1.73 to 1 5 while I Q R 2 75 0 05 2 70. 5 0 to x 10 sample median remains x0 5 51.23! 5.5.2 Plotting Data It is always a good idea to plot the data. For discrete quantitative variables, we can plot f X i.e., plot the sample proportions (relative frequencies). For continuous quantitative variables, we introduced the density histogram in section 5.4.3. These plots give us some idea of the shape of the distribution from which we are sampling. For example, we can see if there is any evidence that the distribution is strongly skewed. We now consider another very useful plot for quantitative variables. EXAMPLE 5.5.4 Boxplots and Outliers Another useful plot for quantitative variables is known as a boxplot. For example, Figure 5.5.4 gives a boxplot for the data in Example 5.5.1. The line in the center of the box is the median. The line below the median is the first quartile, and the line above the median is the third quartile. The vertical lines from the quartiles are called whiskers, which run from the quar­ tiles to the adjacent values. The adjacent values are given by the greatest value
less than or equal to the upper limit (the third quartile plus 1.5 times the I Q R) and by the least value greater than or equal to the lower limit (the first quartile minus 1.5 times the I Q R). Values beyond the adjacent values, when these exist, are plotted with a ; in this case, there are none. If we changed x 10 15 0 however, we 5 0 to x 10 see this extreme value plotted as a, as shown in Figure 5.5.5. 5 4 3 2 1 0 ­1 ­2 Figure 5.5.4: A boxplot of the data in Example 5.5.1. 288 Section 5.5: Some Basic Inferences 15 10 5 0 Figure 5.5.5: A boxplot of the data in Example 5.5.1, changing x 10 x 10 15 0. 5 0 to Points outside the upper and lower limits, and thus plotted by, are commonly referred to as outliers. An outlier is a value that is extreme with respect to the rest of the observations. Sometimes outliers occur because a mistake has been made in collecting or recording the data, but they also occur simply because we are sampling from a long­tailed distribution. It is often difficult to ascertain which is the case in a particular application, but each such observation should be noted. We have seen in Example 5.5.3 that outliers can have a big impact on statistical analyses. Their effects should be recorded when reporting the results of a statistical analysis. For categorical variables, it is typical to plot the data in a bar chart, as described in the next example. EXAMPLE 5.5.5 Bar Charts For categorical variables, we code the values of the variable as equispaced numbers and then plot constant­width rectangles (the bars) over these values so that the height of the rectangle over a value equals the proportion of times that value is assumed. Such a plot is called a bar chart. Note that the values along the x­axis are only labels and not to be treated as numbers that we can do arithmetic on, etc. For example, suppose we take a simple random sample of 100 students and record their favorite avor of ice cream (from amongst four possibilities), obtaining the results given in the following table. Flavor Chocolate Vanilla Butterscotch Strawberry Count 42 28 22 8 Proportion 0.42 0.28 0
.22 0.08 Coding Chocolate as 1, Vanilla as 2, Butterscotch as 3, and Strawberry as 4, Figure 5.5.6 presents a bar chart of these data. It is typical for the bars in these charts not to touch. Chapter 5: Statistical Inference 289.4 0.3 0.2 0.1 1 2 3 4 Flavor Figure 5.5.6: A bar chart for the data of Example 5.5.5. 5.5.3 Types of Inferences Certainly quoting descriptive statistics and plotting the data are methods used by a sta­ tistician to try to learn something about the underlying population distribution. There are difficulties with this approach, however, as we have just chosen these methods based on intuition. Often it is not clear which descriptive statistics we should use. Further­ more, these data summaries make no use of the information we have about the true pop­ ulation distribution as expressed by the statistical model, namely, f X Taking account of this information leads us to develop a theory of statistical inference, i.e., to specify how we should combine the model information together with the data to make inferences about population quantities. We will do this in Chapters 6, 7, and 8, but first we discuss the types of inferences that are commonly used in applications. : f In Section 5.2, we discussed three types of inference in the context of a known probability model as specified by some density or probability function f We noted that we might want to do any of the following concerning an unobserved response value s. (i) Predict an unknown response value s via a prediction t. (ii) Construct a subset C of the sample space S that has a high probability of containing an unknown response value s. (iii) Assess whether or not s0 specified by f S is a plausible value from the probability distribution We refer to (i), (ii), and (iii) as inferences about the unobserved s The examples of Section 5.2 show that these are intuitively reasonable concepts. In an application, we do not know f ; we know only that f observe the data s. We are uncertain about which candidate f lently, which of the possible values of is correct. As mentioned in Section 5.5.1, our primary goal may be to determine not the true but some characteristic of the true distribution such
as its mean, median, or the, and we is correct, or, equiva­ : f f 290 Section 5.5: Some Basic Inferences value of the true distribution function F at a specified value. We will denote this characteristic of interest by. For example, when the characteristic of interest is the mean of the true distribution of a continuous random variable, then x f x dx Alternatively, we might be interested in tion of a random variable with distribution function given by F. F 1 0 5, the median of the distribu­ Different values of. After observing the data s, we want to make inferences about what the correct value is. We will consider the three types of inference for lead to possibly different values for the characteristic. (i) Choose an estimate T s of referred to as the problem of estimation. (ii) Construct a subset C s of the set of possible values for that we believe contains the true value, referred to as the problem of credible region or confidence region construction. (iii) Assess whether or not referred to as the problem of hypothesis assessment. 0 is a plausible value for after having observed s So estimates, credible or confidence regions, and hypothesis assessment are examples of types of inference. In particular, we want to construct estimates T s of construct credible or confidence regions C s for 0 for hypothesized value and assess the plausibility of a. The problem of statistical inference entails determining how we should combine and the data s to carry out these inferences f : the information in the model about. A very important statistical model for applications is the location­scale normal model introduced in Example 5.3.4. We illustrate some of the ideas discussed in this section via that model. EXAMPLE 5.5.6 Application of the Location­Scale Normal Model Suppose the following simple random sample of the heights (in inches) of 30 students has been collected. 64 9 64 9 61 6 61 4 64 3 64 0 66 3 62 5 61 5 64 3 63 1 64 2 65 1 65 0 66 8 64 4 65 8 66 4 59 8 63 4 65 8 63 6 61 9 71 4 66 5 66 6 67 8 65 0 60 9 66 3 The statistician believes that the distribution of heights in the population can be well approximated by a normal distribution with some unknown mean and variance, and she is unwilling to make any further assumptions about the true distribution. Accord­ 2 distributions,
where ingly, the statistical model is given by the family of N 2 R1 R is unknown. Does this statistical model make sense, i.e., is the assumption of normality appro­ priate for this situation? The density histogram (based on 12 equal­length intervals from 59.5 to 71.5) in Figure 5.5.7 looks very roughly normal, but the extreme observa­ tion in the right tail might be some grounds for concern. In any case, we proceed as if Chapter 5: Statistical Inference 291 this assumption is reasonable. In Chapter 9, we will discuss more refined methods for assessing this assumption. 0.2 y t i s n e D 0.1 0.0 60 65 heights 70 Figure 5.5.7: Density histogram of heights in Example 5.5.6. 2 2 z0 90 then P X Suppose we are interested in making inferences about the population mean height, Alternatively, we might want to namely, the characteristic of interest is make inferences about the 90th percentile of this distribution, i.e., x0 90 z0 90 where z0 90 is the 90th percentile of the N 0 1 distribution (when X 2 N 0 90). P X So 90% of the population under study have height less than x0 90 a value unknown 2. Obviously, there are many other to us because we do not know the value of characteristics of the true distribution about which we might want to make inferences. and T x1 z0 90. To justify the choice of these estimates, we will need the theories developed in later chapters. In this 2 379 From Table D.2 case, we obtain x we obtain z0 90 xn sz0 90 seems like a sensible estimate of Just using our intuition, T x1 x 64 517 and from (5.5.5) we compute s x seems like a sensible estimate of 1 2816, so that z0 90 z0 90 xn x sz0 90 64 517 2 379 1 2816 67 566. How accurate is the estimate x of? A natural approach to answering this question is to construct a credible interval, based on the estimate, that we believe has a high probability of containing the true value of and is as short as possible For example, the theory in Chapter 6 leads to using confidence intervals for of the form [x sc x sc] for some choice of the constant c
. Notice that x is at the center of the interval. The 0 3734 leads to what is theory in Chapter 6 will show that, in this case, choosing c known as a 0 95­confidence interval for We then take the half­length of this interval, namely, sc 2 379 0 373 4 0 888, 292 Section 5.5: Some Basic Inferences as a measure of the accuracy of the estimate x enough information to say that we know the true value of with “confidence” equal to 0.95. 64 517 of In this case, we have to within one inch, at least Finally, suppose we have a hypothesized value 0 for the population mean height. For example, we may believe that the mean height of the population of individuals under study is the same as the mean height of another population for which this quantity 65 Then, based on the observed sample of heights we want is known to equal to assess whether or not the value 65 makes sense. If the sample mean height x is far from 0 this would seem to be evidence against the hypothesized value. In Chapter 6, we will show that we can base our assessment on the value of 0 0 t x s 0 n 64 517 2 379 65 30 1 112. If the value of t the hypothesized value 0 and we will do this in Chapter 6. It turns out that t when the true value of is very large, then we will conclude that we have evidence against 65. We have to prescribe what we mean by large here, 1 112 is a plausible value for t, equals 65, so we have no evidence against the hypothesis. Summary of Section 5.5 Descriptive statistics represent informal statistical methods that are used to make inferences about the distribution of a variable X of interest, based on an observed sample from this distribution. These quantities summarize characteristics of the observed sample and can be thought of as estimates of the corresponding un­ known population quantities. More formal methods are required to assess the error in these estimates or even to replace them with estimates having greater accuracy. It is important to plot the data using relevant plots. These give us some idea of the shape of the population distribution from which we are sampling. There are three main types of inference: estimates, credible or confidence inter­ vals, and hypothesis assessment. EXERCISES 5.5.1 Suppose the following data are obtained by recording X the number of cus­ tomers that arrive at
an automatic banking machine during 15 successive one­minute time intervals and f X 4 (a) Record estimates of f X 0 (b) Record estimates of FX 0 FX 1 FX 2 FX 3 and FX 4 (c) Plot f X. (d) Record the mean and variance. f X 1 f X 2 Chapter 5: Statistical Inference 293 (e) Record the median and IQR and provide a boxplot. Using the rule prescribed in Example 5.5.4, decide whether there are any outliers. 5.5.2 Suppose the following sample of waiting times (in minutes) was obtained for customers in a queue at an automatic banking machine. 15 5 10 a) Record the empirical distribution function. (b) Plot f X. (c) Record the mean and variance. (d) Record the median and IQR and provide a boxplot. Using the rule given in Example 5.5.4, decide whether there are any outliers. 5.5.3 Suppose an experiment was conducted to see whether mosquitoes are attracted differentially to different colors. Three different colors of fabric were used and the number of mosquitoes landing on each piece was recorded over a 15­minute interval. The following data were obtained. Color 1 Color 2 Color 3 Number of landings 25 35 22 f X 2 and f X 3 where we use i for color i. (a) Record estimates of f X 1 (b) Does it make sense to estimate FX i? Explain why or why not. (c) Plot a bar chart of these data. 5.5.4 A student is told that his score on a test was at the 90th percentile in the popula­ tion of all students who took the test. Explain exactly what this means. 5.5.5 Determine the empirical distribution function based on the sample given below Plot this function. Determine the sample median, the first and third quartiles, and the interquartile range. What is your estimate of F 1? 5.5.6 Consider the density histogram in Figure 5.5.8. If you were asked to record measures of location and spread for the data corresponding to this plot, what would you choose? Justify your answer. 5.5.7 Suppose that a statistical model is given by the family of N where inferences about the first quartile of the true distribution, then determine 2 5.5.8 Suppose that a statistical model is given by the family of N
0 distributions where If our interest is in making inferences about the third moment of the distribution, then determine 2 0 distributions If our interest is in making R1 is unknown, while R1 is unknown, while 2 0 is known. 2 0 is known. 294 Section 5.5: Some Basic Inferences 2 2 2 R1 R1 2 0 is known. R1 is unknown, while 2 0 distributions If our interest is in making 2 distributions R is unknown. If our interest is in making inferences 2 distributions R is unknown. If our interest is in making inferences 5.5.9 Suppose that a statistical model is given by the family of N where inferences about the distribution function evaluated at 3, then determine 5.5.10 Suppose that a statistical model is given by the family of N where about the first quartile of the true distribution, then determine 5.5.11 Suppose that a statistical model is given by the family of N where about the distribution function evaluated at 3, then determine 5.5.12 Suppose that a statistical model is given by the family of Bernoulli tions where that two independent observations from this model are the same, then determine distribu­ 5.5.13 Suppose that a statistical model is given by the family of Bernoulli tions where [0 1]. If our interest is in making inferences about the probability that in two independent observations from this model we obtain a 0 and a 1, then de­ termine ] dis­ 5.5.14 Suppose that a statistical model is given by the family of Uniform[0 tributions where If our interest is in making inferences about the coefficient of variation (see Exercise 5.3.5) of the true distribution, then determine distribu­ [0 1]. If our interest is in making inferences about the probability 0 2 What do you notice about this characteristic? 5.5.15 Suppose that a statistical model is given by the family of Gamma butions where variance of the true distribution, then determine distri­ If our interest is in making inferences about the 0 0 0.3 0.2 0.1 0.0 0 5 10 Figure 5.5.8: Density histogram for Exercise 5.5.6. COMPUTER EXERCISES 5.5.16 Do the following based on the data in Exercise 5.4.5. (a) Compute the order statistics for these data.
(b) Calculate the empirical distribution function at the data points. Chapter 5: Statistical Inference 295 (c) Calculate the sample mean and the sample standard deviation. (d) Obtain the sample median and the sample interquartile range. (e) Based on the histograms obtained in Exercise 5.4.5, which set of descriptive statis­ tics do you feel are appropriate for measuring location and spread? (f) Suppose the first data value was recorded incorrectly as 13.9 rather than as 3.9. Repeat parts (c) and (d) using this data set and compare your answers with those previ­ ously obtained. Can you draw any general conclusions about these measures? Justify your reasoning. 5.5.17 Do the following based on the data in Example 5.5.6. (a) Compute the order statistics for these data. (b) Plot the empirical distribution function (only at the sample points). (c) Calculate the sample median and the sample interquartile range and obtain a box­ plot. Are there any outliers? (d) Based on the boxplot, which set of descriptive statistics do you feel is appropriate for measuring location and spread? (e) Suppose the first data value was recorded incorrectly as 84.9 rather than as 64.9. Repeat parts (c) and (d) using this data set and see whether any observations are deter­ mined to be outliers. 5.5.18 Generate a sample of 30 from an N 10 2 distribution and a sample of 1 from an N 30 2 distribution. Combine these together to make a single sample of 31 (a) Produce a boxplot of these data. (b) What do you notice about this plot? (c) Based on the boxplot, what characteristic do you think would be appropriate to measure the location and spread of the distribution? Explain why. 5.5.19 Generate a sample of 50 from a (a) Produce a boxplot of these data. (b) What do you notice about this plot? (c) Based on the boxplot, what characteristic do you think would be appropriate to measure the location and spread of the distribution? Explain why. 5.5.20 Generate a sample of 50 from an N 4 1 distribution. Suppose your interest is 4 and in estimating the 90th percentile x0 9 of this distribution and we pretend that 2 1 distribution
. 1 are unknown. (a) Compute an estimate of x0 9 based on the appropriate order statistic. (b) Compute an estimate based on the fact that x0 9 percentile of the N 0 1 distribution. (c) If you knew, or at least were willing to assume, that the sample came from a normal distribution, which of the estimates in parts (a) or (b) would you prefer? Explain why. z0 9 where z0 9 is the 90th PROBLEMS 5.5.21 Determine a formula for the sample median, based on interpolation (i.e., using (5.5.3)) when n is odd. (Hint: Use the least integer function or ceiling x smallest integer greater than or equal to x ) 296 Section 5.5: Some Basic Inferences 5.5.22 An alternative to the empirical distribution function is to define a distribution function F by F x and if x 1 if x if for i 1 F x i if x i x (a) Show that F x i for i (b) Prove that F is continuous on x 1 (c) Show that, for p p. F x p [1 n 1 1 n and is increasing from 0 to 1. and right continuous everywhere. the value x p defined in (5.5.3) is the solution to DISCUSSION TOPICS 5.5.23 Sometimes it is argued that statistics does not need a formal theory to prescribe inferences. Rather, statistical practice is better left to the skilled practitioner to decide what is a sensible approach in each problem. Comment on these statements. 5.5.24 How reasonable do you think it is for an investigator to assume that a random variable is normally distributed? Discuss the role of assumptions in scientific mod­ elling. Chapter 6 Likelihood Inference CHAPTER OUTLINE Section 1 The Likelihood Function Section 2 Maximum Likelihood Estimation Section 3 Section 4 Distribution­Free Methods Section 5 Inferences Based on the MLE Large Sample Behavior of the MLE (Advanced) In this chapter, we discuss some of the most basic approaches to inference. In essence, we want our inferences to depend only on the model P : and the data s. These methods are very minimal in the sense that they require few assumptions. While successful for certain problems, it seems that the additional structure of Chapter 7 or Chapter 8 is necessary in more involved situations
. The likelihood function is one of the most basic concepts in statistical inference. Entire theories of inference have been constructed based on it. We discuss likeli­ hood methods in Sections 6.1, 6.2, 6.3, and 6.5. In Section 6.4, we introduce some distribution­free methods of inference. These are not really examples of likelihood methods, but they follow the same basic idea of having the inferences depend on as few assumptions as possible. 6.1 The Likelihood Function Likelihood inferences are based only on the data s and the model P : — the set of possible probability measures for the system under investigation From these ingredients we obtain the basic entity of likelihood inference, namely, the likelihood function. To motivate the definition of the likelihood function, suppose we have a statistical model in which each P is discrete, given by probability function f Having observed s consider the function L and taking values in R1, given by s defined on the parameter space L s f s 297 298 Section 6.1: The Likelihood Function We refer to L The value L we are fixing the data and varying the value of the parameter. s as the likelihood function determined by the model and the data. s is called the likelihood of Note that for the likelihood function, over 2 whenever f 1 s This imposes a belief ordering on We see that f of the parameter is the true value of says that the data are more likely under 2 whenever f 1 s s is just the probability of obtaining the data s when the true value, namely, we believe in 1 as f 2 s This is because the inequality 1 than 2 We are indifferent between 1 and is based on this ordering. s s The value L is the true value — it is not the probability of given s is very small for So it is not the actual value of the likelihood that is telling us how, but rather its value relative to the likelihoods of is the probability of s given that that we have observed s Also, it is possible that the value of L every value of much support to give to a particular other possible parameter values. It is important to remember the correct interpretation of L f 2 s. Likelihood inference about EXAMPLE 6.1.1 Suppose S 1 2 the uniform distribution on the integers 1 on 1 and L 2 10 ports and that the statistical model is P : where P1 is 103 and P2 is the uniform distribution 1 103 Further suppose that we
observe s 10. Then L 1 10 1 106. Both values are quite small, but note that the likelihood sup­ 1 a thousand times more than it supports 106 1 2 2. Accordingly, we are only interested in likelihood ratios L L 1 s 2 s 1 2 based on the likelihood for when it comes to determining inferences for i.e., function This implies that any function that is a positive multiple of L L 0 can serve equally well as a likelihood function. We call two likelihoods equivalent if they are proportional in this way. In general, we refer to any positive multiple of L s as a likelihood function. for some fixed c cL s s s EXAMPLE 6.1.2 4 heads are observed. With Suppose that a coin is tossed n no knowledge whatsoever concerning the probability of getting a head on a single model with toss, the appropriate statistical model for the data is the Binomial 10 10 times and that s [0 1] The likelihood function is given by L 4 10 4 4 1 6 (6.1.1) which is plotted in Figure 6.1.1. This likelihood peaks at 0 4 and takes the value 0.2508 there. We will ex­ amine uses of the likelihood to estimate the unknown and assess the accuracy of the estimate. Roughly speaking, however, this is based on where the likelihood takes its maximum and how much spread there is in the likelihood about its peak. Chapter 6: Likelihood Inference 299 0.25 L 0.20 0.15 0.10 0.05 0.00 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 theta Figure 6.1.1: Likelihood function from the Binomial 10 model when s 4 is observed. There is a range of approaches to obtaining inferences via the likelihood function. At one extreme is the likelihood principle. Likelihood Principle: If two model and data combinations yield equivalent likelihood functions, then inferences about the unknown parameter must be the same. This principle dictates that anything we want to say about the unknown value of must be based only on L proscription. Consider the following example. For many statisticians, this is viewed as a very severe s EXAMPLE 6.1.3 Suppose a coin is tossed in independent tosses until four heads are obtained and the number of tails observed until the fourth head is s 6 Then s is distributed Negative
­ Binomial 4, and the likelihood specified by the observed data is L 6 9 6 4 1 6 Note that this likelihood function is a positive multiple of (6.1.1). So the likelihood principle asserts that these two model and data combinations must yield the same inferences about the unknown. In effect, the likelihood principle says we must ignore the fact that the data were obtained in entirely different ways. If, how­ ever, we take into account additional model features beyond the likelihood function, then it turns out that we can derive different inferences for the two situations. In partic­ ular, assessing a hypothesized value 0 can be carried out in different ways when the sampling method is taken into account. Many statisticians believe this additional information should be used when deriving inferences. 300 Section 6.1: The Likelihood Function As an example of an inference derived from a likelihood function, consider a set of the form C s : L s c for some c 0 The set C s is referred to as a likelihood region. It contains all those values for which their likelihood is at least c A likelihood region, for some c, seems C s, like a sensible set to quote as possibly containing the true value of then L C s and so is not as well­supported by the observed data as any value in C s. The size of C s can then be taken as a measure of how uncertain we are about the true value of s for every. For, if L s. We are left with the problem, however, of choosing a suitable value for c and, as Example 6.1.1 seems to indicate, the likelihood itself does not suggest a natural way to do this. In Section 6.3.2, we will discuss a method for choosing c that is based upon additional model properties beyond the likelihood function. So far in this section, we have assumed that our statistical models are comprised s of discrete distributions. The definition of the likelihood is quite natural, as L is simply the probability of s occurring when is the true value. This interpretation is clearly not directly available, however, when we have a continuous model because every data point has probability 0 of occurring. Imagine, however, that f 1 s f 2 s and that s R1 Then, assuming the continuity of every f at s we have P 1 V b a f 1 s dx P 2 V b a f 2 s dx for every interval V a b containing s that is small enough.
We interpret this to mean that the probability of s occurring when 1 is true is greater than the probability of s occurring when 2 is true. So the data s support 1 more than 2 A similar interpretation applies when s 1 and V is a region containing s Rn for n s and interpret the ordering this imposes on the values of Therefore, in the continuous case, we again define the likelihood function by L f s exactly as we do in the discrete case.1 Again, two likelihoods will be considered equivalent if one is a positive multiple of the other. Now consider a very important example. EXAMPLE 6.1.4 Location Normal Model Suppose that x1 xn (i.i.d.) sample from an N 2 0 distribution where 0 is known. The likelihood function is given by 2 0 is an observed independently and identically distributed R1 is unknown and L x1 xn n i 1 f xi n i 1 2 2 0 1 2 exp 1 2 2 0 xi 2 1Note, however, that whenever we have a situation in which f 1 s f 2 s we could still have P 1 V 1 is supported more than 2 rather than these two values having equal support, as implied by the likelihood. This phenomenon does not occur in the examples we discuss, so we will ignore it here. P 2 V for every V containing s and small enough. This implies that Chapter 6: Likelihood Inference 301 and clearly this simplifies to L x1 xn 2 2 2 0 2 0 n 2 exp n 2 exp xi 2 2 exp n 1 2 2 0 s2 An equivalent, simpler version of the likelihood function is then given by L x1 xn exp n 2 2 0 x 2 and we will use this version. For example, suppose n plotted in Figure 6.1.2. 25 2 0 1 and we observe x 3 3 This function is 1.0 L 0.8 0.6 0.4 0.2 0.0 2 3 4 5 theta Figure 6.1.2: Likelihood from a location normal model based on a sample of 25 with x 3 3. The likelihood peaks at there. The likelihood interval x 3 3 and the plotted function takes the value 1 C x : L x1 xn 0 5 3 0645 3 53548 contains all those values whose likelihood is at least 0.5 of the value of the likelihood at its peak. The location normal model is impractical for many
applications, as it assumes that the variance is known, while the mean is unknown. For example, if we are interested in the distribution of heights in a population, it seems unlikely that we will know the population variance but not know the population mean. Still, it is an important statis­ tical model, as it is a context where inference methods can be developed fairly easily. 302 Section 6.1: The Likelihood Function The methodology developed for this situation is often used as a paradigm for inference methods in much more complicated models. The parameter need not be one­dimensional. The interpretation of the likelihood is still the same, but it is not possible to plot it — at least not when the dimension of is greater than 2. EXAMPLE 6.1.5 Multinomial Models In Example 2.8.5, we introduced multinomial distributions. These arise in applications when we have a categorical response variable s that can take a finite number k of values, say, 1 i i. 3 and we do not know the value of 1 2 3 In this k and P s Suppose, then, that k case, the parameter space is given by 1 2 3 : i 0 for i 1 2 3 and 1 2 3 1 Notice that it is really only two­dimensional, because as soon as we know the value of 1 and 2 we immediately know the value of the remaining any two of the i ’s say, parameter, as 2 This fact should always be remembered when we are 3 dealing with multinomial models. 1 1 Now suppose we observe a sample of n from this distribution, say, s1 sn. The likelihood function for this sample is given by L 1 2 3 s1 sn x1 1 x2 2 x3 3 (6.1.2) where xi is the number of i’s in the sample. Using the fact that we can treat positive multiples of the likelihood as being equiv­ alent, we see that the likelihood based on the observed counts x1 x2 x3 (since they arise from a Multinomial n 3 distribution) is given by 1 2 L 1 2 3 x1 x2 x3 x1 1 x2 2 x3 3. This is identical to the likelihood (as functions of 2 and 3) for the original sam­ ple. It is certainly simpler to deal with the counts rather than the original sample. This is a very important phenomenon in statistics and is characterized by the concept of su
fficiency, discussed in the next section. 1 6.1.1 Sufficient Statistics The equivalence for inference of positive multiples of the likelihood function leads to a useful equivalence amongst possible data values coming from the same model. For s2 for some example, suppose data values s1 and s2 are such that L c 0 From the point of view of likelihood, we are indifferent as to whether we obtained the data s1 or the data s2 as they lead to the same likelihood ratios. cL s1 This leads to the definition of a sufficient statistic. Chapter 6: Likelihood Inference 303 Definition 6.1.1 A function T defined on the sample space S is called a sufficient statistic for the model if, whenever T s1 T s2 then L s1 c s1 s2 L s2 for some constant c s1 s2 0 The terminology is motivated by the fact that we need only observe the value t for the function T as we can pick any value s T 1 t s : T s t and use the likelihood based on s All of these choices give the same likelihood ratios. Typically, T s will be of lower dimension than s so we can consider replacing s by T s as a data reduction which simplifies the analysis somewhat. We illustrate the computation of a sufficient statistic in a simple context. EXAMPLE 6.1.6 Suppose that S 1 2 3 4 given by the following table. a b and the two probability distributions are e.g., L a 2 1 4), so the Then L 0 1 data values in 2 3 4 all give the same likelihood ratios. Therefore, T : S given by T 1 1 is a sufficient statistic. The model T 4 has simplified a bit, as now the sample space for T has only two elements instead of four for the original model. 1 6 and L b 2 0 and T 2 T 3 The following result helps identify sufficient statistics. Theorem 6.1.1 (Factorization theorem) If the density (or probability function) for a model factors as f, where g and h are nonnegative, then T is a sufficient statistic. h s g T s s PROOF By hypothesis, it is clear
that, when T s1 T s2 we have L s1 h s1 g T s1 h s1 g T s1 h s2 g T s2 h s2 g T s2 h s1 h s2 g T s2 because g T s1 h s2 g T s2 c s1 s2 L s2 Note that the name of this result is motivated by the fact that we have factored f as a product of two functions. The important point about a sufficient statistic T is that we are indifferent, at least when considering inferences about between observing the full data s or the value of T s. We will see in Chapter 9 that there is information in that is useful when we want to check assumptions. the data, beyond the value of T s 304 Section 6.1: The Likelihood Function Minimal Sufficient Statistics Given that a sufficient statistic makes a reduction in the data, without losing relevant information in the data for inferences about we look for a sufficient statistic that makes the greatest reduction. Such a statistic is called a minimal sufficient statistic. Definition 6.1.2 A sufficient statistic T for a model is a minimal sufficient statistic, whenever the value of T s can be calculated once we know the likelihood function L s. So a relevant likelihood function can always be obtained from the value of any suffi­ cient statistic T but if T is minimal sufficient as well, then we can also obtain the value of T from any likelihood function. It can be shown that a minimal sufficient statistic gives the greatest reduction of the data in the sense that, if T is minimal sufficient and h U Note that the definitions U is sufficient, then there is a function h such that T of sufficient statistic and minimal sufficient statistic depend on the model, i.e., different models can give rise to different sufficient and minimal sufficient statistics. While the idea of a minimal sufficient statistic is a bit subtle, it is usually quite simple to find one, as the following examples illustrate. EXAMPLE 6.1.7 Location Normal Model
By the factorization theorem we see immediately, from the discussion in Example 6.1.4, that x is a sufficient statistic. Now any likelihood function for this model is a positive multiple of exp n 2 2 0 x 2. Notice that any such function of its maximum, namely, at function for this model, and it is therefore a minimal sufficient statistic. is completely specified by the point where it takes x. So we have that x can be obtained from any likelihood EXAMPLE 6.1.8 Location­Scale Normal Model xn Suppose that x1 R1 and Examples 5.3.4 and 5.5.6. is a sample from an N 0 are unknown. Recall the discussion and application of this model in 2 distribution in which The parameter in this model is two­dimensional and is given by R1 0 Therefore, the likelihood function is given by 2 L x1 xn 2 2 n 2 exp n 2 exp xi 2 2 exp n 1 2 2 s2. We see immediately, from the factorization theorem, that x s2 is a sufficient statistic. xn is maximized, as a func­ at x we have that Now, fixing 2, any positive multiple of L x. This is independent of x1 2. Fixing tion of, at L x 2 x1 xn 2 2 n 2 exp n 1 2 2 s2 Chapter 6: Likelihood Inference 305 is maximized, as a function of cause ln is a strictly increasing function. Now 2 at the same point as ln L x 2 x1 xn be­ ln L x 2 x 2 n 1 2 2 s2 ln 2 n 2 n 1 2 4 s2. 2 n 2 2 Setting this equal to 0 yields the solution 2 n 1 s2, n which is a 1–1 function of s2 So, given any likelihood function for this model, we can compute x s2, which establishes that x s2 is a minimal sufficient statistic for the model. In fact, the likelihood is maximized at x 2 (Problem 6.1.22). EXAMPLE 6.1.9 Multinomial Models We saw in Example 6.1.5 that the likelihood function for a sample is given by (6.1.2). This makes clear that if two different samples have the same counts, then they
have the same likelihood, so the counts x1 x2 x3 comprise a sufficient statistic. Now it turns out that this likelihood function is maximized by taking 1 2 3 x1 n x2 n x3 n So, given the likelihood, we can compute the counts (the sample size n is assumed known). Therefore, x1 x2 x3 is a minimal sufficient statistic. Summary of Section 6.1 The likelihood function for a model and data shows how the data support the various possible values of the parameter. It is not the actual value of the likeli­ hood that is important but the ratios of the likelihood at different values of the parameter. A sufficient statistic T for a model is any function of the data s such that once we know the value of T s s (up to a positive constant multiple). A minimal sufficient statistic T for a model is any sufficient statistic such that s for the model and data, then we can once we know a likelihood function L determine T s. then we can determine the likelihood function L EXERCISES 6.1.1 Suppose a sample of n individuals is being tested for the presence of an antibody in their blood and that the number with the antibody present is recorded. Record an appropriate statistical model for this situation when we assume that the responses from 306 Section 6.1: The Likelihood Function 30 345, where individuals are independent. If we have a sample of 10 and record 3 positives, graph a representative likelihood function. 6.1.2 Suppose that suicides occur in a population at a rate p per person year and that p is assumed completely unknown. If we model the number of suicides observed in a population with a total of N person years as Poisson N p, then record a representative likelihood function for p when we observe 22 suicides with N 6.1.3 Suppose that the lifelengths (in thousands of hours) of light bulbs are distributed Exponential 5 2 for a sample of 20 0 is unknown. If we observe x light bulbs, record a representative likelihood function. Why is it that we only need to observe the sample average to obtain a representative likelihood? 6.1.4 Suppose we take a sample of n 100 students from a university with over 50 000 students enrolled. We classify these students as either living on campus, living off campus with their parents, or living off campus independently. Suppose we observe the counts x1 x
2 x3 34 44 22. Determine the form of the likelihood function for the unknown proportions of students in the population that are in these categories. 6.1.5 Determine the constant that makes the likelihood functions in Examples 6.1.2 and 6.1.3 equal. 6.1.6 Suppose that x1 distribution, where xn is a sample from the Bernoulli [0 1] is unknown. Determine the likelihood function and a minimal sufficient sta­ tistic for this model. (Hint: Use the factorization theorem and maximize the logarithm of the likelihood function.) 6.1.7 Suppose x1 0 is unknown. Determine the likelihood function and a minimal sufficient statistic for this model. (Hint: the Factorization Theorem and maximization of the logarithm of the likelihood function.) 6.1.8 Suppose that a statistical model is comprised of two distributions given by the following table: xn is a sample from the Poisson distribution where f1 s f2 s (a) Plot the likelihood function for each possible data value s (b) Find a sufficient statistic that makes a reduction in the data. 6.1.9 Suppose a statistical model is given by f1 f2, where fi is an N i 1 distribu­ tion. Compute the likelihood ratio L 1 0 L 2 0 and explain how you interpret this number. 6.1.10 Explain why a likelihood function can never take negative values. Can a likeli­ hood function be equal to 0 at a parameter value? 6.1.11 Suppose we have a statistical model : 1 true that 0 L 6.1.12 Suppose that x1 distribution, where [0 1] is unknown. Determine the likelihood function and a minimal sufficient sta­ tistic for this model. (Hint: Use the factorization theorem and maximize the logarithm of the likelihood.) xn is a sample from a Geometric [0 1] and we observe x0 Is it 1? Explain why or why not. x0 d f Chapter 6: Likelihood Inference 307 6.1.13 Suppose you are told that the likelihood of a particular parameter value is 109 Is it possible to interpret this number in any meaningful way? Explain why or why not. 6.1.14 Suppose one statistician records a likelihood function as 2 for [
0 1] while another statistician records a likelihood function as 100 2 for [0 1] Explain why these likelihood functions are effectively the same. PROBLEMS 6.1.15 Show that T defined in Example 6.1.6 is a minimal sufficient statistic. (Hint: Show that once you know the likelihood function, you can determine which of the two possible values for T has occurred.) 6.1.16 Suppose that S 1 2 3 4 butions are given by the following table. a b c, where the three probability distri Determine a minimal sufficient statistic for this model. Is the minimal sufficient statis­ tic in Example 6.1.6 sufficient for this model? 6.1.17 Suppose that x1 is a sample from the N 2 0 distribution where xn R1 is unknown. Determine the form of likelihood intervals for this model. xn Rn is a sample from f, where 6.1.18 Suppose that x1 known. Show that the order statistics x 1 the model. 6.1.19 Determine a minimal sufficient statistic for a sample of n from the rate gamma model, i.e., is un­ comprise a sufficient statistic for x n f x x 0 1 exp x 0 0 0 0 and where 0 for x 6.1.20 Determine the form of a minimal sufficient statistic for a sample of size n from the Uniform[0 ] model where 0 is fixed. 0 2] model where 1 6.1.21 Determine the form of a minimal sufficient statistic for a sample of size n from the Uniform[ 1 2 6.1.22 For the location­scale normal model, establish that the point where the likeli­ 2 as defined in Example 6.1.8. (Hint: Show that hood is maximized is given by x 2 and then x, with respect to 2, is negative at the second derivative of ln L x argue that x 6.1.23 Suppose we have a sample of n from a Bernoulli [0 0 5]. Determine a minimal sufficient statistic for this model. (Hint: It is easy to establish the sufficiency of x, but this
point will not maximize the likelihood when x 0 5, so x cannot be obtained from the likelihood by maximization, as in Exercise 6.1.6. In general, consider the second derivative of the log of the likelihood at any point 2 2 is the maximum.) distribution where 308 Section 6.2: Maximum Likelihood 0 0 5 and note that knowing the likelihood means that we can compute any of distri­ [0 1 3] is unknown. Determine the form of the likelihood function x2 is a minimal sufficient statistic where xi is the number of sample its derivatives at any values where these exist.) 6.1.24 Suppose we have a sample of n from the Multinomial 1 bution, where and show that x1 values corresponding to an observation in the ith category. (Hint: Problem 6.1.23.) 6.1.25 Suppose we observe s from a statistical model with two densities, f1 and f2 Show that the likelihood ratio T s is a minimal sufficient statistic. f1 s (Hint: Use the definition of sufficiency directly.) f2 s 1 2 3 CHALLENGES 6.1.26 Consider the location­scale gamma model, i.e., f x x 1 0 0 1 exp x 1 R1 0 is fixed. 0 and where 0 for x (a) Determine the minimal sufficient statistic for a sample of n when 0 1. (Hint: Determine where the likelihood is positive and calculate the partial derivative of the log of the likelihood with respect to.) 1. (Hint: (b) Determine the minimal sufficient statistic for a sample of n when 0 Use Problem 6.1.18, the partial derivative of the log of the likelihood with respect to, and determine where it is infinite.) DISCUSSION TOPICS 6.1.27 How important do you think it is for a statistician to try to quantify how much error there is in an inference drawn? For example, if an estimate is being quoted for some unknown quantity, is it important that the statistician give some indication about how accurate (or inaccurate) this inference is? 6.2 Maximum Likelihood Estimation In Section 6.1, we introduced the likelihood function L inferences about the unknown true value types of inferences discussed in Section
5.5.3 and start with estimation. s as a basis for making We now begin to consider the specific When we are interested in a point estimate of then a value s that maximizes L s is a sensible choice, as this value is the best supported by the data, i.e., L s s L s (6.2.1) for every Definition 6.2.1 We call likelihood estimator, and the value or MLE for short. : S satisfying (6.2.1) for every a maximum s is called a maximum likelihood estimate, Chapter 6: Likelihood Inference 309 s Notice that, if we use cL is also an MLE using this version of the likelihood. So we can use any version of the likelihood to calculate an MLE. s as the likelihood function, for fixed c 0, then EXAMPLE 6.2.1 Suppose the sample space is S model is given by the following table. 1 2 3, the parameter space is 1 2, and the s 1 s f1 s f2 Further suppose we observe s 1 So, for example, we could be presented with one of two bowls of chips containing these proportions of chips labeled 1, 2, and 3. We draw a chip, observe that it is labelled 1, and now want to make inferences about which bowl we have been presented with. In this case, the MLE is given by If we had instead observed s 3 1 1 2, then 1 since 0 3 L 1 1 0 1 2; if we had observed s 2 L 2 1 3 then Note that an MLE need not be unique. For example, in Example 6.2.1, if f2 was 0 3 then an MLE is as given there, 0 7 and f2 3 0 f2 2 defined by f2 1 3 but putting 2 also gives an MLE. The MLE has a very important invariance property. Suppose we reparameterize a defined on. By this we mean that, instead of labelling the model via a 1–1 function individual distributions in the model using For example, in Example 6.2.1, we could take a b So the model is now given by g : value : b so that for the unique and a new parameter space We have a new parameter. Nothing has changed about the probability distributions in the statistical model, a and
where g, we use 1 such that 2 f only the way they are labelled. We then have the following result. Theorem 6.2.1 If 1–1 function defined on ization. s is an MLE for the original parameterization and, if is a is an MLE in the new parameter­, then s s PROOF If we select the likelihood function for the new parameterization to be L and the likelihood for the original parameterization to be L g s s s then we have for every establishes the result. This implies that L s s L s for every and Theorem 6.2.1 shows that no matter how we parameterize the model, the MLE behaves in a consistent way under the reparameterization. This is an important property, and not all estimation procedures satisfy this. 310 Section 6.2: Maximum Likelihood 6.2.1 Computation of the MLE An important issue is the computation of MLEs. In Example 6.2.1, we were able to do this by simply examining the table giving the distributions. With more complicated models, this approach is not possible. In many situations, however, we can use the methods of calculus to compute s be a continuously differentiable function of so that we can use optimization methods from calculus s For this we require that f Rather than using the likelihood function, it is often convenient to use the log­ likelihood function. Definition 6.2.2 For likelihood function L s defined on, is given by l ln L s s, the log­likelihood function l s s for every Note that ln x is a 1–1 increasing function of x L can maximize l likelihood arises from the fact that, for a sample s1 likelihood function is given by s So we s instead when computing an MLE. The convenience of the log­ the 0 and this implies that L if and only if l s for every from f sn s s s : l L s1 sn whereas the log­likelihood is given by l s1 sn n i 1 f si n i 1 ln f si It is typically much easier to differentiate a sum than a product. Because we are going to be differentiating the log­likelihood, it is convenient to s of a model to is a give a name to this derivative. We define the score function S be the derivative of its log­likelihood function whenever
this exists. So when one­dimensional real­valued parameter, then S s l s provided this partial derivative exists (see Appendix A.5 for a definition of partial deriv­ ative). We restrict our attention now to the situation in which is one­dimensional. To obtain the MLE, we must then solve the score equation S s 0 (6.2.2) for Of course, a solution to (6.2.2) is not necessarily an MLE, because such a point may be a local minimum or only a local maximum rather than a global maximum. To guarantee that a solution s is at least a local maximum, we must also check that S s 2l s 2 s 0 s (6.2.3) Chapter 6: Likelihood Inference 311 Then we must evaluate l maximum. s at each local maximum in order to determine the global Let us compute some MLEs using calculus. EXAMPLE 6.2.2 Location Normal Model Consider the likelihood function L x1 xn exp n 2 2 0 x 2 obtained in Example 6.1.4 for a sample x1 xn from the N R1 is unknown and 2 l and the score function is 0 is known. The log­likelihood function is then n 2 2 0 x1 xn x 2 2 0 model where S x1 xn The score equation is given by n 2 0 x n 2 0 x 0 Solving this for local maximum, we calculate gives the unique solution x1 xn x To check that this is a S x1 xn n 2 0 x which is negative, and thus indicates that x is a local maximum. Because we have only one local maximum, it is also the global maximum and we have indeed obtained the MLE. EXAMPLE 6.2.3 Exponential Model Suppose that a lifetime is known to be distributed Exponential 1 unknown. Then based on a sample x1 xn, the likelihood is given by where 0 is L x1 xn 1 n exp nx the log­likelihood is given by l x1 xn n ln nx and the score function is given by S x1 xn n nx 2 312 Section 6.2: Maximum Likelihood Solving the score equation gives x1 xn x and because x 0, S x1 xn n 2 nx 3 2 x x n x 2 0 so x is indeed the MLE. In both examples just considered, we were
able to derive simple formulas for the MLE. This is not always possible. Consider the following example. EXAMPLE 6.2.4 Consider a population in which individuals are classified according to one of three types labelled 1, 2, and 3, respectively. Further suppose that the proportions of individuals falling in these categories are known to follow the law p1 2 where 2 p3 p2 1 [0 5 1 2] [0 0 618 03] is unknown. Here, pi denotes the proportion of individuals in the i th class Note that the requirement that 0 and the precise using the formula for the roots bound is obtained by solving of a quadratic. Relationships like this, amongst the proportions of the distribution of a categorical variable, often arise in genetics. For example, the categorical variable might serve to classify individuals into different genotypes. 1 imposes the upper bound on 2 0 for 1 2 For a sample of n (where n is small relative to the size of the population so that we can assume observations are i.i.d.), the likelihood function is given by L x1 xn x1 2x2 1 2 x3 where xi denotes the sample count in the ith class. The log­likelihood function is then l s1 sn x1 2x2 ln x3 ln 1 2, and the score function is S s1 sn x1 2x2 x3 1 1 2 2. The score equation then leads to a solution being a root of the quadratic x1 2x2 1 x1 2x2 2x3 x3 2 2 x1 2 2 2x2 x3 x1 2x2. Using the formula for the roots of a quadratic, we obtain 1 2x2 2x3 2 x1 x1 2x2 x3 5x 2 1 20x1x2 10x1x3 20x 2 2 20x2x3 x 2 3 Notice that the formula for the roots does not determine the MLE in a clear way. In fact, we cannot even tell if either of the roots lies in [0 1]! So there are four possible Chapter 6: Likelihood Inference 313 values for the MLE at this point — either of the roots or the boundary points 0 and 0 61803. We can resolve this easily in an application by simply numerically evaluating the 25 then the xn likelihood at the four points. For example, if x1
roots are 0 47847 We can see this graphically in the plot of the log­likelihood provided in Fig­ ure 6.2.1. 1 28616 and 0 47847 so it is immediate that the MLE is 5 and x3 70 x2 x1 0.4 0.45 0.5 0.55 0.6 theta theta ­90 ­95 ­100 ­105 ­110 ­115 ­120 lnL lnL Figure 6.2.1: The log­likelihood function in Example 6.2.4 when x1 x3 25. 70 x2 5 and In general, the score equation (6.2.2) must be solved numerically, using an iterative routine like Newton–Raphson. Example 6.2.4 demonstrates that we must be very care­ ful not to just accept a solution from such a procedure as the MLE, but to check that the fundamental defining property (6.2.1) is satisfied. We also have to be careful that the necessary smoothness conditions are satisfied so that calculus can be used. Consider the following example. EXAMPLE 6.2.5 Uniform[0 Suppose x1 known. Then the likelihood function is given by ] Model xn is a sample from the Uniform[0 ] model where 0 is un­ L x1 xn xi xi for i 1 for some i n n 0 n I[x n where x n is the largest order statistic from the sample. graphed this function when n occurs at x n ; we cannot obtain this value via differentiation, as L differentiable there. In Figure 6.2.2, we have 1 916 Notice that the maximum clearly xn is not 10 and x n x1 314 Section 6.2: Maximum Likelihood 0.0015 L 0.0010 0.0005 0.0000 0 1 2 3 4 5 theta Figure 6.2.2: Plot of the likelihood function in Example 6.2.5 when n x 10 1 916. 10 and The lesson of Examples 6.2.4 and 6.2.5 is that we have to be careful when com­ puting MLEs. We now look at an example of a two­dimensional problem in which the MLE can be obtained using one­dimensional methods. EXAMPLE 6.2.6 Location­Scale Normal
Model Suppose that x1 xn is a sample from an N and R1 0 are unknown. The parameter in this model is two­dimensional, given by 2 2 distribution, where The likelihood function is then given by R1 0 L 2 x1 xn 2 2 n 2 exp n 2 2 x 2 exp n 1 2 2 s2 as shown in Example 6.1.8. The log­likelihood function is given by l 2 x1 xn n 2 ln 2 n 2 ln s2 (6.2.4) As discussed in Example 6.1.8, it is clear that, for fixed 2, (6.2.4) is maximized, as a 2, so this must be the first function of coordinate of the MLE. x. Note that this does not involve by Substituting x into (6.2.4), we obtain n 2 ln 2 n 2 ln 2 n 1 2 2 s2, (6.2.5) and the second coordinate of the MLE must be the value of Differentiating (6.2.5) with respect to 2 and setting this equal to 0 gives 2 that maximizes (6.2.5). n 2 2 n 2 1 2 2 s2 0 (6.2.6) Chapter 6: Likelihood Inference 315 Solving (6.2.6) for 2 leads to the solution n 2 1 s2 n 1 n n i 1 xi x 2 Differentiating (6.2.6) with respect to 2 and substituting in 2 we see that the second derivative is negative, hence 2 is a point where the maximum is attained. Therefore, we have shown that the MLE of 2 is given by x 1 n n i 1 xi x 2 In the following section we will show that this result can also be obtained using multi­ dimensional calculus. s So far we have talked about estimating only the full parameter for a model. What defined about estimating a general characteristic of interest? Perhaps the obvious answer here is to use the estimate on the parameter space s where This is sometimes referred to as the plug­ s is an MLE of Notice, however, that the plug­in MLE is not necessarily a true MLE, in and that takes then Theorem 6.2.1 in MLE of the sense that we have a likelihood function for a model indexed by its maximum value at
establishes that s is a true MLE but not otherwise. is a 1–1 function defined on for some function If s If is not 1–1, then we can often find a complementing function defined on so that is a 1–1 function of. Then, by Theorem 6.2.1, s s s s is the joint MLE, but perform badly, as it ignores the information in example illustrates this phenomenon. s is still not formally an MLE. Sometimes a plug­in MLE can An about the true value of s EXAMPLE 6.2.7 Sum of Squared Means Suppose that Xi N i 1 for i i completely unknown. So here, 2 n. 2 1 The log­likelihood function is given by to estimate 1 1 l x1 xn Clearly this is maximized by is given by n i 1 x 2 i. Now observe that x1 xn n and that these are independent with the Rn. Suppose we want n and 1 2 n i 1 x1 xi 2. i xn. So the plug­in MLE of Var Xi 2 i n, 316 Section 6.2: Maximum Likelihood where E g refers to the expectation of g s when s likely that n i 1 x 2 to use i f So when n is large, it is is far from the true value. An immediate improvement in this estimator is n instead. There have been various attempts to correct problems such as the one illustrated in Example 6.2.7. Typically, these involve modifying the likelihood in some way. We do not pursue this issue further in this text but we do advise caution when using plug­in by x and 2 by s2, they MLEs. Sometimes, as in Example 6.2.6, where we estimate seem appropriate; other times, as in Example 6.2.7, they do not. 6.2.2 The Multidimensional Case (Advanced) Rk is multidimensional, 1 1 The likelihood and log­likelihood are then defined just as before, but the We now consider the situation in which i.e., k score function is now given by provided all these partial derivatives exist. For the score equation, we get and we must solve this k­dimensional equation for k This is often much more difficult than in the one­dimensional case, and we typically have to resort to
numerical methods. 1 A necessary and sufficient condition for to be a local maximum, when the log­likelihood has continuous second partial derivatives, is that the matrix of second partial derivatives of the log­likelihood, evaluated at k, must be negative definite (equivalently, all of its eigenvalues must be negative). We then must evaluate the likelihood at each of the local maxima obtained to determine the global maximum or MLE. 1 1 k We will not pursue the numerical computation of MLEs in the multidimensional case any further here, but we restrict our attention to a situation in which we carry out the calculations in closed form. EXAMPLE 6.2.8 Location­Scale Normal Model We determined the log­likelihood function for this model in (6.2.4). The score function is then Chapter 6: Likelihood Inference 317 S 2 x1 xn The score equation is S S x1 x1 2 xn xn s2. s2 0 0, and the first of these equations immediately implies that for into the second equation and solving for 2 leads to the solution x Substituting this value 2 n 1 s2 n 1 n n i 1 xi x 2 From Example 6.2.6, we know that this solution does indeed give the MLE. Summary of Section 6.2 that max­ that is best supported by the An MLE (maximum likelihood estimator) is a value of the parameter imizes the likelihood function. It is the value of model and data. We can often compute an MLE by using the methods of calculus. When ap­ plicable, this leads to solving the score equation for either explicitly or using numerical algorithms. Always be careful to check that these methods are ap­ plicable to the specific problem at hand. Furthermore, always check that any solution to the score equation is a maximum and indeed an absolute maximum. EXERCISES 6.2.1 Suppose that S tions are given by the following table. 1 2 3 4 a b, where the two probability distribu for each possible data value. Determine the MLE of 6.2.2 If x1 unknown, then determine the MLE of 6.2.3 If x1 unknown, then determine the MLE of. 2. xn is a sample from a Bernoulli xn is a sample from a Bernoulli distribution
, where [0 1] is distribution, where [0 1] is 318 Section 6.2: Maximum Likelihood xn is a sample from a Poisson 6.2.4 If x1 unknown, then determine the MLE of 6.2.5 If x1 0 xn is a sample from a Gamma 0 is unknown, then determine the MLE of. distribution, where 0 is distribution, where 0 0 and. xn is the result of independent tosses of a coin where we 6.2.6 Suppose that x1 toss until the first head occurs and where the probability of a head on a single toss is 0 1]. Determine the MLE of.. ) xn distribution (see Problem is a sample from a Pareto xn is a sample from a Beta distribution (see Problem 2.4.19), xn is a sample from a Weibull distribution (see Problem 2.4.20), 0 is unknown, then determine the MLE of 0 is unknown, then determine the MLE of 0 is unknown, then determine the score equation for the MLE of 1 distribution (see Problem 2.4.24) is a. (Hint: Assume. xn is a sample from a Log­normal 0 is unknown, then determine the MLE of 6.2.7 If x1 where differentiable function of 6.2.8 If x1 where 6.2.9 If x1 where 6.2.10 If x1 2.6.17), where 6.2.11 Suppose you are measuring the volume of a cubic box in centimeters by taking repeated independent measurements of one of the sides. Suppose it is reasonable to as­ is unknown sume that a single measurement follows an N and 2 as 3.2 0 is known. Based on a sample of measurements, you obtain the MLE of cm. What is your estimate of the volume of the box? How do you justify this in terms of the likelihood function? 6.2.12 If x1 unknown and 0 is known, then determine the MLE of from the plug­in MLE of 6.2.13 Explain why it is not possible that the function 3 exp is a likelihood function. 6.2.14 Suppose you are told that a likelihood function has local maxima at the points 2 2 4 6 and 9.2, as determined using calculus. Explain how you would determine 2 computed using the location­scale normal model?
5 3 2 for 0 is 2. How does this MLE differ is a sample from an N 0 2 0 distribution, where 2 distribution, where R1 xn 2. the MLE. 6.2.15 If two functions of are equivalent versions of the likelihood when one is a positive multiple of the other, then when are two log­likelihood functions equivalent? 6.2.16 Suppose you are told that the likelihood of 2 is given by 1 4 Is this the probability that 2? Explain why or why not. at COMPUTER EXERCISES 2 2 2 R1 Numerically approximate the MLE by evaluating this function at 1000 1 2 2 3 exp 10 10] Also plot the likelihood function. 5 2 2 R1 Numerically approximate the MLE by evaluating this function at 1000 10 10] Also plot the likelihood function. Comment on the 1 2 2 3 exp 6.2.17 A likelihood function is given by exp for equispaced points in 6.2.18 A likelihood function is given by exp for equispaced points in form of likelihood intervals. Chapter 6: Likelihood Inference 319 PROBLEMS 1, and 1 6.2.19 (Hardy–Weinberg law) The Hardy–Weinberg law in genetics says that the pro­ 2, respectively, portions of genotypes A A, Aa, and aa are 2, 2 [0 1] Suppose that in a sample of n from the population (small relative where to the size of the population), we observe x1 individuals of type A A, x2 individuals of type Aa and x3 individuals of type aa (a) What distribution do the counts X1 X2 X3 follow? (b) Record the likelihood function, the log­likelihood function, and the score function for (c) Record the form of the MLE for 6.2.20 If x1 known, determine the MLE of the probability content of the interval your answer. 6.2.21 If x1 known, determine the MLE of 6.2.22 Prove that, if statistic for the model, then 6.2.23 Suppose that X1 X2 X3 where s is the MLE for a model for response s and if T is a sufficient s is also the MLE for the model for T s. xn is a sample from an N 3 (see Example 6.1.5), R1 is
un­ 1. Justify is a sample from an N 1 distribution where 1 distribution where Multinomial n 0 is un­ xn and we observe X1 X2 X3 (a) Determine the MLE of 1 (b) What is the plug­in MLE of 6.2.24 If x1 x1 x2 x3. 2 1 3. 2 2 2 3? xn is a sample from a Uniform[ 1 2] distribution with 1 2 R2 : 1 2 determine the MLE of determine the maximum over 1 (Hint: You cannot use calculus. 2. 1 when 2 is fixed, and then vary 2.) Instead, directly COMPUTER PROBLEMS 6.2.25 Suppose the proportion of left­handed individuals in a population is on a simple random sample of 20, you observe four left­handed individuals. (a) Assuming the sample size is small relative to the population size, plot the log­ likelihood function and determine the MLE. (b) If instead the population size is only 50, then plot the log­likelihood function and determine the MLE. (Hint: Remember that the number of left­handed individuals fol­ lows a hypergeometric distribution. This forces to be of the form i 50 for some integer i between 4 and 34. From a tabulation of the log­likelihood, you can obtain the MLE.). Based 320 Section 6.3: Inferences Based on the MLE CHALLENGES 6.2.26 If x1 xn is a sample from a distribution with density f x 1 2 exp x for x. (Hint: You cannot use calculus. Instead, maximize the log­likelihood in each of the intervals R1 is unknown, then determine the MLE of R1 and where x 1, [x 1 x 2 etc.). DISCUSSION TOPICS s is to report the for some constant 0 1 What problems do you see with this approach? In particular, how would 6.2.27 One approach to quantifying the uncertainty in an MLE MLE together with a likelihood interval c you choose c? : L cL s s s 6.3 Inferences Based on the MLE In Table 6.3.1. we have recorded n 66 measurements of the speed of light (pas­ sage time recorded as deviations from 24 800 nanoseconds between two mirrors 7400 meters apart) made by A. A. Michel
son and S. Newcomb in 1882. 28 22 36 26 28 28 26 24 32 30 27 24 33 21 36 32 31 25 24 25 28 36 27 32 34 30 25 26 26 25 44 23 21 30 33 29 27 29 28 22 26 27 16 31 29 36 32 28 40 19 37 23 32 29 2 24 25 27 24 16 29 20 28 27 39 23 Table 6.3.1: Speed of light measurements. Figure 6.3.1 is a boxplot of these data with the variable labeled as x. Notice there are two outliers at x 44 We will presume there is something very special about these observations and discard them for the remainder of our discussion. 2 and x x 40 30 20 10 0 ­10 ­20 ­30 ­40 ­50 Figure 6.3.1: Boxplot of the data values in Table 6.3.1. Chapter 6: Likelihood Inference 321 Figure 6.3.2 presents a histogram of these data minus the two data values identified as outliers. Notice that the histogram looks reasonably symmetrical, so it seems plau­ sible to assume that these data are from an N and 2 Accordingly, a reasonable statistical model for these data would appear to be the location­scale normal model. In Chapter 9, we will discuss further how to assess the validity of the normality assumption. 2 distribution for some values of 0.09 0.08 0.07 0.06 0.05 0.04 0.03 0.02 0.01 0.00 y t i s n e D 10 30 x Figure 6.3.2: Density histogram of the data in Table 6.3.1 with the outliers removed. 35 45 50 25 15 20 40 If we accept that the location­scale normal model makes sense, the question arises 2. The concerning how to make inferences about the unknown parameters purpose of this section is to develop methods for handling problems like this. The methods developed in this section depend on special features of the MLE in a given context. In Section 6.5, we develop a more general approach based on the MLE. and 6.3.1 Standard Errors, Bias, and Consistency Based on the justification for the likelihood, the MLE s seems like a natural estimate Let us suppose that we will then use the plug­in MLE estimate of the true value of might be the first for a characteristic
of interest (e.g., s s quartile or the variance). s to be close to the true value of In an application, we want to know how reliable the estimate is. In other, or is there a reasonable words, can we expect s is far from the true value? This leads us to consider the sampling chance that distribution of s under repeated sampling from the true distribution f Because we do not know what the true value of s, as this tells us how much variability there will be in is, we have to look at the sampling distribution of s for every s To simplify this, we substitute a numerical measure of how concentrated these sam­ Perhaps the most commonly used measure of the i.e., we are not restricting ourselves to pling distributions are about accuracy of a general estimator T s of plug­in MLEs, is the mean­squared error. 322 Section 6.3: Inferences Based on the MLE Definition 6.3.1 The mean­squared error (MSE) of the estimator T of is given by MSE T 2 for each E T R1 Clearly, the smaller MSE T is, the more concentrated the sampling distribution of T s is about the value Looking at MSE T as a function of is as an estimate of the true value of and thus the true value of MSE T squared error at the true value. Often gives us some idea of how reliable T s Because we do not know the true value of statisticians record an estimate of the mean­ MSE s T is used for this. In other words, we evaluate MSE T at accuracy of the estimate T s. s as a measure of the The following result gives an important identity for the MSE. Theorem 6.3.1 If that E T exists, then R1 and T is a real­valued function defined on S such MSE T Var T E T 2 (6.3.1) PROOF We have 2E T E T E T Var T E T 2 E T 2 because The second term in (6.3.1) is the square of the bias in the estimator T Definition 6.3.2 The bias in the estimator T of whenever E T exists. When the bias in an estimator T is 0 for every, we call T for every an unbiased estimator of, i.e., T is unbiased whenever E T is
given by E T Note that when the bias in an estimator is 0, then the MSE is just the variance. Unbiasedness tells us that, in a sense, the sampling distribution of the estimator is centered on the true value. For unbiased estimators, MSE s T Var s T Chapter 6: Likelihood Inference 323 and Sd s T Var s T is an estimate of the standard deviation of T and is referred to as the standard error of the estimate T s. As a principle of good statistical practice, whenever we quote an estimate of a quantity, we should also provide its standard error — at least when we have an unbiased estimator, as this tells us something about the accuracy of the estimate. We consider some examples. EXAMPLE 6.3.1 Location Normal Model Consider the likelihood function L x1 xn exp n 2 2 0 x 2 obtained in Example 6.1.4 for a sample x1 xn from the N 2 0 model, where The MLE R1 is unknown and 2 0 0 is known. Suppose we want to estimate of was computed in Example 6.2.2 to be x In this case, we can determine the sampling distribution of the MLE exactly from N the results in Section 4.6. We have that X 2 0 n and so X is unbiased, and MSE X Var X 2 0 n which is independent of standard error of the estimate is given by So we do not need to estimate the MSE in this case The Sd X 0 n Note that the standard error decreases as the population variance the sample size n increases 2 0 decreases and as EXAMPLE 6.3.2 Bernoulli Model Suppose x1 unknown. Suppose we wish to estimate. The likelihood function is given by xn is a sample from a Bernoulli distribution where [0 1] is L x1 xn nx 1 n 1 x and the MLE of mances. We have E X of is x (Exercise 6.2.2), the proportion of successes in the n perfor­ [0 1] so the MLE is an unbiased estimator for every Therefore, MSE X Var X 1 n and the estimated MSE is MSE X x 1 x n 324 Section 6.3: Inferences Based on the MLE The standard error of the estimate x is then given by Sd X x 1 x n Note how this standard error is quite different from the standard error of x in Example 6.3
.1. EXAMPLE 6.3.3 Application of the Bernoulli Model A polling organization is asked to estimate the proportion of households in the pop­ ulation in a specific district who will participate in a proposed recycling program by separating their garbage into various components. The pollsters decided to take a sam­ ple of n 1000 from the population of approximately 1.5 million households (we will say more on how to choose this number later). Each respondent will indicate either yes or no to a question concerning their par­ ticipation. Given that the sample size is small relative to the population size, we can [0 1] is the pro­ assume that we are sampling from a Bernoulli portion of individuals in the population who will respond yes. model where After conducting the sample, there were 790 respondents who replied yes and 210 is who responded no. Therefore, the MLE of and the standard error of the estimate is x 790 1000 0 79 x 1 x 1000 0 79 1 0 79 1000 0 01288 Notice that it is not entirely clear how we should interpret the value 0 01288 Does it mean our estimate 0 79 is highly accurate, modestly accurate, or not accurate at all? We will discuss this further in Section 6.3.2. EXAMPLE 6.3.4 Location­Scale Normal Model Suppose that x1 is a sample from an N xn and 2 R1 0 are unknown. The parameter in this model is given by 0. Suppose that we want to estimate 2 2 distribution where i.e., just the first R1 2 coordinate of the full model parameter. In Example 6.1.8, we determined that the likelihood function is given by L 2 x1 xn 2 2 n 2 exp n 2 2 x 2 exp n 1 2 2 s2 In Example 6.2.6 we showed that the MLE of is n x n 1 s2 Furthermore, from Theorem 4.6.6, the sampling distribution of the MLE is given by 1 S2 X 2 n independent of n 2 n 1. N 2 Chapter 6: Likelihood Inference 325 The plug­in MLE of is x This estimator is unbiased and has MSE X Var X 2 n Since 2 is unknown we estimate MSE X by MSE X n 1 n s2 n 1 s2 n n2 s2 n The value s2 n is commonly used instead of MSE X, because (Cor
ollary 4.6.2) E S2 2 i.e., S2 is an unbiased estimator of error of the estimate x 2. The quantity s n is referred to as the standard EXAMPLE 6.3.5 Application of the Location­Scale Normal Model In Example 5.5.6, we have a sample of n calculated x obtained the estimate s 64 517 is s interpreting exactly what this number means in terms of the accuracy of the estimate. Therefore, the standard error of the estimate x 0 43434 As in Example 6.3.3, we are faced with 30 heights (in inches) of students. We. In addition, we 64 517 as our estimate of the mean population height 2 379 of 30 2 379 30 Consistency of Estimators Perhaps the most important property that any estimator T of a characteristic can have is that it be consistent. Broadly speaking, this means that as we increase the amount of data we collect, then the sequence of estimates should converge to the true value of. To see why this is a necessary property of any estimation procedure, consider the finite population sampling context discussed in Section 5.4.1. When the sample size is equal to the population size, then of course we have the full information and can compute exactly every characteristic of the distribution of any measurement defined on the population. So it would be an error to use an estimation procedure for a characteristic of interest that did not converge to the true value of the characteristic as we increase the sample size. Fortunately, we have already developed the necessary mathematics in Chapter 4 to define precisely what we mean by consistency. Definition 6.3.3 A sequence of of estimates T1 T2 if Tn probability) for estimates T1 T2 as n for every as n P is said to be consistent (almost surely) for for every is said to be consistent (in A sequence of a s if Tn Notice that Theorem 4.3.1 says that if the sequence is consistent almost surely, then it is also consistent in probability. Consider now a sample x1 f n i 1 xi be the nth sample average as an estimator of and let Tn E X which from a model n 1 xn : 326 Section 6.3: Inferences Based on the MLE we presume exists. The weak and strong laws of large numbers immediately give us the consistency of the sequence T1 T
2 We see immediately that this gives for the consistency of some of the estimators discussed in this section. In fact, Theorem 6.5.2 gives the consistency of the MLE in very general circumstances. Furthermore, Accordingly, we the plug­in MLE will also be consistent under weak restrictions on can think of maximum likelihood estimation as doing the right thing in a problem at least from the point of view of consistency. More generally, we should always restrict our attention to statistical procedures that perform correctly as the amount of data increases. Increasing the amount of data means that we are acquiring more information and thus reducing our uncertainty so that in the limit we know everything. A statistical procedure that was inconsistent would be potentially misleading. 6.3.2 Confidence Intervals While the standard error seems like a reasonable quantity for measuring the accuracy, its interpretation is not entirely clear at this point. It turns out of an estimate of that this is intrinsically tied up with the idea of a confidence interval. Consider the construction of an interval C s l s u s based on the data s that we believe is likely to contain the true value of To do this, we have to specify the lower endpoint l s and upper endpoint u s for each data value s How should we do this? One approach is to specify a probability [0 1] and then require that random interval C have the confidence property, as specified in the following definition. Definition 6.3.4 An interval C s l s u s if P We refer to C s P l s as the confidence level of the interval. is a u s ­confidence interval for for every So C is a probability that an interval either covers a particular instance of a value of. ­confidence interval for is in the interval is at least equal to if, whenever we are sampling from P the For a given data set, such or it does not. So note that it is not correct to say that of containing the true ­confidence region has probability If we choose to be a value close to 1, then we are highly confident that the R1 (a very big true value of is in C s Of course, we can always take C s interval!), and we are then 100% confident that the interval contains
the true value. But this tells us nothing we did not already know. So the idea is to try to make use of the information in the data to construct an interval such that we have a high confidence, say, 0 99 that it contains the true value and is not any longer than necessary. We then interpret the length of the interval as a measure of how accurately the data allow us to know the true value of 0 95 or Chapter 6: Likelihood Inference 327 z­Confidence Intervals Consider the following example, which provides one approach to the construction of confidence intervals. EXAMPLE 6.3.6 Location Normal Model and z­Confidence Intervals Suppose we have a sample x1 unknown and 2 0 6.3.1. Suppose we want a confidence interval for R1 is 0 is known. The likelihood function is as specified in Example 2 0 model, where xn from the N The reasoning that underlies the likelihood function leads naturally to the following restriction for such a region: If 1 C x1 xn and L 2 x1 xn L 1 x1 xn then we should also have lihood because the model and the data support conclude that C x1 1 is a plausible value, so is xn is of the form Therefore, C x1 2 2 xn. This restriction is implied by the like­ 1 Thus, if we 2 at least as well as C x1 xn : L x1 xn k x1 xn for some k x1 xn i.e., C x1 xn is a likelihood interval for. Then C x1 xn : exp n 2 2 0 x 2 k x1 xn : n 2 2 0 : x x 2 2 ln k x1 2 2 0 n ln k x1 xn xn x k x1 xn 0 n x k x1 xn 0 n where k x1 xn xn We are now left to choose k or equivalently k, so that the interval C is a ­ Perhaps the simplest choice is to try to choose k so that 2 ln k x1 xn is constant and is such that the interval as short as possible. Because confidence interval for k x1 Z X 0 n N 0 1 we have P P 1 C x1 xn 6.3.
2) (6.3.3) 328 Section 6.3: Inferences Based on the MLE for every equality in (6.3.3) whenever R1 where is the N 0 1 cumulative distribution function. We have 1 k 2 th quantile of the N 0 1 distribution. and so k This is the smallest constant k satisfying (6.3.3). 2 where z denotes the z 1 We have shown that the likelihood interval given by 6.3.4) ­confidence interval for is an exact given by (6.3.2), they are called z­confidence intervals. For example, if we take 0 95 then 1 dix D), we obtain z0 975 of the form 0 975 and, from a statistical package (or Table D.2 in Appen­ 1 96 Therefore, in repeated sampling, 95% of the intervals As these intervals are based on the z­statistic, 2 will contain the true value of. x 1 96 0 n x 1 96 0 n for each of N This is illustrated in Figure 6.3.3. Here we have plotted the upper and lower end­ points of the 0 95­confidence intervals for 25 samples of size n 10 generated from an N 0 1 distribution. The theory says that when N is large, 0 In the plot, approximately 95% of these intervals will contain the true value coverage means that the lower endpoint (denoted by ) must be below the horizontal line at 0 and that the upper endpoint (denoted by ) must be above this horizontal line. We see that only the fourth and twenty­third confidence intervals do not contain 0, so, this proportion will converge to 23 25 0.95. 92% of the intervals contain 0. As 1 0 6 12 sample 18 24 Figure 6.3.3: Plot of 0.95­confidence intervals for 25 samples of size n 0 (lower endpoint 10 from an N 0 1 distribution. ) for N upper endpoint Notice that interval (6.3.4) is symmetrical about x. Accordingly, the half­length of this interval, z 1 2 0 n Chapter 6: Likelihood Inference 329 is a measure of the accuracy of the estimate x. The half­length is often referred to as the margin of error. From the margin of error, we now see how to interpret the standard error; the stan
­ For ex­ 0 9974), dard error controls the lengths of the confidence intervals for the unknown ample, we know that with probability approximately equal to 1 (actually the interval [x n] contains the true value of. 3 0 Example 6.3.6 serves as a standard example for how confidence intervals are often constructed in statistics. Basically, the idea is that we take an estimate and then look at the intervals formed by taking symmetrical intervals around the estimate via multiples of its standard error. We illustrate this via some further examples. EXAMPLE 6.3.7 Bernoulli Model Suppose that x1 xn is a sample from a Bernoulli ­confidence interval for is unknown and we want a have that the MLE is x (see Exercise 6.2.2) and the standard error of this estimate is [0 1]. Following Example 6.3.2, we distribution where x 1 x n For this model, likelihood intervals take the form n 1 x C x1 xn : nx 1 k x1 xn xn Again restricting to constant k we see that to determine these for some k x1 intervals, we have to find the roots of equations of the form nx 1 n 1 x k x1 xn While numerical root­finding methods can handle this quite easily, this approach is not to give a very tractable when we want to find the appropriate value of k x1 xn ­confidence interval. To avoid these computational complexities, it is common to use an approximate likelihood and confidence interval based on the central limit theorem. The central limit theorem (see Example 4.4.9) implies that n X 1 D N 0 1 as n 4.4.2), shows that. Furthermore, a generalization of the central limit theorem (see Section Therefore, we have lim n P z 1 2 lim 330 and Section 6.3: Inferences Based on the MLE 6.3.5) is an approximate the interval in Example 6.3.6, except that the standard error has changed. For example, if we want an approximate 0.95­confidence interval for ­confidence interval for Notice that this takes the same form as in Example 6.3.3, then based on the observed x 0 79 we obtain 0
79 1 96 0 79 1 0 79 1000 [0 76475 0 81525] The margin of error in this case equals 0 025245 so we can conclude that we know the true proportion with reasonable accuracy based on our sample. Actually, it may be that this accuracy is not good enough or is even too good. We will discuss methods for ensuring that we achieve appropriate accuracy in Section 6.3.5. The ­confidence interval derived here for is one of many that you will see rec­ ­confidence ommended in the literature. Recall that (6.3.5) is only an approximate and n may need to be large for the approximation to be accurate. In interval for and could be far from other words, the true confidence level for (6.3.5) will not equal is near 0 or 1, then n may need that value if n is too small. In particular, if the true to be very large. In an actual application, we usually have some idea of a small range of possible values a population proportion can take. Accordingly, it is advisable to carry out some simulation studies to assess whether or not (6.3.5) is going to provide an acceptable approximation for in that range (see Computer Exercise 6.3.21). t­Confidence Intervals Now we consider confidence intervals for unrealistic assumption that we know the population variance. in an N 2 model when we drop the 0 xn is a sample from an N 0 are unknown. The parameter in this model is given by. Suppose we want to form confidence intervals for EXAMPLE 6.3.8 Location­Scale Normal Model and t­Confidence Intervals 2 distribution, where Suppose that x1 2 and 2. R1 and 2, and so the reasoning we employed in Example 6.3.6 to determine the form of the confidence n as the stan­ interval is not directly applicable. In Example 6.3.4, we developed s dard error of the estimate x of. Accordingly, we restrict our attention to confidence intervals of the form The likelihood function in this case is a function of two variables, R1 C x1 xn x k s n x k s n for some constant k Chapter 6: Likelihood Inference 331 We then have where G n
1 is the distribution function of Now, by Theorem 4.6.66.3.6) independent of n 1 S2 2 2 n 1. Therefore, by Definition 4.6.2, X T n n 1 S2 2 X S n t n 1 So if we take where t t 1 is the th quantile of the t k 1 2 n distributionconfidence interval for The quantiles of the t distributions are available is an exact from a statistical package (or Table D.4 in Appendix D). As these intervals are based on the t­statistic, given by (6.3.6), they are called t­confidence intervals. These confidence intervals for tend to be longer than those obtained in Example 5, n is a 0 97­confidence interval. When we replace s being unknown. When n 6.3.6, and this reects the greater uncertainty due to then it can be shown that x by the true value of then x 3s 3 n is a 0 9974­confidence interval. ks As already noted, the intervals x n are not likelihood intervals for So the justification for using these must be a little different from that given in Example 6.3.6. 2, and it is not entirely In fact, the likelihood is defined for the full parameter clear how to extract inferences from it when our interest is in a marginal parameter like. There are a number of different attempts at resolving this issue. Here, however, we rely on the intuitive reasonableness of these intervals. In Chapter 7, we will see that these intervals also arise from another approach to inference, which reinforces our belief that the use of these intervals is appropriate. In Example 6.3.5, we have a sample of n 64 517 as our estimate of with standard error s calculated x Using software (or Table D.4), we obtain t0 975 29 interval for is given by 30 heights (in inches) of students. We 0 43434. 30 2 0452 So a 0 95­confidence [64 517 2 0452 0 43434 ] [63 629 65 405] 332 Section 6.3: Inferences Based on the MLE The margin of error is 0 888 so we are very confi