Finding Generalized Linear Ratio Test Statistic for binomial distrributions

#1
Suppose that \(X\) is a random variable with that follows a binomial distribution with parameters \(n\) and \( p_x\). And let \(Y\) be a random variable independent of \(X\) with a binomial distributions with parameters \(m\) and \(p_y\). I would like to find the generalized likelihood ratio test statistic \(T\) given that \(H_0: p_x=p_y\) vs \(H_a:p_x \neq p_y\).

Now here is the solution to the problem step by step.


We know that the MLE for \( p_x\) is just \(\hat{p_x}=\dfrac{x}{n}\) and for \( p_y\) is just \(\hat{p_y}=\dfrac{y}{m}\) I already found the MLE if \(p=p_x=p_y\) which was \( \hat{p_0}=\dfrac{x+y}{m+n}\). Now lastly we need to find the GLRT test statistic \( T[ /math] which is

[1]: http://i.stack.imgur.com/7LzGF.jpg







From the picture then \(\hat{\theta}=\hat{p}\) and \(\hat{\theta_0}=\hat{p_0}\)(under the \(H_0\).

Therefore

\(L(x,y|\hat{p_x}\hat{p_y})={n\choose x }{m\choose y}\hat{p_x}^{x}\hat{p_y}^y(1-\hat{p_x})^{n-x}(1-\hat{p_y})^{m-y}\)

\(lnL(x,y|\hat{p_x},\hat{p_y})=ln({n\choose x })+ln({m\choose y})\)
\(+xln(\hat{p_x})+yln\hat{p_y}+(n-x)ln(1-\hat{p_x})+(m-y)ln(1-\hat{p_y})\)

Now for the second piece we get
\( L(x,y|\hat{p_0})={m\choose y}{n\choose x} \hat{p_0}^{x+y}(1-\hat{p_0})^{m+n-x-y}\)
\(ln L(x,y|\hat{p_0})=ln({m\choose y})+ln({n\choose x})\) \(+(x+y)ln(\hat{p_0})+(m+n-x-y)ln(1-\hat{p_0})\)

Thus \(T=2(xln(\hat{p_x})+yln\hat{p_y}+(n-x)ln(1-\hat{p_x})\)
\(+(m-y)ln(1-\hat{p_y})-(x+y)ln(p_0)-(m+n-x-y)ln(1-\hat{p_0})) \)
I don't know if all this is correct and I hope it is. I am lost with this problem and this is my solution so far. Thanks.

Update:
I noticed there are alot of views but no replies. Is there parts that are confusing that need clarification? or is it right?\)
 
Last edited: