Note
Maximum likelihood notes
This is a public fixture post (PUBLIC_KATEX_FIXTURE) used to check KaTeX, code overflow, and public-build inclusion.
Let be i.i.d. samples from . The negative log-likelihood is
The MLE is the usual mean, , which here reduces to . For two densities and , the gap between them is the KL divergence .
A useful scalar identity in one dimension is , with .
import numpy as np
def gaussian_nll(x, mu, sigma2):
residual = x - mu
return 0.5 * (np.log(2 * np.pi * sigma2) + (residual ** 2) / sigma2)
KaTeX is not TeX Live: macros such as \R and \norm are defined in src/lib/katex_macros.ts. Diagrams that need TikZ should be pre-rendered.