Example 1. A random variable $\xi$ is distributed according to the normal law with unknown parameters $a$ and $\sigma^{2}$. Determine these parameters from the sample $x_{1}, \ldots, x_{n}$ of values of $\xi$ using the method of maximum likelihood.
## Solution.

1. The probability density function of the random variable $\xi$ is given by

$$
p\left(x ; a, \sigma^{2}\right)=\frac{1}{\sqrt{2 \pi \sigma^{2}}} e^{-(x-a)^{2} /\left(2 \sigma^{2}\right)}
$$

2. We define the likelihood function as

$$
L\left(a, \sigma^{2}\right)=\frac{1}{\sqrt{2 \pi \sigma^{2}}} e^{-\left(x_{1}-a\right)^{2} /\left(2 \sigma^{2}\right)} \cdot \ldots \cdot \frac{1}{\sqrt{2 \pi \sigma^{2}}} e^{-\left(x_{n}-a\right)^{2} /\left(2 \sigma^{2}\right)}
$$

where $x_{1}, \ldots, x_{n}$ are the sample values of the random variable $\xi$.

3. We find the unknown parameters $a$ and $\sigma^{2}$ from the condition

$$
L\left(a, \sigma^{2}\right) \longrightarrow \max
$$

i.e., as the coordinates of the point where the likelihood function attains its maximum value.

For this, it is more convenient to use the function

$$
\ln L\left(a, \sigma^{2}\right)=-\frac{n}{2} \ln \sigma^{2}-\frac{1}{2 \sigma^{2}}\left[\left(x_{1}-a\right)^{2}+\ldots+\left(x_{n}-a\right)^{2}\right]-\frac{n}{2} \ln 2 \pi
$$

This function attains its maximum value at the same $a, \sigma^{2}$ as $L\left(a, \sigma^{2}\right)$.

Since $a \in(-\infty, \infty)$ and $\sigma^{2} \in(0, \infty)$, the domain of the parameters $a$ and $\sigma^{2}$ has no boundary. Therefore, the function $\ln L\left(a, \sigma^{2}\right)$ attains its maximum value at one of its critical points. We seek these critical points.

The necessary condition for an extremum is

$$
\left\{\begin{aligned}
\frac{\partial}{\partial a} \ln L\left(a, \sigma^{2}\right) & =-\frac{1}{\sigma^{2}}\left(x_{1}+\ldots+x_{n}-n a\right)=0 \\
\frac{\partial}{\partial \sigma^{2}} \ln L\left(a, \sigma^{2}\right) & =-\frac{n}{2 \sigma^{2}}+\frac{1}{2\left(\sigma^{2}\right)^{2}}\left[\left(x_{1}-a\right)^{2}+\ldots+\left(x_{n}-a\right)^{2}\right]=0
\end{aligned}\right.
$$

From this, it follows that

$$
a=\frac{x_{1}+\ldots+x_{n}}{n} \quad \text { and } \quad \sigma^{2}=\frac{\left(x_{1}-a\right)^{2}+\ldots+\left(x_{n}-a\right)^{2}}{n}
$$

Thus, the likelihood function $L\left(a, \sigma^{2}\right)$ has a unique critical point. At this point, $L\left(a, \sigma^{2}\right)$ attains its maximum value.

$$
\text { Answer. } \quad a=\frac{x_{1}+\ldots+x_{n}}{n}, \quad \sigma^{2}=\frac{\left(x_{1}-a\right)^{2}+\ldots+\left(x_{n}-a\right)^{2}}{n} .
$$

Remark. It is known that the estimate $\sigma^{2}=\overline{(x-\bar{x})}$, which we obtained for the variance using the method of maximum likelihood, is biased. This example shows that the method of maximum likelihood generally provides biased estimates, which still need to be corrected.