# How to apply Neyman-Pearson Lemma for simple hypotheses

I have two simple hypotheses:

$$H_0: \ \theta = \theta_0 \\ H_1: \ \theta = \theta_1$$

Let $$p_0$$ be the density under $$H_0$$ and $$p_1$$ the density under $$H_1$$.

Then we defined a Neyman-Pearson test to be of the form:

$$\phi_{NP}(X):=\begin{cases} 1, \quad \frac{p_1(X)}{p_0(X)}>c_0 \\ q, \quad \frac{p_1(X)}{p_0(X)}=c_0 \\ 0, \quad \frac{p_1(X)}{p_0(X)} Where $$c_0 \geq 0, q \in [0,1]$$. Then our version of the Neyman-Pearson lemma tells us that for any given level $$\alpha \in (0,1)$$ if $$\mathbb{E}_{\theta_0}[\phi_{NP}]=\alpha$$ then for all randomised tests $$\tilde{\phi}$$ with $$\mathbb{E}_{\theta_0}[\tilde\phi] \leq \alpha$$ it holds that $$\mathbb{E}_{\theta_1}[\tilde\phi] \leq \mathbb{E}_{\theta_1}[\phi_{NP}]$$

In my examples I‘m now asked to use this to construct the NP-test for two poisson distributions with unknown instensity $$\lambda$$, i.e. $$p_0(x)=\frac{1}{x!}e^{-\lambda_0}\lambda_0^x, p_1(x)=\frac{1}{x!}e^{-\lambda_1}\lambda_1^x, x=0,1,2,\dots$$ Now my solution manual states that we can always choose $$c_0$$ to be the $$(1-\alpha)$$-quantile of the distribution of $$\frac{p_1(X)}{p_0(X)}$$ under $$H_0$$ and then choose $$q$$ s.t.: $$\mathbb{P}(\frac{p_1(X)}{p_0(X)}>c_0)+q \mathbb{P}(\frac{p_1(X)}{p_0(X)}=c_0)=\alpha$$ The latter of course makes sense, but why choose $$c_0$$ as this quantile?

Then they calculate explicitly: $$\frac{p_1(X)}{p_0(X)}= \frac{p_1(x_1,\dots,x_n)}{p_1(x_1,\dots,x_n)}=e^{n(\lambda_1-\lambda_0)}(\frac{\lambda_1}{\lambda_0})^{\sum_{i=1}^n x_i}=g(\sum_{i=1}^n x_i)$$

Now because $$g$$ is strictly increasing the test can also be given as:

$$\phi_{NP}(X):=\begin{cases} 1, \quad \sum_{i=1}^n X_i >t_0 \\ q, \quad \sum_{i=1}^n X_i =t_0 \\ 0, \quad \sum_{i=1}^n X_i

where $$t_0$$ now simply is the $$(1-\alpha)$$-quantile of the distribution $$\sum_{i=1}^n X_i$$ under $$H_0$$. But I dont get why we would have $$c_0=(1-\alpha)$$-quantile of $$\frac{p_1(X)}{p_0(X)} \ \Leftrightarrow \ t_0=(1-\alpha)$$-quantile of $$\sum_{i=1}^n X_i$$?

So in summary my questions are:

1. Why choose $$c_0$$ as this quantile, couldn’t we achieve the desired mean value in the lemma by choosing $$c_0$$ anything and then just choosing $$q$$ appropriately?
2. I get that the $$>c_0$$ condition can be replaced by the $$>t_0$$ condition because of the monotonicity of $$g$$ but why would $$c_0=(1-\alpha)$$-quantile of $$\frac{p_1(X)}{p_0(X)} \ \Leftrightarrow \ t_0=(1-\alpha)$$-quantile of $$\sum_{i=1}^n X_i$$? (If this even is the case)
3. Does the strategy above work in all simple hypotheses cases?

Basically, the idea is that you want to reject the null when the likelihood ratio is large, so you choose $$c_0$$ to be as large as possible. In particular, this $$c_0$$ condition is not arbitrary: you want to choose $$c_0$$ to be as large as possible. However of course, you cannot choose $$c_0$$ to be TOO large, since then you would not reject often enough.
Does this answer your second question as well? The point here is that you want to reject when the likelihood ratio is large, and in this case, we reject when it is larger than $$c_0$$. The computation they did showed that "rejecting when the likelihood ratio is larger than $$c_0$$ is equivalent to rejecting when $$\sum X_i > t_0.$$"
Regarding the third question, this usually works for simple tests. The point of their computation was that $$g$$ is strictly increasing. In particular, they showed that $$\frac{p_1(X)}{p_0(X)} = g(Y(X)),$$ where $$g$$ is some increasing function and $$Y$$ is some statistic of the $$X$$. Then since $$g$$ is increasing, for all $$c_0$$, we know that there exists some $$t_0$$ so that $$\left\{ \frac{p_1(x)}{p_0(x)} \ge c_0 \right\} = \{g(x) \ge t_0\}$$ (though for this last part to be formal, you might need like strictly increasing). Thus these two events are the same, i.e. so the two conditions give the same rejection region.