# Hypothesis testing with Poisson RV

Hi I am still having some trouble with the following question: I have mostly figured out the first part but after that is where I get confused

Say we have random variables $X$~$Poisson(\lambda)$ and $\lambda_{1} \gt \lambda_{0} \gt 0$ set values and we want to test $H_{o}: \lambda=\lambda_{o}$ and $H_{1}: \lambda=\lambda_{1}$.

The question asks to show that the optimal test at a level $\alpha$ rejects the null hypothesis when $\bar X_n \gt c$ and find $c$, where $\bar X_n=\frac{1}{n}(x_{1}+...+x_{n})$ and furthermore show that the test that minimizes the sum of type one and type two errors rejects the null hypothesis when $\bar X_n \gt c*$ and find $c*$

What I have tried:

I simply use that the optimal test will reject the null hypothesis when $$f(x|\lambda_{o}) \lt kf(x|\lambda_{1})$$

ie when $$\frac{f(x|\lambda_{1})}{f(x|\lambda_{o})} \gt \frac{1}{k}$$

for which I solve that $$\bar X_{n} \gt \frac{-lnk+n(\lambda_{1}-\lambda_{o})}{nln(\lambda_{1}/\lambda_{o})}$$

So if I call the RHS my c then our optimal test rejects the null when $\bar X_{n} \gt c$

Now I know I also want to have that $Pr(\bar X_{n} \gt c : \lambda=\lambda_{o})=\alpha$ that is I want the c such that $Pr(\bar X_{n} \gt c)$given that $\lambda=\lambda_{o}$ is $\alpha$.

Ps: Is it correct to say that the optimal test at level alpha will be that test such that the type 2 error is smallest for alpha type one error? and I am confused on how to do that,

would it be like $$\sum_{x=0}^{c'}\frac{e^{{-\lambda_{o}} \lambda_{o}^{x}}}{x!}=\alpha$$ I mean how can I find such c?

But now I am confused on the second part. I want to show that the test that minimizes the sum of the type 1 and type 2 errors rejects the null when $\bar X_{n} \gt c*$ and find that $c*$.

I know that type 1 error occurs when we reject the null even though it is true and type 2 occurs when we accept the null even though it is false. So I am confused on this part. I know our optimal test rejected in the conditions above at level $\alpha$ so is it the same test

type 1:

$P(Xn \gt c : H_{o})=\alpha$

Type 2

$P(Xn \le c : H_{1})=\beta$

I have been trying for very long and will greatly appreciate any help one can offer, I am just confused on putting it all together. Thanks

I'll give my opinion on this matter. The aim is indeed to compute $c$ such that $\mathbb{P}(\overline{X}_n > c \ | \ \lambda = \lambda_0) = \alpha$. To that end you'll first need to verify the distribution of $\overline{X}_n$. It is well known (and easy to prove) that the sum of independent Poisson variables is again Poisson distributed. More precisely, \begin{align} &\mathbb{P}(\overline{X}_n > c \ | \ \lambda = \lambda_0) \\ & = \mathbb{P}(X_1+\ldots+X_n > nc \ |\ \lambda = \lambda_0) \\ & = \sum_{k = nc+1}^{\infty} \frac{(n\lambda_0)^k e^{-n \lambda_0}}{k!} \\ & = e^{-n \lambda_0} \left(\sum_{k=0}^{\infty} \frac{(n \lambda_0)^k}{k!} -\sum_{k=0}^{nc} \frac{(n \lambda_0)^k}{k!} \right) \\ & = e^{-n \lambda_0} \left(e^{n \lambda_0} - \underbrace{\sum_{k=0}^{nc} \frac{(n \lambda_0)^k}{k!}}_{(*)} \right) = \alpha \end{align} There is a closed form formula for the partial sum $(*)$ of the exponential series that might be useful, however it can turn out in an implicit expression for $c$.
• Perhaps you could use an approximated value, see for instance: math.stackexchange.com/questions/136996/…. What also might work is to approximate the Poisson distribution by a normal distribution (assuming $n$ is large enough). In that case (under the null hypothesis) $\overline{X}_n \sim N(\lambda_0, \lambda_0/n)$. This wil allow you an easier calculation of $\mathbb{P}(\overline{X}_n > c \ | \ \lambda = \lambda_0)$. – Cedric Cavents Apr 3 '16 at 6:46
• Apparently, I used the wrong terminology. I meant that it is not possible to find an explicit expression for $c$ (as far as I know). – Cedric Cavents Apr 4 '16 at 10:02