補足. 尤度比検定_2

$\gdef \vec#1{\boldsymbol{#1}} \\ \gdef \rank {\mathrm{rank}} \\ \gdef \det {\mathrm{det}} \\ \gdef \Bern {\mathrm{Bern}} \\ \gdef \Bin {\mathrm{Bin}} \\ \gdef \Mn {\mathrm{Mn}} \\ \gdef \Cov {\mathrm{Cov}} \\ \gdef \Po {\mathrm{Po}} \\ \gdef \HG {\mathrm{HG}} \\ \gdef \Geo {\mathrm{Geo}}\\ \gdef \N {\mathrm{N}} \\ \gdef \LN {\mathrm{LN}} \\ \gdef \U {\mathrm{U}} \\ \gdef \t {\mathrm{t}} \\ \gdef \F {\mathrm{F}} \\ \gdef \Exp {\mathrm{Exp}} \\ \gdef \Ga {\mathrm{Ga}} \\ \gdef \Be {\mathrm{Be}} \\ \gdef \NB {\mathrm{NB}}$

$$\begin{aligned} f_n(\vec x; \mu, \sigma^2) &= \frac{1}{(2 \pi \sigma^2)^{\frac{n}{2}}}  \prod_{i=1}^{n} \exp[-\frac{(x_i-\mu)^2}{2 \sigma^2}] \\[10px] \Rightarrow \log f_n(\vec x; \mu, \sigma^2) &= -\frac{n}{2} \log (2 \pi \sigma^2)-\frac{1}{2 \sigma^2} \sum_{i=1}^n (x_i-\mu)^2 ~~~~~ \mathrm{(A^{\prime})} \end{aligned}$$


($\tilde{\sigma}^2$について)
$\mathrm{(A^{\prime})}$で$\mu = \mu_0$を代入した式を$\sigma^2$で偏微分して、
$$\begin{aligned} \frac{\partial}{\partial (\sigma^2)} \log f_n(\vec x; \mu_0, \sigma^2) &= -\frac{n}{2} \cdot \frac{2 \pi}{2 \pi \sigma^2} + \frac{1}{2 \sigma^4} \sum_{i=1}^n (x_i-\mu_0)^2 \\[10px] &= -\frac{n}{2 \sigma^2} + \frac{1}{2 \sigma^4} \sum_{i=1}^n (x_i-\mu_0)^2 \end{aligned}$$となる。




(上式)$=0$、と置いた時の$\sigma^2$が$\tilde{\sigma}^2$なので、
$$\begin{aligned} -\frac{n}{2 \tilde{\sigma}^2} + \frac{1}{2 \tilde{\sigma}^4} \sum_{i=1}^n (x_i-\mu_0)^2 = 0 \\[10px] \Rightarrow \tilde{\sigma}^2 = \frac{1}{n} \sum_{i=1}^n (x_i-\mu_0)^2 \end{aligned}$$




($\hat{\mu}, \hat{\sigma}^2$について)
$\mathrm{(A^{\prime})}$を$\mu, \sigma^2$で偏微分して、
$$\begin{aligned} \frac{\partial}{\partial \mu} \log f_n(\vec x; \mu, \sigma^2) &= -\frac{1}{2 \sigma^2} \sum_{i=1}^n 2 (x_i-\mu)(-1) \\[10px] &= \frac{1}{\sigma^2} \sum_{i=1}^n (x_i-\mu) \\[10px] &= \frac{1}{\sigma^2} (n \bar{x}_n-n\mu) \\[10px] &= \frac{n}{\sigma^2} (\bar{x}_n-\mu) ~~~~~ \mathrm{(B^{\prime})} \end{aligned}$$
$$\begin{aligned} \frac{\partial}{\partial (\sigma^2)} \log f_n(\vec x; \mu, \sigma^2) &= -\frac{n}{2 \sigma^2} + \frac{1}{2 \sigma^4} \sum_{i=1}^n (x_i-\mu)^2 ~~~~~ \mathrm{(C^{\prime})} \end{aligned}$$


$\mathrm{(B^{\prime})}, \mathrm{(C^{\prime})}$それぞれを$=0$、と置いた時の$(\mu, \sigma^2)$が$(\hat{\mu}, \hat{\sigma}^2)$なので、これを解くと、
$$\begin{aligned} \hat{\mu} &= \bar{x}_n \\[10px] \hat{\sigma}^2 &= \frac{1}{n} \sum_{i=1}^n (x_i-\bar{x}_n)^2 \end{aligned}$$となる。