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


STAT 426 – Categorical Data Analysis

Homework 2

2022


Please submit your HW in output file of R Markdown. Your output file should include all the R codes.

1. Suppose random variables X1, X2, ..., X5 are independent Poisson random variables with means λk = k for k = 1, 2, ..., 5.

(i) What is the probability distribution of the random vector (X1, X2, ..., X5) given = 20?

(ii) What is the probability distribution of X1 given = 20?


2. Suppose 100 random numbers are independently generated from a uniform distribution on interval (0, 1). Let Nk denote the number of the random variables falling in the interval for k = 1, 2, 3, 4, 5. Denote the vector N = (N1, N2, N3, N4, N5)'.

(i) What is the probability distribution of N?

(ii) What is the expected value vector E[N]?

(iii) Display the 5-by-5 covariance matrix of N as a matrix in R Markdown using Latex syntax.


3. Suppose we sample from N of problem 2 and obtain the dataset n1 = 14, n2 = 18, n3 = 19, n4 = 16, n5 = 33. We wish to test the null hypothesis that the random numbers are truly from a uniform distribution on (0, 1).

(i) Use chisq.test() to find p-value of the Pearson chi-square test using the asymptotic distribution of the statistic.

(ii) Use chisq.test() to approximate the exact p-value of the Pearson chi-square test through simulation.


4. Using the same data and problem as in 3.

(i) Find the p-value of the likelihood ratio test using the asymptotic distribution of the statistic.

(ii) Use simulation to approximate the exact p-value of the likelihood ratio test.


5. Just as in the multinomial example in the notes, compare the exact and asymptotic distribu-tions of the Pearson chi-square statistic in the Benford’s Law problem but with a sample size of 10 rather than 60.

(i) Plot the exact and asymptotic cumulative distributions functions side by side.

(ii) In the worst case, about how much do these functions differ?