4/22: Textbook. Exercises: 10.8, 10.19(a), 10.35.
4/24: Textbook. Exercises: 10.31, 10.32, 10.33, 10.34, 10.36, 10.37
4/27: In exercise 10.36, you were asked to derive two Wald statistics to run approximate large sample test. Now let n=25, α=1, H0:β=β0=2. Please numerically compare the power of these two test when the true value of β is 3, by running the test on the data for 10,000 times, and see which one rejects the null hypothesis more often. Try to interpret the result.
I am not satisfied with some of your answers to 9.23 in the homework returned today. I am giving a second chance for those who lost points for 9.23. You may submit your new answers (especially the numerical answers) along with this homework. I will consider adding back some points to that homework assignment. Please indicate that how many points you lost for 9.23. For the numerical answer, I have provided a Monte Carlo method to calculate the p value in the solution. You should use some other approach. For example, you can calculate the p value by taking the sum of the probabilities of x which satisfies LR(x)<LR(x0) for x=0,1,2,…,10000 (instead of ∞) to approximate the p value, where x0 is the observed data. This is just one suggestion and there are other approaches.
Due on 05/01
4/29:
Textbook. Exercises: 10.38.
Suppose that a random variable X has a Poisson distribution for which the mean θ is unknown. Find the Fisher information I(θ) in X.
Suppose X1,…,Xn∼Pois(θ). Find the large sample Z test, score test and LRT for testing H0:θ=2 vs Ha:θ≠2.
Simulate the distribution of −2log(λn) using the empirical distribution function (EDF) and compare it with the CDF of χ2(1) distribution. You may revise the following code shown in the class to draw the EDF and CDF. Simulate a large number of data samples (say 5000), where each sample has size n. Make the case for n=5 and n=100.
5/1:
Read Example 10.4.5 and finish exercise 10.40; finish exercise 10.41, 10.47 and 10.48.
As in Example 10.3.4, with X∼Multinomial(n,p1,…,p5). Compare H0:p1=p2=p5=0.01,p3=0.5 v.s. H1: H0 is not true.
Derive the likelihood ratio test for n=1 and n=100 with level α=0.05.
Give an estimate of P(Ho|H1) when p1=p2=p5, p3=0.3, n=100, using simulation. Note that this is the probability of making type II error. Present the program.
Compute P(Ho|H1) when p1=p2=p5, p3=0.3, n=1.
Remark 1: in computing, sometimes it is better to use log(00) instead of 0∗log(0) as the latter can cause numerical trouble.
Remark 2: What is the difference in degrees of freedom? Think how many additional constraints are imposed.
Remark 3: You can try several combinations of pk's that satisfy p1=p2=p5, p3=0.3.
R code notes pp. 60, fig10.r
- myfun=function(n){
- m=1000
- x=rgamma(m,n,1)/n # m X’s
- y=-2*(n*log(x)+n*(1-x)) # m λ’s
- u=rchisq(m,1)
-
- qqplot(y,u,main=paste("QQ plot, n=",n))
- lines(y,y)
-
- sy=sort(y)
- plot(sy,ppoints(sy), xlim=c(0.5,2), ylim=c(0.4,0.9), type="l", lty=1, main=paste("CDF, n=",n))
- lines(sy,pchisq(sy,1), xlim=c(0.5,2), ylim=c(0.4,0.9), type="l", lty=2)
- }
-
- pdf("fig10.pdf",height=9.0, width=6.5)
- par(mfrow=c(2,2))
- n=1
- myfun(n)
- n=100
- myfun(n)
- dev.off()
Due on 05/06