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$, $\alpha=1$, $H_0:\beta=\beta_0=2$. Please numerically compare the power of these two test when the true value of $\beta$ 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(x_0)$ for $x=0,1,2,\dots,10000$ (instead of $\infty$) to approximate the p value, where $x_0$ 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 $\theta$ is unknown. Find the Fisher information $I(\theta)$ in $X$.
Suppose $X_1,\dots,X_n\sim Pois(\theta)$. Find the large sample $Z$ test, score test and LRT for testing $H_0:\theta=2$ vs $H_a:\theta\neq 2$.
Simulate the distribution of $-2\log(\lambda_n)$ using the empirical distribution function (EDF) and compare it with the CDF of $\chi^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 $\mathbf{X}\sim \textrm{Multinomial}(n,p_1,\ldots,p_5)$. Compare $H_0: p_1=p_2=p_5=0.01, p_3=0.5$ v.s. $H_1$: $H_0$ is not true.
Derive the likelihood ratio test for $n=1$ and $n=100$ with level $\alpha=0.05$.
Give an estimate of $P(H_o|H_1)$ when $p_1=p_2=p_5$, $p_3=0.3$, $n=100$, using simulation. Note that this is the probability of making type II error. Present the program.
Compute $P(H_o|H_1)$ when $p_1=p_2=p_5$, $p_3=0.3$, $n=1$.
Remark 1: in computing, sometimes it is better to use $\log(0^0)$ 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 $p_k$'s that satisfy $p_1=p_2=p_5$, $p_3=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