Mehmet Emre Tiryaki
Back to Notes

Statistical Estimation

Parametric Models

A set of distributions indexed by a parameter θ\theta is a parametric model. Note θ\theta is used to denote any number of parameters, and ;; is used to separate the parameters. E.g. P(X,Y;θ)P(X, Y; \theta) is the joint distribution of XX and YY using θ\theta as the parameter. For X∼Exp(θ)X \sim \mathrm{Exp}(\theta), the parametric family is

p(x;θ)=θe−θx,x≥0p(x; \theta) = \theta e^{-\theta x}, \quad x \ge 0

IID (or i.i.d.) means independent and identically distributed.

Probabilistic View of Data

The data DD can be seen as IID random variables with outputs YY. For nn data points with kk features each,

D=(X,Y)=[X11⋯X1kY1⋮⋮⋮Xn1⋯XnkYn]D = (X, Y) = \begin{bmatrix} X_{11} & \cdots & X_{1k} & Y_1 \\ \vdots & & \vdots & \vdots \\ X_{n1} & \cdots & X_{nk} & Y_n \end{bmatrix}

each row is a data point in Rk\mathbb{R}^k with its output YY. If we assume P(X,Y)P(X, Y) is parametric, the goal is to estimate the parameter θ\theta in P(X,Y;θ)P(X, Y; \theta).

Estimators

The estimator is usually notated with a hat, e.g. θ^\hat{\theta}, and is a function of the data as random variables, i.e. θ^=g(X,Y)\hat{\theta} = g(X, Y). When the data is realized (we plug in sampled numbers, not RVs in the theoretical sense), the estimator is realized as the estimate.

E.g. let 3 data points be IID, Xi∼N(μ,σ2)X_i \sim \mathcal{N}(\mu, \sigma^2), and we want to estimate μ\mu. A reasonable choice is

μ^=13∑i=13Xi\hat{\mu} = \frac{1}{3} \sum_{i=1}^{3} X_i

This estimator is an RV we can analyze. Now imagine we collect 3 data points 90,120,15090, 120, 150. We can use the estimator above to get a sample mean

μ^=90+120+1503=120\hat{\mu} = \frac{90 + 120 + 150}{3} = 120

Bias, Variance and MSE

Bias(θ^)=E[θ^]−θ\mathrm{Bias}(\hat{\theta}) = E[\hat{\theta}] - \theta

The variance of an estimator is Var(θ^)\mathrm{Var}(\hat{\theta}), and its mean-squared error is

MSE(θ^)=E[(θ^−θ)2]=Var(θ^)+Bias(θ^)2\mathrm{MSE}(\hat{\theta}) = E\big[(\hat{\theta} - \theta)^2\big] = \mathrm{Var}(\hat{\theta}) + \mathrm{Bias}(\hat{\theta})^2

Frequentist Framework

In the frequentist view, the parameter θ\theta is an unknown constant to be estimated from data. E.g. to estimate the fairness of a coin, let a flip be ∼Bern(θ)\sim \mathrm{Bern}(\theta) and estimate θ\theta.

For data x1,…,xnx_1, \ldots, x_n, the likelihood is the probability (or density) of the data under θ\theta,

L(θ)=∏i=1np(xi;θ)\mathcal{L}(\theta) = \prod_{i=1}^{n} p(x_i; \theta)

The maximum likelihood estimator is the constant θ\theta that maximizes the likelihood of the data,

θ^MLE=argmaxθ L(θ)\hat{\theta}_{\mathrm{MLE}} = \mathrm{argmax}_\theta \, \mathcal{L}(\theta)

The log-likelihood is ℓ(θ)=log⁡L(θ)\ell(\theta) = \log \mathcal{L}(\theta). Since log⁡\log is increasing, it has the same maximizer, and turns the product into a sum.

Bayesian Framework

In the Bayesian setting we are naturally uncertain about θ\theta, so θ\theta itself is an RV, usually with a parametric distribution called the prior. E.g. in the coin flipping case, X∼Bern(θ)X \sim \mathrm{Bern}(\theta), θ∼Beta(α,β)\theta \sim \mathrm{Beta}(\alpha, \beta), and we update the distribution of θ\theta given new data.

Using Bayes' Rule to update the distribution of θ\theta given data XX,

P(θ∣X)⏟posterior=P(X∣θ)⏞likelihood P(θ)⏞priorP(X)⏟evidence∝P(X∣θ)P(θ)\underbrace{P(\theta | X)}_{\text{posterior}} = \frac{\overbrace{P(X | \theta)}^{\text{likelihood}} \, \overbrace{P(\theta)}^{\text{prior}}}{\underbrace{P(X)}_{\text{evidence}}} \propto P(X | \theta) P(\theta)

Since P(X)P(X) is a constant with respect to θ\theta, P(X∣θ)P(θ)P(X | \theta) P(\theta) is enough to express the distribution. The constant is the one that makes P(θ∣X)P(\theta | X) integrate to 1.

Then, the maximum a posteriori estimate is

θ^MAP=argmaxθ P(θ∣X)\hat{\theta}_{\mathrm{MAP}} = \mathrm{argmax}_\theta \, P(\theta | X)