Likelihood Ratio Test for the Normal Distribution with unknown mean

Let $$(X_{1},...,X_{n})$$ a $$n$$ sample of the law $$N( \mu, \sigma^{2})$$. We assumed we don't know $$\mu$$ and $$\sigma^{2}$$.

Let $$\mu_{0} \in \mathbb{R}$$.

Show that the Likelihood-ratio test for $$\mu = \mu_{0}$$ against $$\mu \ne \mu_{0}$$ is function of $$1 + \frac{(\bar{X_{n}} - \mu_{0} )^{2}}{\sigma_{n}^{2}}$$ with $$\sigma_{n}^{2} = \sum_{i=1}^{n} \frac{(X_{i} - \bar{X_{n}})^{2}}{n}$$

EDIT : I showed that the Likelihood-ratio test is
$$\exp\left( \frac{n}{2 s_{n}^{2}(X)} (\bar{X_{n}} - \mu_{0} ) \right)$$ with $$s_{n}^{2}(X) = \sum_{i=1}^n\frac{(X_i-\mu_0)^2}{n}$$ But I don't know how to conclude.

Thanks and regards.

• I think the equation for the variance is wrong. What does $>$ do there? Feb 19, 2020 at 11:35
• Oh the > is just to make the text highlighted. Let me edit. Oh and yes thank you it was a copy error.
– user347910
Feb 19, 2020 at 11:38
• also the value of the test is $exp(-\frac{n}{2 \sigma ^2}(\bar{X}-\mu_0)^2)$ Feb 19, 2020 at 11:40
• I found this computing $\frac{\sup_{H_{1}}}{\sup_{H_{0}}}$. Oh okay. But it doesn't change my question.
– user347910
Feb 19, 2020 at 11:42
• It is $\frac{\sup_{H_0}}{\sup_{H_1}}$ Feb 19, 2020 at 11:44

$$L_{H_0} = (2\pi\sigma^2)^{-\frac{n}{2}}exp(-\frac{1}{2\sigma^2}\sum_{i=1}^n(X_i-\mu_0)^2)$$

$$supL_{H_1} = (2\pi\sigma^2)^{-\frac{n}{2}}exp(-\frac{1}{2\sigma^2}\sum_{i=1}^n(X_i-\bar{X})^2)$$ ($$\bar{X}$$ is the maximum likelihood estimate for $$\mu$$ if $$\mu$$ is unknown).

The problem is that you are treating $$\sigma^2$$ as given parameter instead of unknown. If you maximize the likelihood wrt $$\sigma^2$$ for $${H_0}$$ you will obtain that the maximum likelihood estimate for $$\sigma^2$$ is $$\sum_{i=1}^n\frac{(X_i-\mu_0)^2}{n}$$ (analogously for $${H_1}$$ it is $$\sum_{i=1}^n\frac{(X_i-\bar{X})^2}{n}$$).

After plugging in the estimate for $$\sigma^2$$ you will obtain:

$$\sup L_{H_0} = (2\pi\sum_{i=1}^n\frac{(X_i-\mu_0)^2}{n})^{-\frac{n}{2}}exp\Bigg(-\frac{\sum_{i=1}^n(X_i-\mu_0)^2}{2{\sum_{i=1}^n\frac{(X_i-\mu_0)^2}{n}}}\Bigg)=\big(\frac{2\pi}{n}\sum_{i=1}^n(X_i-\mu_0)^2)^{-\frac{n}{2}}exp(-\frac{n}{2})$$

and $$\sup L_{H_1} = (2\pi\sum_{i=1}^n\frac{(X_i-\bar{X})^2}{n})^{-\frac{n}{2}}exp\Bigg(-\frac{\sum_{i=1}^n(X_i-\bar{X}^2)}{2{\sum_{i=1}^n\frac{(X_i-\bar{X})^2}{n}}}\Bigg) =\big(\frac{2\pi}{n}\sum_{i=1}^n(X_i-\bar{X})^2)^{-\frac{n}{2}}exp(-\frac{n}{2})$$.

I.e. $$\Lambda = \Bigg(\frac{\sum_{i=1}^n(X_i-\mu_0)^2}{\sum_{i=1}^n(X_i-\bar{X})^2}\Bigg)^{-\frac{n}{2}}$$.

$$\sum_{i=1}^n(X_i-\mu_0)^2 = \sum_{i=1}^n((X_i-\bar{X})+(\bar{X}-\mu_0))^2 = \sum_{i=1}^n(X_i-\bar{X})^2+n(\bar{X}-\mu_0)^2$$.

Plugging back into the equation for $$\Lambda$$ we obtain: $$\Lambda = \Bigg(1+\frac{n(\bar{X}-\mu_0)^2}{\sum_{i=1}^n(X_i-\bar{X})^2}\Bigg)^{-\frac{n}{2}}$$.

• why $exp(-\frac{n}{2})$ ? I though of $\exp\left( \frac{-\| X-\mu_{0} \|)^{2}}{2(\sum_{i=1}^n\frac{(X_i-\mu_0)^2}{n})} \right)$ for $H_{0}$
– user347910
Feb 19, 2020 at 12:43
• @CechMS I hav edited my post to make it clearer. Feb 19, 2020 at 12:51
• @ I think $L_{H_{0}}$ still need a update.
– user347910
Feb 19, 2020 at 12:52
• My course just tell me that $\frac{\sup_{\Theta_{1}} L(\theta)}{\sup_{\Theta_{0}}L(\theta)}$. So I just tried to apply the formula for $\Theta_{0} = \{ \mu_{0} \}$. But it doesn't really match with the set of parameters $\mathbb{R} \times ]0;+\infty[$. So if I try now to consider $\Theta_{0} = \{ \mu_{0} \} \times ]0;+\infty[$ and $\Theta_{1} = \mathbb{R}- \{ \mu_{0} \} \times ]0;+\infty[$. It could be more coherent.
– user347910
Feb 19, 2020 at 12:54
• @CechMS The density of the normal distributions is a smooth, infinitely differentiable function over the entire $\mathbb{R \times R_+}$, I took the first order conditions for both parameters. This is perfectly legal in this case. Feb 19, 2020 at 14:34