# Hypothesis Testing of the normal distribution

I have two following problems about the hypothesis testing about the normal distribution:

I. A random sample of size $n$ from a normal population with unknown mean and variance is to be used to test the null hypothesis $\mu=\mu_0$ against the alternative $\mu\ne\mu_0$. Using the simultaneous maximum likelihood estimates of $\mu$ and $\sigma^2$, show that the values of the likelihood ratio statistic can be written in the form:
$$\lambda=\Big(1+{{t^2}\over{n-1}}\Big)^{-{n\over2}},$$where $t={{\bar x-\mu_0}\over{s/\sqrt n}}$.

II. Given a random sample of size $n$ from a normal population with unknown mean and variance, find an expression for the likelihood ratio statistic for testing the null hypothesis $\sigma=\sigma_0$ against the alternative hypothesis $\sigma\ne\sigma_0$

-
What have you tried? Is this homework? – Rasmus Mar 1 '13 at 15:47
Would you please give me a hint about where to start? I just have no idea where to start. – Scorpio19891119 Mar 1 '13 at 15:48
Have you found the MLEs? – Michael Hardy Mar 1 '13 at 15:50
@MichaelHardy yes. – Scorpio19891119 Mar 1 '13 at 15:52

The likelihood function is \begin{align} L(\mu,\sigma) & = \text{constant} \cdot\prod_{i=1}^n \left(\sigma^{-1} \exp\left(\frac{-1}{2}\left(\frac{x_i-\mu}{\sigma}\right)^2\right)\right) \\[8pt] & = c\sigma^{-n}\exp\left(\frac{-1}{2\sigma^2}\sum_{i=1}^n(x_i-\mu)^2\right) \\[8pt] & = c\sigma^{-n}\exp\left(\frac{-1}{2\sigma^2}\left(n(\bar x - \mu)^2+\sum_{i=1}^n(x_i-\bar x)^2 \right)\right) \\[8pt] & = c\sigma^{-n}\exp\left(\frac{-1}{2\sigma^2}\left(n(\bar x - \mu)^2+ns^2 \right)\right). \end{align} Evaluating this at the MLEs $\hat\mu=\bar x$ and $\hat\sigma = s$, we have $$L(\bar x, s) = cs^{-n}\exp\left(\frac{-1}{2s^2}ns^2\right) = cs^{-n}\exp\left(\frac{-n}{2}\right) .$$ Evaluating it at the hypothesized value $\mu_0$, we have $$L(\mu_0,s) = cs^{-n}\exp\left(\frac{-1}{2s^2} \left(n(\bar x - \mu_0)^2+ ns^2 \right)^2\right) = cs^{-n}\exp\left(\frac{-n}{2s^2} \left((\bar x - \mu_0)^2+ s^2 \right)\right)$$ So we get a likelihood ratio: $$\frac{L(\bar x, s)}{L(\mu_0,s)} = \exp\left(n\left(\frac{\bar x - \mu_0}{s}\right)^2\right) = \exp(t^2).$$ This is a monotone function of $|t|$, so one rejects the null hypothesis if $|t|$ is too big.