{"word_count": 286, "character_count": 2110}
In the mathematical statistics course today, we started talking about tests, and decision rules. To illustrate all the concepts introduced today, we considered the case where we have a sample  with . And we want to test  against In the course, we've seen that we could use a test based on the order statistics .  The test would bei.e. if  we choose , and if , we choose .From the definition of the first order risk,we can easily get thatThus, the power is thenTo visualize it, use the following parametersn=5alpha=.1theta0=1ThenC1=theta0*(1-alpha)^(1/n)theta=seq(0,2,by=.01)P1=(1-(theta0/theta)^n*(1-alpha))*(theta&#62;C1)plot(theta,P1,type="l",lwd=2,col="blue",xlab="",ylab="Power")Note that, so far, we did never consider the maximum of our sample. Assume that the maximum is , then we can compute the -value,Here it isPV=(1-theta^n)*(theta&#60;=1)plot(theta,PV,type="l",lwd=2,col="blue",xlab="",ylab="p-value")Now, why not consider another test, based on the minimum (since we have the distribution of the minimum of a sample from a uniform distribution). The test is the same as beforebut here, the threshold isThe power of the test is hereThis test has the same significance level (by construction), but the power of the test is clearly lower than the one we got using the maximum of our sample, when C2=theta0*(1-alpha^(1/n))P2=(1-(theta0/theta)*(1-alpha^(1/n)))^n*(theta&#62;C2)lines(theta,P2,type="l",lwd=2,col="red")Why not consider a test based on ? The problem is that we need the distribution (more specifically the survival distribution) of . We can compute it, numerically. But that might be painful. An alternative is to consider some approximation, based on the central limit theorem, i.e.Our test is based on , and to get the same significance as before, useThe power of the test is thenHere it ismu=2*(theta0/2)s2=2^2*(theta0^2/12)/nC3=qnorm(1-alpha,mu,sqrt(s2))(P=1-pnorm(C3,theta,sqrt(s2)))*(theta&#62;C3)lines(theta,P)Observe here that the test based on the maximum is not more powerful than the one based on the average (I just wonder if it could be due to the Gaussian approximation...).