# Neyman-Pearson Lemma and hypothesis-testing

Consider testing $H_0:\theta=\theta_0$ vs $H_1:\theta=\theta_1$, where the pdf or pmf corresponding to $\theta_i$ is $f(x|\theta_i)$, $i=0,1$ using a test with rejection region R that satisfies

$x\in R$ if $f(x|\theta_1)>kf(x|\theta_0)$ and $x\in R^c$ if $f(x|\theta_1)<kf(x|\theta_0)$ for some $k\geq 0$ and $\alpha=P_{\theta_0}(X\in R)$

And any test that satisfies it is a UMP test with $\alpha$ level.

How do I find the value of k?

Suppose I have a test $H_0:\theta=\theta_0$ vs $H_1:\theta=\theta_1$ with pdf $f(x|\theta)$ and I want a test with size $\alpha=0.1$.

Then $x\in R$ if $\frac{f(x|\theta_1)}{f(x|\theta_0)}>k$ so for I find $k$ I did $P_{\theta_0}(X\geq k)=0.1$?

and my critical region is $x\geq k$?

• One example has been worked out here, among others on CV. – Christoph Hanck Jun 17 '15 at 4:14

The false alarm probability $\alpha$ (also called the Type I error probability) is the probability that the value of the single observation $X$ lies in the rejection region $R$ when $H_0$ is the true hypothesis. Note that when $X \in R$, the null hypothesis $H_0$ is rejected (and in this case, the alternative $H_1$ is accepted). So, (for continuous random variables) $$0.1 \geq \alpha = \int_R f(x\mid \theta_0)\,\mathrm dx.\tag{1}$$ Any region for which $(1)$ holds is a possible candidate that can serve as the rejection region. Which of these should we choose? Well, the power $\beta$ of the test is the probability of correctly declaring in favor of $H_1$ (rejecting $H_0$) when $H_1$ is indeed the true hypothesis, that is, $$\beta = \int_R f(x\mid \theta_1)\,\mathrm dx = \int_R f(x\mid \theta_0)\times \frac{f(x\mid \theta_1)}{f(x\mid \theta_0)}\,\mathrm dx = \int_R f(x\mid \theta_0)\Lambda(x)\,\mathrm dx\tag{2}$$ where $\Lambda(x)$ is the likelihood ratio. Maximizing the power $\beta$ while still managing to avoid the abyss of $\alpha$ exceeding $0.1$ seems like a reasonable goal to strive for. But how should we go about doing this? Clearly, we want to include in $R^*$, the optimum region for which $(1)$ holds and $\beta$ is maximized, those $x$ for which $\Lambda(x)$ is as large as possible. So, start with the global maximum of $\Lambda(x)$ as the point we definitely want to include in $R^*$ and then search for points where $\Lambda(x)$ is smaller than the global maximum but still large, including such points in $R^*$. Keep your eye on $(1)$ though, and stop as soon as you have achieved the desired $\alpha$. The region $R^*$ depends on what the likelihood ratio looks like. It is not the case that $R^* = \{x\colon x \geq k\}$ as you think but rather that $$R^* = \left\{x\colon \Lambda(x) \geq k\right\}.$$ This translates into $\{x\colon x\geq \hat{k}\}$ only if $\Lambda(x)$ is an increasing function of $x$.