2WS30 - Mathematical Statistics
Homework 3 (2017) - Solutions
Note to the students: these solutions are for your reference only. In some parts I might elaborate more than what I expected you to do, while in others I might omit some details. Also, take the solutions with a grain of salt, as there might be typos and small errors.
Exercise 1. (a) The density of X is f (x)= 1 1 0 x ✓ . Clearly i ✓ ✓ { } 1 1 f (x)= 1 0 x/✓ 1 = g(x/✓) , ✓ ✓ { } ✓ where g(x)=1 0 x 1 , so this is a scale family, with scale parameter ✓. { } (b) For scale families we know that ✓ˆn/✓ is a pivotal quantity, where ✓ˆn is the maximum likelihood estimator of ✓. For this class of distributions we have seen in class that ✓ˆn = maxi Xi maxi Xi, therefore Q = ✓ is a pivotal quantity for ✓. (c) To use the pivotal quantity method we need to find an event involving Q with probability 1 ↵. Let’s find c so that ↵ P(Q c↵)=1 ↵. Clearly
P(Q c↵)=P(M/✓ c↵) = P(M ✓c↵) 1 xn 1 = n dx ✓n Zc↵✓ x n 1 = ✓ x=c↵✓ ⇣ ⌘n =1 c . ↵ 1/n Therefore we should take c↵ = ↵ . Now
maxi Xi P(Q c↵)=P ✓ , c ✓ ↵ ◆ meaning 0, 1 max X is a 100(1 ↵)% upper confidence interval for ✓. Plugging in ↵1/n i i the givenh information wei conclude that [0, 2.199] is a 95% CI interval for ✓. Note that we can significantly shorten this interval without changing the confidence level, as we know that with probability one ✓ max X . Therefore, a 95% CI interval for ✓ is [1.99, 2.199]. i i
1 (d) No, in this case we can not use Wald’s approach to construct an approximate confidence interval because the method is based on the asymptotic normality of the MLE. Wald’s theorem giving su cient conditions for the asymptotic normality of the MLE cannot be applied as the first assumption is violated, namely the support of the density function of Xi depends on ✓. Alternatively, the distribution of the MLE (which is M) is given in the question, and it is clearly not normal nor asymptotically normal , therefore Wald’s confidence intervals cannot be constructed.
Exercise 2. (a) The type I error of this test is the probability we reject the null hypothesis when it is true. Therefore
P✓=2( M 2 M c )=P✓=2(M 2) + P✓=2(M c) { }[{ } =0+P✓=2 M c ) { } c xn 1 = n dx 2n Z0 xn c = 2n x=0 =(c/2)n =(1.8/2)30 =0.0424 ,
where we used the fact that c<2 to compute the limits of integration.
(b) The power of the test is computed in an analogous fashion as in (a), but now ✓ =1.9. Therefore the power in this case is
P✓=1.9( M 2 M c )=P✓=1.9(M 2) + P✓=1.9(M c) { }[{ } =0+P✓=1.9 M c ) { } min(c,✓) xn 1 = n dx 1.9n Z0 =(1.8/1.9)30 =0.1975 .
(c) Although this is similar to (b) and (a), we need to realize now that the event M 2 no { } longer has probability zero, since ✓ =2.1.
P✓=2.1( M 2 M c )=P✓=2.1(M 2) + P✓=2.1(M c) { }[{ } 2.1 xn 1 c xn 1 = n dx + n dx 2.1n 2.1n Z2 Z0 xn 2.1 xn c = + 2.1n 2.1n x=2 x=0 =1 (2/2.1)30 +(1.8/2.1)30 =0.7784 . Note that although 2.1 is equally far from 2 than from 1.9 (in part (b)) the test is signifi- cantly more powerful against this alternative (so there is some asymmetry).
2 (d) We just refer back to (a), and simply have to solve the equation (c/2)n =0.05, so that c =2 0.051/30 =1.8099. ⇥ (e) Here n = 30 and the observed maximum m =1.99. The p-value is the significance level for which we are borderline in our decision, so this corresponds to taking c = m and computing the type I error. So, in conclusion, the p-value is (1.99/2)30 =0.8604.
Remark: note that this test has a very peculiar behavior that the p-value does not change smoothly. Suppose you actually observed a maximum m =2.00001. Then, no matter what the significance level is you would reject the null hypothesis, meaning the p-value is exactly 0 (makes sense, as you know that with probability one you cannot observe a value larger than 2 under the null).
Exercise 3. (a) Given the numerical values of the pH of the selected batch, there is not strong evidence to reject the hypothesis that these are samples from a normal distribution. Looking at the normal QQ plot (qqnorm(x) in R), we see that the dots fall roughly on a straight line, which is what you expect for data from a normal distribution. This is only a qualitative statement, and one should keep in mind that the sample size is very small. Quantitatively, we can look for example at the Shapiro-Wilk normality test (recall that
the null hypothesis corresponds to normality). This test has a p-value=0.9484 which is quite large (in comparison with the usual significance level ↵ =0.05). So this means there is no strong evidence against the normality hypothesis.
(b) Let µ denote the mean pH. We want to check whether the mean pH is really 5.4 at a significance level ↵ =0.1. Test H : µ =5.4 against H : µ =5.4. Because it is reasonable to assume the data 0 1 6 is a realization of a normal random sample this leads to the t-test we saw in class. The
3 corresponding test statistic is
x¯ µ t(x)= 0 ,µ=5.4 . s/pn 0 We reject the null hypothesis if the test statistic is larger than t↵/2;n 1 = t0.05;9 =1.833. For our datasetx ¯ =5.344 and s =0.1641 and so t(x)=1.07941. Since this is smaller than t0.05;9 there is not enough evidence to reject the null hypothesis. (c) There are various ways to interpret the definition of p-value. A particularly useful way is to regard the p-value as the significance level at which you are borderline in your decision (meaning that is the significance level is smaller you won’t reject the null hypothesis and if it is larger you will reject it). In the present example, you will be borderline in your decision if tp/2;n 1 = t(x)=1.07941 where p is the p-value. So we simply need to compute 2 P(T 1.07941) where T is a student-t random variable with n 1 degrees of freedom. ⇥ This can be done for instance using R: 2*(1-pt(1.07941,9)).Thep-value is therefore 0.3085. As a sanity check we notice, as expected, this is larger than 0.1, meaning the null hypothesis cannot be rejected at that significance level. If using the tables in the statistical compendium we cannot get a very fine grained eval- uation of the p-value. If one looks at the table with the quantiles of the t distribution we conclude that t0.2;9 < 1.07941 s s x¯ t↵/2;n 1 , x¯ + t↵/2;n 1 . pn pn with ↵ =0.1. Plugging in the values specific to our dataset we get [5.2489, 5.4391]. Since 5.4 is contained in this interval we are quite confident this could be a reasonable value for the mean, so we reach the same conclusion as in (b). From class we know this approach is entirely equivalent to the test in (b). Remarks: The function t.test in R would provide you with most of the numerical quantities you need for parts (a), (b), and (c). Simply type t.test(x,mu=5.4,conf.level=0.90). Exercise 4. (a) The Neyman-Pearson (NP) lemma tells us that when testing a simple null hypothesis against a simple alternative the most powerful test is based on the likelihood ratio statistic, which in this case is simply 100 0.02 (100 0.02)X X f0.02(X) e ⇥ ⇥X! 3 2 LR(X)= = X = e . f0.05(X) 100 0.05 (100 0.05) 5 e ⇥ ⇥X! ✓ ◆ The NP lemma tells us that we should reject H0 if LR(X) is large. Since LR(X)isa monotone decreasing function of X this means we should reject the null if X is small. 4 That is, we should reject the null if X c for some value of c to be specified. Since we want our test to have type I error approximately 0.125 we want to find c so that c i 5 5 P =0.05(X c)= e 0.125 . i! ⇡ Xi=0 By trial and error we see that the choice c = 2 yields a type I error of e 5(1 + 5 + 52/2) ⇡ 0.1247, which is very close to 0.125 (any other choice of c will result in a very di↵erent values of type I error). Keep in mind that the data is discrete, so only a discrete number of significance levels can be attained (by any deterministic test). The power of the test is the probability we actually reject the null under the alternative. So this is computed in the same way as the type I error, but for =0.02. So the power is c i 2 2 2 2 P =0.02(X c)= e e (1 + 2 + 2 /2) 0.6767 . i! ⇡ Xi=0 (b) Actually we almost answered this in part (a). Take 0 <