I have a problem computing likelihood ratio using computer for Neyman-Pearson lemma.
Think of a sample with size $n$. Each event follows a Bernoulli distribution. We want to perform a hypothesis test in which $H_0: p_0 = \frac{3}{4}$ and $H_A: p_A = \frac{1}{4}$.
If the initial guess is true, we have approximately $\frac{3n}{4}$ successes.
Hence, to compute likelihood ratio, we have: $$ \Lambda(X) = \frac{\prod p_0^{X_i}(1-p_0)^{1-X_i}}{\prod p_A^{X_i}(1-p_A)^{1-X_i}} = \frac{p_0^{\#success}(1-p_0)^{\#failure}}{p_A^{\#success}(1-p_A)^{\#failure}} $$ For a large sample we have $\#success \approx np$, so: $$ \Lambda(X) \approx \frac{p_0^{np}(1-p_0)^{n-np}}{p_A^{np}(1-p_A)^{n-np}} $$
For $p_0 = \frac{1}{4} \text{ and } p_A = \frac{3}{4}$ and a true initial guess, we have: $$ \Lambda(X) \approx \frac{(\frac{3}{4})^{\frac{3}{4}n}(\frac{1}{4})^{\frac{1}{4}n}}{(\frac{1}{4})^{\frac{3}{4}n}(\frac{3}{4})^{\frac{1}{4}n}} = \frac{(\frac{3}{4})^{\frac{n}{2}}}{(\frac{1}{4})^{\frac{n}{2}}} = 3^{\frac{n}{2}} $$
The problem Just starts. For $n$ larger than some value about 100, the likelihood ratio we obtained is too large to be stored in any variable in R or C/C++. What is your recommandation to complete the process of Neyman-Pearson lemma?