Solved – Likelihood ratio test for the Bernoulli parameter with one-sided hypothesis

hypothesis testinglikelihood-ratiomaximum likelihood

I have a sample $X_1, \dots, X_n \sim Bern(p)$ and need to test $$H_0: p = p_0\\H_1: p < p_0$$ using the likelihood ratio test. I know how to do it for the two-sided alternative: we should calculate $$LR = 2 (\ln L(x, \hat{p}^{ML}) – \ln L(x, p_0))$$ where $L(x, \cdot)$ is a likelihood function and $\hat{p}^{ML} = \bar{x}$. And then use the fact that $$LR \underset{H_0}{\sim} \chi^2(1)$$ to test the hypothesis. But how should I incorporate the fact that the alternative now is $p < p_0$? Should the distribution of $LR$ change in this case?

Would be very grateful for any help!

Best Answer

Let us consider the example, suppose we are testing $$H_0: p = 0.5\\H_1: p<0.5$$ and suppose that $\bar{x} = 0.4$. $$L(X, p) = p^{\sum X_i}(1-p)^{n - \sum X_i}$$ maximizing it wrt $p$ subject to $p \le 0.5$ yileds $\hat{p} = \bar{x} < 0.5$ and hence $$\Lambda = \frac{0.4^{\sum X_i}0.6^{n - \sum X_i}}{0.5^n} \ge k \iff \sum X_i \ln 0.4 + (n - \sum X_i)\ln 0.6 \ge k_1 \iff \sum X_i \le C$$ And it remains to find such a $C$ that $\mathbb{P}\left(\sum X_i \le C\right|p=0.5) = \alpha$, which we can do using, for example the CLT $$\frac{\sum X_i - np}{\sqrt{p(1-p)}} \approx \mathcal{N}(0, 1) \to 2\sum X_i - n \underset{H_0}{\approx} \mathcal{N}(0, 1) \to \mathbb{P}\left(\sum X_i \le C\right) = \mathbb{P}\left(2 \sum X_i - n \le 2C - n\right) = 0.05 \to 2C - n = 1.64 \to C = \frac{n+1.64}{2}$$.

Thus, we reject the null if $\sum X_i \le \frac{n+1.64}{2}$