# Likelihood ratio test for $H_0: \mu_1 = \mu_2 = 0$ for 2 samples with common but unknown variance

This is a question from Exercises 8.3 from Introduction to Mathematical Statistics by Hogg, Craig, McKean.

Question: Let $$X_1, X_2, \cdots ,X_n$$ and $$Y_1, Y_2, \cdots ,Y_n$$ be independent random samples from two normal distributions $$\mathcal{N}(μ_1, σ^2)$$ and $$\mathcal{N}(μ_2, σ^2)$$, respectively, where $$σ^2$$ is the common but unknown variance. Find the likelihood ratio $$\Lambda$$ for testing $$H_0 : μ_1 = μ_2 = 0$$ against all alternatives. Rewrite $$\Lambda$$ so that it is a function of a statistic $$Z$$ which has a well-known distribution. Give the distribution of $$Z$$ under both null and alternative hypotheses.

I have viewed a similar question here. It had the case of known variance, and so I wasn't able to check my answer.

My attempt is as follows. I would really appreciate if someone could check it and give some advice.

Solution attempt: I started by writing the likelihood function. To do this, I use that the samples are independent, and that within each sample, the observations are iid. I write $$\theta = (\mu_1, \mu_2, \sigma^2).$$ We have $$L(\theta; \mathbf{x}, \mathbf{y}) = \dfrac{1}{(2\pi \sigma^2)^n} \exp \left({-\dfrac{1}{2 \sigma^2} (\sum (x_i - \mu_1)^2 + \sum(y_i - \mu_2)^2)}\right).$$

Under $$H_0$$, the MLEs are $$\mu_1 = \mu_2 = 0$$, $$\hat{\sigma_0}^2 = \dfrac{1}{2n} \left(\sum x_i^2 + \sum y_i^2\right)$$. I denote the MLE as $$\theta_0$$. This gives the likelihood as $$L(\hat{\theta_0})= \dfrac{1}{(2 \pi \sigma_0^2)^{n}} e^{-n}.$$

The unrestricted MLEs are $$\hat{\mu_1} = \bar{x}, \hat{\mu_2} = \bar{y}$$ and $$\hat{\sigma_1^2} = \dfrac{1}{2n} (\sum (x_i-\bar{x})^2 - \sum(y_i-\bar{y})^2)$$. I denote this MLE by $$\hat{\theta}$$. I evaluate the likelihood and obtain $$L(\hat{\theta})= \dfrac{1}{(2 \pi \sigma_1^2)^{n}} e^{-n}.$$

Thus $$\Lambda = \left(\dfrac{\hat{\sigma_1}^2}{\hat{\sigma_0}^2}\right)^n.$$ I then obtain $$\Lambda^{1/n} = \dfrac{ \sum(x_i - \bar{x})^2 + \sum(y_i - \bar{y})^2}{\sum x_i^2 + \sum y_i^2}.$$

I'm not really sure what to do now. I know that $$\sum(x_i-\bar{x})^2 = \sum x_i^2 - n \bar{x}^2$$ so I could write $$\Lambda^{1/n} = \dfrac{\sum x_i^2 - n \bar{x}^2 + \sum y_i^2 - n\bar{y}^2}{\sum x_i^2 + \sum y_i^2}.$$

At this point I am stuck as I do not know what statistic this is a function of. Could someone please help me? Thank you!

I am leaving a general sketch here.

$$\bullet$$ The likelihood function is

\begin{align}\mathcal L &=\frac{1}{(2\pi \sigma^2)^n} \exp \left[{-\frac{1}{2 \sigma^2} \left\{\sum_{i=1}^n (x_i - \mu_1)^2 + \sum_{j=1}^n(y_j- \mu_2)^2\right\}}\right]. \tag 1\label 1\end{align}

$$\bullet$$ From $$\eqref 1,$$ it is easy to check \begin{align}\hat \mu_1 &= \bar x, \\ \hat \mu_2 &= \bar y, \\ \hat \sigma^2 &= \frac1{2n}\left[\sum_{i=1}^n (x_i - \bar x)^2 + \sum_{j=1}^n(y_j- \bar y)^2\right] \\ &= \frac1{2n}\left[ns_1^2 +ns_2^2\right].\tag 2\label 2 \end{align}

$$\bullet$$ In $$\Theta_0,$$ \begin{align}\hat\mu &= \frac{n\bar x+ n\bar y }{2n}, \\\hat \sigma^2 &=\frac1{2n}\left[\sum_{i=1}^n (x_i - \hat \mu)^2 + \sum_{j=1}^n(y_j- \hat \mu)^2\right] \\ &= \frac{1}{2n}\left[ns_1^2+ ns_2^2 + \frac{n^2}{2n}(\bar x-\bar y)^2\right].\end{align}\tag 3 \label 3

Therefore \begin{align}\Lambda = \frac{\mathcal L\left(\hat \Theta_0\right)}{\mathcal L\left(\hat \Theta\right)} &= \left[\frac{ns_1^2 +ns_2^2}{ns_1^2+ ns_2^2 + \frac{n^2}{2n}(\bar x-\bar y)^2}\right]^n;\tag 4\end{align}

defining \begin{align}S^2 &:= \frac1{2n-2}\left[ns_1^2 + ns_2^2\right]\\ t &:= \frac{\bar x-\bar y}{S\sqrt{\frac1n+\frac1n}}, \tag 5\label 5 \end{align} $$\Lambda$$ can be expressed as

$$\Lambda = \frac{1}{\left[1 + \frac{t^2}{2n-2}\right]^{n}}.\tag 6$$

$$\bullet$$ $$t$$ can be shown to follow $$\mathsf t_{2n-2}.$$ The LR test is then based on $$t.$$

$$\bullet$$ In general, if $$\delta := \mu_1-\mu_2,$$ then it is also an easy exercise to check the distribution of $$\frac{(\bar x-\bar y) - \delta}{S\sqrt{\frac1n+\frac1n}}.$$

• Thank you! I have studied your post and managed to understand. But I think we are testing for $(\mu_1, \mu_2) = (0,0)$ rather than $\mu_1 = mu_2$ and that may make things a bit different? Could you let me know your view on this? Thanks again Commented Dec 21, 2022 at 21:35
• I see. My bad. I would update this post holidays. Commented Dec 22, 2022 at 8:39