MLE: Normal Mean and Variance Explained with Worked Examples

For a normal sample, the maximum likelihood estimates are and (divisor , not ).

Write 2x or 2*x to multiply, ^ for powers, and ; between simultaneous equations. You can also type factor, expand, derivative of, integrate … from a to b, limit … as x->0 or 15% of 80.

Try an example

Before you start

This page is easier if you are comfortable with:

What MLE: normal mean and variance means

The log-likelihood is . Maximising over gives the sample mean, and over gives the average squared deviation. For the data : , the squared deviations are , so , while the unbiased sample variance is (the sample variance).

At the maximum the log-likelihood simplifies to ; for the data above, . The MLE of the variance is biased by the factor but has lower mean squared error (mean squared error). The log-likelihood of the normal density uses the normal density.

This result justifies the use of the sample mean and the sums of squares in regression (the coefficient of determination) and ANOVA (ANOVA). The general method is maximum likelihood estimation, and the intervals for are in the confidence interval for a mean.

What is it used for?

The best-fitting normal has the sample mean and the average squared deviation as its parameters.

How to use mle: normal mean and variance

  1. Write the normal log-likelihood.
  2. Set the derivative with respect to to zero: .
  3. Set the derivative with respect to to zero: .
  4. Convert to the unbiased variance by multiplying by if required.

Graph

Profile log-likelihood of σ² for the data 2, 4, 6, 8 (μ = 5)maximum at σ² = 52468101214-14-13-12-11-10-9-8Profile log-likelihood of σ² for the data 2, 4, 6, 8 (μ = 5)σ²log-likelihoodln L(σ²)Graph with x from 1 to 15 and y from -14 to -8. Shows the curve ln L(σ²); point maximum at σ² = 5 at (5, -8.8946).

The maximum is at the average squared deviation 5, not at 20/3.

Worked examples

These examples are worked by hand, step by step, so you can compare your own working.

Example 1: the mean

Find for the data .

Worked example
Answer
55
  1. Formula

Example 2: the variance

Find and the unbiased variance for the same data.

Worked example
Answer
5, 6.6675,\ 6.667
  1. Squared deviations
  2. MLE
  3. Unbiased

Example 3: maximised log-likelihood

Find at the MLE for the same data.

Worked example
Answer
−8.8946-8.8946
  1. Formula

Special cases

A few situations come up again and again. Knowing them saves time and helps you spot answers that cannot be right.

Data 2, 4, 6

μ̂ = 4

Sample mean.

σ̂² (divisor n)

(4 + 0 + 4)/3

2.6667.

Unbiased s² (divisor n − 1)

8/2

4.

Ratio

σ̂²/s² = (n − 1)/n

0.6667.

Word problems

For a normal sample the MLEs are μ̂ = x̄ and σ̂² = (1/n)Σ(xᵢ − x̄)², using divisor n; the unbiased estimate uses n − 1.

Mean

Data 2, 4, 6. Find μ̂.

  1. 12/3
  2. Check: ✓4

MLE variance

Find σ̂².

  1. 8/3
  2. Check: ✓2.6667

Unbiased variance Higher

Find s².

  1. 8/2
  2. Check: ✓4

Ratio Higher

Find σ̂²/s².

  1. 2/3
  2. Check: ✓0.6667

Common mistakes

Using n − 1 for the MLE

s² ✗

divide by n ✓

MLE is biased.

Using μ instead of x̄

true mean unknown ✗

plug in x̄ ✓

Estimate.

Forgetting squares

Σ(x − x̄) ✗

Σ(x − x̄)² ✓

Sum of squares.

Joint vs separate

maximising separately fails ✗

μ̂ first then σ̂² ✓

Profile.

Exam tips

  1. μ̂ = x̄.
  2. σ̂² = Σ(x − x̄)²/n.
  3. Biased by (n − 1)/n.
  4. s² uses n − 1.
  5. Large n: same.

Practice questions

Try each one on paper, then open the answer. Use the solver above to see the full working.

1. μ̂ for 1, 3, 5, 7 Foundation

4

2. σ̂² for 1, 3, 5, 7 Foundation

5

3. s² for 1, 3, 5, 7 to 4 d.p. Foundation

6.6667

4. μ̂ for 10, 12, 14 Higher

12

5. σ̂² for 10, 12, 14 to 4 d.p. Higher

2.6667

6. (n−1)/n for n = 5 Higher

0.8

Practice generator

Unlimited fresh questions with instant marking. Choose a level, work it out on paper, then type your answer.

Solve: …

Key terms

Normal MLE
(x̄, σ̂²).
Sample variance
s².
Bias
σ̂² underestimates.
Sum of squares
Σ(x − x̄)².
Divisor n
MLE.
Divisor n − 1
Unbiased.

Frequently asked questions

What is the MLE of μ?

x̄.

What is the MLE of σ²?

Σ(x − x̄)²/n.

Why is it biased?

It uses x̄ instead of μ.

What is the unbiased version?

Divide by n − 1.

Which page covers MLE generally?

maximum likelihood estimation.

Which page covers the exponential MLE?

MLE for the exponential rate.

More in Advanced statistics and stochastic processes and the formula sheets.