# Likelihood Ratio Test Statistic

#### starlet

##### New Member
Hi guys,

Heres my problem:

**********
Data X1,X2,....,Xn, n = 20, are available of numbers of flaws per 10 metres
of bales of a manufactured material. Assuming that the Poisson model is valid
for these data, the probability mass function of X is:

fx(x; theta) = [(theta^x).(exp(-theta))] / x! where x = 0,1,2... ; theta > 0 and with mean E(X) = theta

The average number of flaws per 10 metres was known to be 5 prior to installation of new machinery. It is suspected that this average may have increased.
We now wish to test the following hypotheses about the value of the mean theta:
H0 : theta = 5 against H1 : theta = 10.
Derive the likelihood of the sample X1,X2,...,X20 from the Poisson distribution with parameter theta and hence derive the likelihood ratio test statistic
lambda(x) of the hypotheses H0 : theta = theta0 against H1 : theta = theta1, where theta1 > theta0.
Show that rejecting H0 in favour of H1 for low values of lambda(x) corresponds
exactly to a rejection region of the form {x:t(x) > c}, where T(X) = Sigma(Xi) (i=1 to n), the sample total, and state what optimal property this test possesses.
************

Ive got the likelihood L(theta;x) and think i have the likelihood ratio as:

lambda(x) = [(theta0^SigmaXi)(exp(-n.theta0))] / [(theta1^SigmaXi).(exp(-n.theta1))]...?

Is this first part right? if not i'm completely lost and if so i'm not entirely sure how to go about doing the rest of the question.

Please help and apologies for the long winded question...i really need to learn how to post in math language lol!

Much appreciated

#### BGM

##### TS Contributor
Yes, your likelihood ratio looks correct. Please continue.

#### starlet

##### New Member
Thanks I've managed to work out the rest of the question too but there's a follow up that i dont really understand how to do...

Making use of the Normal approximation to the Poisson distribution, namely
that for large theta of, say, 10 to 20 or more, the Poisson distribution with parameter theta can be approximated by a Normal distribution with mean and variance both equal to theta, calculate the critical value c required for the test in (ii) to
achieve a signi cance level alpha = 0.05 (as nearly as possible). [You may use the fact that the sum of n independent random variables Y1, Y2,...Yn which follow Poisson distributions with parameters lambda1, lambda2,...., lambdan respectively, has a
Poisson distribution with parameter Sigma lamdbai (i = 1 to n) ]
If the sample of data values is as follows, calculate the test statistic and carry out the test:
4 9 7 6 13 8 12 13 10 9 5 8 5 5 9 6 13 6 7 4

i have n = 20, theta0 = 5 theta1 = 10 and i know i have to use these values but i dont know how? I know that L(thate0;x) is proportional to P(T = Sigma(Xi)) where T ~ Bin (20, 5) ...(or at least i think thid is right) but can someone help with actually finding c please?

Thanks again

#### BGM

##### TS Contributor
Actually the question have given you the hints already.

Let me state again the following property for Poisson Distribution:

If $$Y_i$$ are independently distributed as $$\mathrm{Poisson}(\lambda_i), i = 1, 2, ..., n$$, then

$$\sum_{i=1}^n Y_i \sim \mathrm{Poisson} \left(\sum_{i=1}^n \lambda_i \right)$$

So under the null hypothesis, you should know the distribution of
$$T(\mathbf{X}) = \sum_{i=1}^n X_i$$

As in part a), you have already shown that the rejection region is in the form
of $$\{\mathbf{x}: T(\mathbf{x}) > c\}$$

All you need to do is to solve for this $$c$$ such that
the size of the test $$\Pr\{T(\mathbf{x}) > c|H_0\} = \alpha$$

Use the normal approximation to evaluate the above probability,
and inversely search for the quantile $$c$$.

#### starlet

##### New Member
It's the solving for c part that i dont understand though. I stated the rest of it in my last post - i just need help for solving to find c. I don't know what the calculation is that i've to make if you can help with that?

#### BGM

##### TS Contributor
First of all, you need to know $$T(\mathbf{X}) \sim \mathrm{Poisson} (\lambda = 20 \times 5 = 100)$$

If you want to know how to use the normal approximation,
you just need to know

$$\frac {T(\mathbf{X}) - 100} {\sqrt{100}}$$ is approximately $$\mathcal{N}(0, 1)$$

And thus
$$0.05 \geq \Pr\{T(\mathbf{X}) > c \} \approx \Pr\left\{Z > \frac {c - 100} {10} \right\}$$

$$\Rightarrow \frac {c - 100} {10} = \Phi^{-1}(0.95)$$
where $$\Phi^{-1}$$ is the quantile function of the standard normal,
which you will need to use software/table to seek for the numerical values.
(Or if you are familiar with it, you will remember it is approximately 1.644854)

I have compute this in R with both "exact" way and the normal approximation:
> qpois(0.95,100)
 117
> 10*qnorm(0.95)+100
 116.4485