# "We have the Random Variable X, which is Gamma (p,lambda) distributed with the density: fp,lambda (x)=lambda p Gamma(p)*xp−1*e−lambda x with p=10 and H_0:lambda=2 or H_1:lambda=4 and alpha=0.001

We have the Random Variable X, which is $\mathrm{\Gamma }\left(p,\lambda \right)$ distributed with the density:
${f}_{p,\lambda }\left(x\right)=\frac{{\lambda }^{p}}{\mathrm{\Gamma }\left(p\right)}\cdot {x}^{p-1}\cdot {e}^{-\lambda x}$
with p=10 and ${H}_{0}:\lambda =2$ or ${H}_{1}:\lambda =4$ and $\alpha =0.001$
I want to apply the Lemma of Neyman Pearson which states:
Be c>0 fixed and chosen in the way that $A\left(c\right)=\left\{x\in B:\frac{{f}_{0}\left(x\right)}{{f}_{1}\left(x\right)}\ge c\right\}$ such that ${\mathbb{P}}_{{H}_{0}}\left(X\in A\left(c\right)\right)=\alpha$
Then the test with the region A(c) among all tests with significance level $\alpha$ is the most powerful.
I am now trying to calculate A(c), but got stuck. I have:
${\int }_{A\left(c\right)}{f}_{0}\left(x\right)dx={\int }_{A\left(c\right)}\frac{{\lambda }^{p}}{\mathrm{\Gamma }\left(p\right)}\cdot {x}^{p-1}\cdot {e}^{-\lambda x}dx=\alpha .$
But I don't know how to get A(c) from this integral...
$\frac{{f}_{0}\left(x\right)}{{f}_{1}\left(x\right)}=\frac{1}{1024}\cdot {e}^{2x}$
You can still ask an expert for help

• Questions are typically answered in as fast as 30 minutes

Solve your problem for the price of one coffee

• Math expert for every subject
• Pay only if we can solve it

Phillip Fletcher
For the hypotheses ${H}_{0}:\lambda ={\lambda }_{0}$ and ${H}_{1}:\lambda ={\lambda }_{1}$ you have:
$\mathrm{ln}{f}_{0}\left(x\right)-\mathrm{ln}{f}_{1}\left(x\right)=p\left(\mathrm{ln}{\lambda }_{0}-\mathrm{ln}{\lambda }_{1}\right)-x\left({\lambda }_{0}-{\lambda }_{1}\right).$
Hence, we have:
$\frac{d}{dx}\left(\mathrm{ln}{f}_{0}\left(x\right)-\mathrm{ln}{f}_{1}\left(x\right)\right)={\lambda }_{1}-{\lambda }_{0}.$
If ${\lambda }_{1}<{\lambda }_{0}$ then the likelihood ratio is an increasing function of x so the region A(c) is of the form $\left[{x}_{c},\mathrm{\infty }\right)$. (Alternatively, if ${\lambda }_{1}<{\lambda }_{0}$ then the log-likelihood ratio is a decreasing function of x so the region A(c) is of the form $\left[0,{x}_{c}\right]$.) In the former case we have:

where the last line in this equation uses the incomplete gamma function. Hence, the boundary value ${x}_{c}$ is the value that solves:
$\mathrm{\Gamma }\left(p,{\lambda }_{0}{x}_{c}\right)=\frac{\alpha }{{\lambda }_{0}}\cdot \mathrm{\Gamma }\left(p\right).$
This value can be obtained numerically from the incomplete gamma function.
Application to your example: In your question you have p=10, ${\lambda }_{0}=2$ and ${\lambda }_{1}=4$. Since ${\lambda }_{1}>{\lambda }_{0}$ the likelihood ratio is an increasing function of x and so you have $A\left(c\right)=\left[{x}_{c},\mathrm{\infty }\right)$ with the boundary value ${x}_{c}$ solving:
$\mathrm{\Gamma }\left(10,2{x}_{c}\right)=\frac{\alpha }{2}\cdot \mathrm{\Gamma }\left(10\right).$