# Which is the correct solution to the hypothesis testing: $H_0 : \lambda =65, H_1 : \lambda >65$ , $X$ is a Poisson ($\lambda$) ,$\alpha=0.05$

Given the following hypothesis test: $$H_0 : \lambda =65, H_1 : \lambda >65$$ , where $$\lambda$$ is the parameter of an $$X$$ distributed as a Poisson $$\alpha=0.05$$ . We have n=10 samples. Using as statistics the mean $$\bar X$$ Find the rejection region.

I did this: Let $$S = \bar Xn$$ , $$S$$ is distributed as a $$Poiss(n\lambda=650)$$

Let the rejection region be $$R= \{\underline X: T(\underline X)=\bar X \ge c \}$$ Since the test has level $$\alpha$$

$$\mathbb{P}( \bar X\ge \gamma|\lambda=65)\le \alpha$$

$$\mathbb{P}(S \ge n\gamma|\lambda=65)\le \alpha$$

$$\mathbb{P}(S \ge \gamma^*|\lambda=65)\le \alpha$$

$$nc=c^*=\min\{\gamma^* : \mathbb{P}(S \ge \gamma^*|\lambda=65)\le \alpha \}$$

Can I claim $$c$$ is the quantile of level $$1-\alpha=0.95$$ ? With R:

> qpois(0.95,650)
[1] 692
> 1-ppois(692,650)
[1] 0.0488844
> 1-ppois(691,650)
[1] 0.05290045


Since 1-ppois(692,650) is the probability from 692 onwards, not including 692. I claim $$c^*=693$$ as oposed to the result of the qpois command qpois(0.95,650). So the answer is $$R= \{\underline X: T(\underline X)=\bar X \ge 69.3 \}$$

My lecturer did this: Let $$S = \bar Xn$$ , $$S$$ is distributed as a $$Poiss(n\lambda=650)$$

Let the rejection region be $$R= \{\underline X: T(\underline X)=\bar X \ge c \}$$ Since the test has level $$\alpha$$

$$\mathbb{P}( \bar X\ge \gamma|\lambda=65)\le \alpha$$

$$\mathbb{P}(S \ge n\gamma|\lambda=65)\le \alpha$$

$$\mathbb{P}(S \ge \gamma^*|\lambda=65)\le \alpha$$

$$nc=c^*=\min\{\gamma^* : \mathbb{P}(S \ge \gamma^*|\lambda=65)\le \alpha \}$$

$$nc=c^*=\min\{\gamma^* : 1- \mathbb{P}(S \le \gamma^*|\lambda=65)\le \alpha \}$$

$$nc=c^*=\min\{\gamma^* : \mathbb{P}(S \le \gamma^*|\lambda=65)\ge 1-\alpha \}$$...(1)

And said that (1) was the definition of the $$0.95$$-quantile and that therefore $$c^*$$=qpois(0.95,650)$$=692$$ and therefore that the answer was $$R= \{\underline X: T(\underline X)=\bar X \ge 69.2 \}$$?

But I disagree, I think (1) is wrong and it should be

$$nc=c^*=\min\{\gamma^* : \mathbb{P}(S \le \gamma^*-1 |\lambda=65)\ge 1-\alpha \}$$...(1') in addition to my different answer

So I claim:

1 The R output proves (1) is not the definition of the 0.95-quantile? It's just somefing else, but I can't called it the 0.95-quantile, can I?. Of course in the continuous case it would certainly be definition of the 0.95-quantile

2 (1) is incorrect, it should be (1')

3 The answer to the problem is $$R= \{\underline X: T(\underline X)=\bar X \ge 69.3 \}$$?

Are my claims correct? If not, why?

• Your version of $(1^\prime)$ is not equivalent to anything that preceded it, so how did you derive it?
– whuber
Commented May 3, 2022 at 20:03
• @whuber Since $\gamma^*$ is a value of a Poisson, it's an integer: $\mathbb{P}(S \ge \gamma^*|\lambda=65)= 1- \mathbb{P}(S < \gamma^*|\lambda=65) = 1-\mathbb{P}(S \le \gamma^*-1|\lambda=65)$ and then solving $1-\mathbb{P}(S \le \gamma^*-1|\lambda=65) \le \alpha$ for the probability yields (1') Commented May 3, 2022 at 21:49
• So what you are really complaining about--and it looks legitimate--is not $(1),$ but rather the line that immediately precedes it.
– whuber
Commented May 3, 2022 at 22:40
• @whuber Yes, I am saying the final result is wrong, but I wasn't sure if arguing that $\gamma^*$ is an integer was ok, after all if S is a Pois(650) ,$P(S \le 5.9)=P(S \le 5)$ for instance Commented May 3, 2022 at 22:51

Preliminary. For samples and discrete distributions, there are various definitions of quantile. Here it seems useful to show the values returned by qpois, a Poisson quantile function. The 95th quantile of the random variable $$X\sim \mathsf{Pois}(\lambda=5)$$ is $$9$$ because that is the smallest value $$q$$ such that $$P(X \le q) \ge 0.95.$$ For a discrete distribution this is intended to be the closest useful inverse of the CDF.

qpois(.95, 5)
[1] 9
ppois(9, 5)
[1] 0.9681719  # just above 0.95, but exact unavailable
ppois(8, 5)
[1] 0.9319064  # just below 0.95.


Let's look at the graph of the CDF of $$\mathsf{Pois}(5).$$ (Open circles show the exact values of the CDF at relevant integer values.

k = 0:15;  CDF = ppois(k, 5)
plot(k, CDF, type="s");  points(k, CDF)
abline(h = .95, col="red")
abline(v = 9, col="red")
abline(h = 0, col="green2")
abline(v = 0, col="green2")


A graph for $$\lambda = 65$$ would be similar, but harder to read accurately.

For your question: You have the distributions of $$S = \sum_{i=1}^{10} X_i \sim \mathsf{Pois}(65)$$ and of the related discrete distribution $$\bar X = S/n.$$ You want to find $$c$$ such that the rejection region for $$H_0: \lambda = 65$$ against $$H_1: \lambda > 65$$ has level $$\alpha = 0.05 = 5\%$$ without exceeding $$5\%.$$

You have proposed a solution different from the one given in class; in terms of your work, @whuber has given you a fine clue as to the correct answer. Without going into details of your derivation, I will show relevant simulations. Then I hope you can finish the problem.

In the R code rej is a logical vector containing a million TRUEs and FALSEs, and mean(rej) gives the proportion of TRUEs, which is an approximation to the rejection probability when $$H_0$$ is true (accurate to two or three places).

set.seed(2022)
rej = replicate(10^6, mean(rpois(10,65)) >= 69.1)
mean(rej)
[1] 0.056708   # 69.1 gives answer that's too large

rej = replicate(10^6, mean(rpois(10,65)) >= 69.2)
mean(rej)
[1] 0.052556  # 69.2: still too large

rej = replicate(10^6, mean(rpois(10,65)) >= 69.3)
mean(rej)
[1] 0.04865    # 69.3: largest value below 5%

rej = replicate(10^6, mean(rpois(10,65)) >= 69.4)
mean(rej)
[1] 0.045184   # below 5%, but too low

• So are you saying my solution is wrong and the lecturer's is ok? Because I was pretty sure mine was ok, I just wanted confirmation Commented May 3, 2022 at 23:03
• This comment/question appeared a few seconds before I finished. So not sure what you saw. Also, before you could have read it carefully. So I'm not sure what you concluded and why. Commented May 3, 2022 at 23:24
• So for the quantile thing , you agree that, using your POISS(5) as example if I wanted a rejection region of the form $[c, +\infty]$, c = 10, and one of the points in my post was that it is NOT qpois(.95, 5)=9 directly so the set defining it as written by the lecturer did not implied to find the quantile, at least considering the definition you have given which was the same I was using. Note the lecturer had written using your example, c= qpois(.95, 5)=9 Commented May 3, 2022 at 23:35
• Then you wrote that I should finish the problem, unless you mean I was wrong, the solution I posted was already complete, so I was looking for a correction/confirmation Commented May 3, 2022 at 23:37
• Your answer seems OK to me. But for practical purposes, there is little difference between the two. You are working very nearly at the 5% level either way. // A more traditional approach may be to use a normal approximation to Poisson, which is not terrible for $\lambda$ as large as 65. // Also for simplicity of presentation it may be reasonable to ignore the slight inaccuracy using "95th quantile" as 692. // It is clever of you to notice the difference in order to get closer to 5% level, and you can show lecturer what you have done, but maybe not best to claim lecturer made a "mistake." Commented May 4, 2022 at 2:20