# Likelihood ratio test for $X_1,...,X_n \sim N(\mu_1,\sigma^2)$ and $Y_1,...,Y_m \sim N(\mu_2,\sigma^2)$

I am given a problem that asks me to perform a hypothesis testing where

$$H_0: \mu_1 = \mu_2 \quad \text{vs} \quad H_1: \mu_1 \ne \mu_2$$

for $$X_1,...,X_n \sim N(\mu_1,\sigma^2)$$ and $$Y_1,...,Y_m \sim N(\mu_2,\sigma^2)$$.

I am also given a fixed value for $$\sigma^2$$, $$n$$, $$m$$, $$\bar X$$ and $$\bar Y$$ to evaluate the test.

What bothers me here is that if I were asked to create a hypothesis test under this condition I would go to

$$\frac{\bar X - \bar Y - (\mu_1 - \mu_2)}{\sigma \sqrt{\frac{1}{n} + \frac{1}{m}}} = Z \sim N(0,1)$$

and work around it.

However, the problem is not 100% clear about how to go about with the "likelihood ratio test".

One of my understandings is that the likelihood ratio is

$$\Lambda = \frac{L(\theta_0)}{L(\hat{\theta}_{MLE})}$$

and

$$-2 \ln \Lambda \rightarrow \chi^2_1$$

Another thing that bothers me here is that if the problem is asking about ratio of likelyhoods

$$\frac{L(\mu_1)}{L(\mu_2)}$$

I am not confident that this behaves the same way that $$\Lambda$$ does.

Since the given $$n$$ and $$m$$ are large I am assuming that the asymptotic distribution is well approximated as a Chi-squared.

May I have some advice on how to proceed?

I tried to see what happens with the ratio of likelihoods but it gave me an expression

$$\sum_{i=1}^n X_i^2 \quad \text{and} \quad \sum_{i=1}^m Y_i^2$$

which I cannot deduce an exact value from the given information. . .

• Something missing here: Hypotheses mention population means $\mu_1, \mu_2,$ but both normal populations are specified to have $0$ means. Suspect title and 3rd line of question may be wrong. // Please clarify. Jul 17 '19 at 6:56
• Thank you for noticing. I will fix that right away. Jul 17 '19 at 7:10
• OK. The LR test rejects at the 5% level when $|Z| \ge 1.96.$ Jul 17 '19 at 7:30
• Maybe you used the original wrong info to get the puzzling result for the LR test. Jul 17 '19 at 8:06

Thank you for your help, everyone.

For future references, this is the conclusion that I will draw for now.

Let $$W = \bar{X} - \bar{Y}$$.

Then we know

$$W \sim N(\mu_1-\mu_2,\sigma^2 \left(\frac{1}{n}+ \frac{1}{m} \right))$$

This way we can perform a likelihood ratio test based on a single observation of $$W$$ whose distribution we know that it is normal.

Thus, using the fact that the MLE is $$\frac{1}{n+m} \sum_{i=1}^{n+m}W_i = W_1$$

we perform the LR test with the hypothesis

$$H_0: \mu_1-\mu_2 \quad \text{vs} \quad H_1:\mu_1-\mu_2 \ne0$$

where the likelihood ratio is

$$\Lambda = \exp\left[\frac{W_1^2}{-2\sigma^2(\frac{1}{n}+\frac{1}{m})}\right]$$

so

$$\chi^2 = -2 \ln \Lambda = \frac{W_1^2}{\sigma^2(\frac{1}{n}+\frac{1}{m})}$$.

I believe that this conforms with the fact that a square of a standard normal distribution is chi-squared, so it is more of a matter of which distribution to use when doing the hypothesis test.

In conclusion, we can reject the null when

$$\chi^2 \ge \chi^2_{\alpha}(1)$$

I will let you finish your derivation of the LR test. Here is a numerical example of its application.

Suppose you have 20 observations, simulated using R statistical software, from $$N(50,25)$$ and from $$N(53,25),$$ then you have the following summary statistics:

set.seed(717)  # for reproducibility
x1 = rnorm(20, 50, 5);  x2 = rnorm(20, 53, 5)
summary(x1)
Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
43.97   49.14   50.33   50.78   53.27   57.94
summary(x2)
Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
44.88   50.48   52.83   53.29   55.23   62.71 Suppose you want to test $$H_0: \mu_1=\mu_1$$ vs.$$H_1: \mu_1\ne\mu_1.$$ Then the $$Z$$ statistic can be found as follows:

se = 5*sqrt(1/20 + 1/20)
z = (50.33-52.83)/se; z
 -1.581139


Because $$|Z| = 1.581 < 1.96$$ you cannot reject $$H_0$$ at the 5% level.

Because data were simulated for this example, we know $$\mu_1=50 \ne \mu_2=53.$$ And, indeed $$\bar X_1 < \bar X_2.$$ However, 20 observations with $$\sigma^2 = 25$$ are not sufficient to detect this difference from the data.