Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

HW Question 9

STA 2212S 2023

(a)Goodness- of-fit tests The data plotted in SM Figure 7.5 is computed from SM Table  1.1,  and listed below.   The values  are the differences in height be- tween matched pairs of maize plants.   The data can be read into R with scan(file="https://utstat.toronto.edu/reid/sta2212s/HW9data").

6.125, −8.375, 1, 2, 0.75, 2.875, 3.5, 5.125, 1.75, 3.625, 7, 3, 9.375, 7.5, −6

(i) Plot the empirical cumulative distribution function, and overlay the plot with a normal cdf where µ and σ 2  are estimated by the sample mean and variance.

(ii) Test the goodness-of-fit of the data to a normal distribution using the 1.  Kolmogorov-Smirnov test, 2.  the Cramer-vonMises test, and 3.  the Anderson-Darling test.  The rst is available in base R as ks.test, and the other two are available in the package goftest.

(iii) Using the same data, create 4 bins determined by the quartiles of the data  (e.g.   use quantiles(x, c(.25,.5,.75))),  and compute the χ2 goodness-of-fit statistic

where yj  are the counts in the 4 bins, θˆ = ( , 2 ),  =  is the sample mean and 2  = (n − 1)1 Σ(xi − )2  is the sample variance.

(iv) Finally, compute the χ2  goodness-of-fit statistic with θ = (µ , σ 2 ) esti- mated by maximizing the multinomial likelihood function

Summarize the results of the goodness-of-fit tests in a small table.

(b) A non-regular problem: Suppose that (X1i , X2i), i = 1, . . . , n follow the bivariate normal distribution with expected value (θ1 , θ2 ) and identity covariance ma- trix: the joint distribution of the sample (x1 , x2 ) = (x11 , . . . , x1n , x21 , . . . , x2n) is then

The parameter space is restricted to θ 1  0, θ2  0.

(i) Show that the maximum likelihood estimators of θ 1  and θ2  are given by

(ii) Derive the form of the log-likelihood ratio statistic w = 2{ℓ(θˆ) − ℓ(θ0 )} for testing H0  : (θ1 , θ2 ) = (θ01 , θ02) = (0, 0).

(iii) Show that the distribution of w under H0  is

where 6{0}  is a point mass at 0.