Назад к подготовке

MLE для смещенной монеты

MLE для смещенной монеты

Ответить самому

Сначала сформулируйте ответ как на собеседовании, затем откройте разбор и оцените себя.

Загрузка

Короткий ответ

The MLE is p_hat = k / n.

Полный разбор

The likelihood of observing k heads and n-k tails is proportional to:

L(p) = p^k (1-p)^(n-k).

The log-likelihood is:

l(p) = k log p + (n-k) log(1-p).

Differentiate and set to zero:

k / p - (n-k) / (1-p) = 0.

Rearrange:

k(1-p) = (n-k)p, so k = np, and p_hat = k / n.

The second derivative is negative for p in (0, 1):

-k / p^2 - (n-k) / (1-p)^2 < 0.

So the stationary point is a maximum. Boundary cases are intuitive: if k=0, p_hat=0; if k=n, p_hat=1.

Теория

For i.i.d. Bernoulli observations, the maximum likelihood estimate is the sample mean.

Типичные ошибки

  • Differentiate the likelihood directly and lose terms.
  • Forget to check that the stationary point is a maximum.
  • Miss the boundary cases k=0 and k=n.

Как отвечать на собеседовании

  • Use log-likelihood; it turns products into sums and keeps the derivation clean.
  • Mention the second derivative or concavity to close the derivation.