A Brief Introduction to Point Estimates

In this blog, We introduces various methods in point estimates and their definition. The blog follows from lecture note Point Estimate from professor Xiaojing Ye in Georgia State University

Some author21 min read

Point Estimation

Example. Let X1,…,Xn∼f(⋅;θ)X_1, \ldots, X_n \sim f(\cdot ; \theta) be a random sample where

f(x;θ)={e−(x−θ), if x≥θ0, elsewhere f(x ; \theta)= \begin{cases}e^{-(x-\theta)}, & \text { if } x \geq \theta \\ 0, & \text { elsewhere }\end{cases}

Show that Xˉ\bar{X} is a biased estimator of θ\theta.

Xˉ=1n∑i=1nE[Xi]=∫θ∞xexp⁡(−(x−θ))=(−xexp⁡(−(x−θ)))∣θ∞+∫θ∞e−(x−θ)dx=θ+1≠θ\bar{X} = \frac{1}{n}\sum_{i=1}^n\mathbb{E}[X_i] = \int_{\theta}^{\infty} x\exp(-(x-\theta)) = (-x \exp(-(x-\theta)))\bigg|_{\theta}^{\infty} +\int_{\theta}^{\infty} e^{-(x-\theta)}dx = \theta+1 \not = \theta.

How can we transform a distribution to make the average an unbiased estimator?

Example. Let X1,…,Xn∼Uniform⁡(0,β)X_1, \ldots, X_n \sim \operatorname{Uniform}(0, \beta) be a random sample where β\beta is a parameter. Show that YnY_n (the nn-th order statistic) is a biased estimator but an asymptotically unbiased estimator of β\beta.

Pr⁡[Xn=x]=n!(n−1)!Pr⁡[X<x]n−11β=n(xβ)n−11β=nβnxn−1\Pr[X_n = x] = \frac{n!}{(n-1)!} \Pr[X < x]^{n-1} \frac{1}{\beta} = n \left(\frac{x}{\beta}\right)^{n-1} \frac{1}{\beta} = \frac{n}{\beta^n}x^{n-1} ∫0βnβnxndx=nn+1xn+1βn∣x=0β=nn+1β\int_0^{\beta}\frac{n}{\beta^n}x^n dx =\frac{n}{n+1}\frac{x^{n+1}}{\beta^n} \bigg|_{x=0}^{\beta} = \frac{n}{n+1} \beta

Sending nn to infinity, we will have β\beta.

Let's consider the following inequality from "Course Notes for Math 162: Mathematical Statistics The Cram´er-Rao Inequality" by Adam Merberg and Steven J. Miller.

Cramér-Rao Inequality

Suppose we have a probability density function f(x;θ)f(x ; \theta) with a continuous parameter θ\theta. Let X1,…,XnX_1, \ldots, X_n be independent random variables with density f(x;θ)f(x ; \theta), and ϕ(x⃗)=Θ^(x1,…,xn)\phi(\vec{x}) = \hat{\Theta}\left(x_1, \ldots, x_n\right) be an unbiased estimator of θ\theta.

Let F(x⃗,θ)=∏i=1nf(xi;θ)F(\vec{x}, \theta) = \prod_{i=1}^n f\left(x_i ; \theta\right) and

We assume that f(x;θ)f(x ; \theta) satisfies the following two conditions:

1. We have the condition:

∂∂θ[∫Mϕ(x⃗)F(xˉ,θ)dx⃗]=∫Mϕ(x⃗)∂F(x⃗;θ)∂θdx⃗\frac{\partial}{\partial \theta}\left[ \int_M \phi(\vec{x}) F(\bar{x}, \theta) d \vec{x}\right] = \int_M \phi(\vec{x}) \frac{\partial F(\vec{x}; \theta)}{\partial \theta} d \vec{x}

, where MM defines the whole F(x⃗,θ)F(\vec{x}, \theta) and mm defines the f(x;θ)f(x;\theta).

2. For each θ\theta, the variance of ϕ(x⃗)\phi(\vec{x}) is finite.

Under these conditions, the variance of Θ^\hat{\Theta} is bounded below by:

var⁡(ϕ)×(nE[(∂∂θln⁡f(x;θ))2])≥1\operatorname{var}(\phi) \times \left(n \mathbb{E}\left[\left(\frac{\partial }{\partial \theta}\ln f(x ; \theta)\right)^2\right]\right) \geq 1

Proof.

Since ϕ(x⃗)\phi(\vec x) is an unbiased estimator of θ\theta, we will have

0=E[ϕ(x⃗)−θ]=∫M(ϕ(x⃗)−θ)F(x⃗,θ)dx⃗=∫Mϕ(x⃗)F(x⃗,θ)dx⃗−∫MθF(x⃗,θ)dx⃗0=\mathbb{E}[\phi(\vec x) - \theta] = \int_M (\phi(\vec x) - \theta)F(\vec x, \theta) d \vec{x} = \int_M \phi(\vec x)F(\vec x, \theta) d \vec{x} - \int_M\theta F(\vec x, \theta) d \vec{x}

If we take partial derivative both side w.r.t θ\theta, then we will have

0=∫Mϕ(x⃗)∂∂θF(x⃗,θ)dx⃗−∫MF(x⃗,θ)dx⃗−∫Mθ∂∂θF(x⃗,θ)dx⃗0 = \int_M \phi(\vec{x}) \frac{\partial}{\partial \theta}F(\vec x, \theta) d \vec{x} - \int_M F(\vec x, \theta) d \vec{x} - \int_M \theta\frac{\partial }{\partial \theta} F(\vec x, \theta) d \vec{x} 1=∫M(ϕ(x⃗)−θ)∂∂θF(x⃗,θ)dx⃗1 = \int_M \left(\phi(\vec{x})-\theta\right) \frac{\partial}{\partial \theta}F(\vec x, \theta) d \vec{x}

We also notice that ∂∂θF(x⃗,θ)=∑i=1n∂∂θf(xi;θ)∏j=1,j≠inf(xj;θ)=∑i=1n1f(xi;θ)∂∂θf(xi;θ)∏j=1nf(xj;θ)=∑i=1n∂∂θln⁡f(xi;θ)∏j=1nf(xj;θ)=F(x⃗;θ)∑i=1n∂∂θln⁡f(xi;θ)\frac{\partial}{\partial \theta}F(\vec x, \theta) = \sum_{i=1}^n \frac{\partial}{\partial \theta} f(x_i; \theta) \prod_{j=1, j\not =i}^n f(x_j;\theta) = \sum_{i=1}^n \frac{1}{f(x_i;\theta)} \frac{\partial}{\partial \theta} f(x_i; \theta) \prod_{j=1}^n f(x_j;\theta) = \sum_{i=1}^n \frac{\partial}{\partial \theta} \ln f(x_i; \theta) \prod_{j=1}^n f(x_j;\theta) \\=F(\vec x;\theta)\sum_{i=1}^n \frac{\partial}{\partial \theta} \ln f(x_i; \theta)

So we will have:

1=∫M(ϕ(x⃗)−θ)(F(x⃗;θ))1/2(F(x⃗;θ))1/2∑i=1n∂∂θln⁡f(xi;θ) dx⃗1 = \int_{M}(\phi(\vec x) -\theta)(F(\vec x;\theta))^{1/2}(F(\vec x;\theta))^{1/2}\sum_{i=1}^n \frac{\partial}{\partial \theta} \ln f(x_i; \theta) \, d\vec x

By Cauchy-Schwarz inequality, we will get the following.

1≤[∫M(ϕ(x⃗)−θ)2(F(x⃗;θ)) dx⃗]1/2[∫M(∑i=1n∂∂θln⁡f(xi;θ))2F(x⃗;θ) dx⃗]1/21 \le \left[\int_{M}(\phi(\vec x) -\theta)^2(F(\vec x;\theta))\, d\vec x\right]^{1/2}\left[\int_{M}\left(\sum_{i=1}^n \frac{\partial}{\partial \theta} \ln f(x_i; \theta)\right)^2 F(\vec x;\theta) \, d\vec x\right]^{1/2}

The first term due to θ=E[θ]=E[Θ^]\theta = \mathbb{E}[\theta] = \mathbb{E}[\mathbb{\hat{\Theta}}] so it's the variance of Θ^\hat\Theta. The second term we need to do further analysis. So currently we have only the inequality:

1≤var⁡(ϕ)[∫M(∑i=1n∂∂θln⁡f(xi;θ))2F(x⃗;θ) dx⃗]1 \le \operatorname{var}(\phi)\left[\int_{M}\left(\sum_{i=1}^n \frac{\partial}{\partial \theta} \ln f(x_i; \theta)\right)^2 F(\vec x;\theta) \, d\vec x\right]

.

We want to show ∫M(∑i=1n∂∂θln⁡f(xi;θ))2F(x⃗;θ) dx⃗=nE[(∂∂θln⁡f(x;θ))2]\int_{M}\left(\sum_{i=1}^n \frac{\partial}{\partial \theta} \ln f(x_i; \theta)\right)^2 F(\vec x;\theta) \, d\vec x= n\mathbb{E}\left[\left(\frac{\partial }{\partial \theta}\ln f(x ; \theta)\right)^2\right]

∫M(∑i=1n∂∂θln⁡f(xi;θ))2F(x⃗;θ) dx⃗=∫M[∑i=1n(∂∂θln⁡f(xi;θ))2+∑i=1,j=1,j≠in∂∂θln⁡f(xi;θ)∂∂θln⁡f(xj;θ)]F(x⃗;θ) dx⃗\int_{M}\left(\sum_{i=1}^n \frac{\partial}{\partial \theta} \ln f(x_i; \theta)\right)^2 F(\vec x;\theta) \, d\vec x = \int_{M}\left[\sum_{i=1}^n\left(\frac{\partial}{\partial \theta} \ln f(x_i; \theta)\right)^2+\sum_{i=1, j=1, j\not=i}^n \frac{\partial}{\partial \theta} \ln f(x_i; \theta)\frac{\partial}{\partial \theta} \ln f(x_j; \theta)\right] F(\vec x;\theta) \, d\vec x

We can only need to show that ∫M[(∂∂θln⁡f(xi;θ))2]F(x⃗;θ) dx⃗=E[(∂∂θln⁡f(x;θ))2]\int_{M}\left[\left(\frac{\partial}{\partial \theta} \ln f(x_i; \theta)\right)^2\right] F(\vec x;\theta) \, d\vec x = \mathbb{E}\left[\left(\frac{\partial }{\partial \theta}\ln f(x ; \theta)\right)^2\right] and

∫M∂∂θln⁡f(xi;θ)∂∂θln⁡f(xj;θ)F(x⃗;θ) dx⃗=0\int_{M}\frac{\partial}{\partial \theta} \ln f(x_i; \theta)\frac{\partial}{\partial \theta} \ln f(x_j; \theta)F(\vec x;\theta) \, d\vec x=0

One can easily see that

∫M[(∂∂θln⁡f(xi;θ))2]F(x⃗;θ) dx⃗=∫m[(∂∂θln⁡f(xi;θ))2]f(xi;θ) dxi×∏j≠i∫f(xj;θ) dxj=∫m[(∂∂θln⁡f(xi;θ))2]f(xi;θ) dxi=∫m[(∂∂θln⁡f(x;θ))2]f(x;θ) dx=E[(∂∂θln⁡f(x;θ))2]\int_{M}\left[\left(\frac{\partial}{\partial \theta} \ln f(x_i; \theta)\right)^2\right] F(\vec x;\theta) \, d\vec x = \int_{m}\left[\left(\frac{\partial}{\partial \theta} \ln f(x_i; \theta)\right)^2\right] f(x_i;\theta)\, dx_i \times \prod_{j\not=i} \int f(x_j;\theta)\, dx_j \\= \int_{m}\left[\left(\frac{\partial}{\partial \theta} \ln f(x_i; \theta)\right)^2\right] f(x_i;\theta)\, dx_i\\=\int_{m}\left[\left(\frac{\partial}{\partial \theta} \ln f(x; \theta)\right)^2\right] f(x;\theta)\, dx= \mathbb{E}\left[\left(\frac{\partial}{\partial \theta} \ln f(x; \theta)\right)^2\right]

And for

∫M∂∂θln⁡f(xi;θ)∂∂θln⁡f(xj;θ)F(x⃗;θ) dx⃗=∫m∂∂θln⁡f(xi;θ)f(xi;θ)dxi∫m∂∂θln⁡f(xj;θ)f(xj;θ)dxj\int_{M}\frac{\partial}{\partial \theta} \ln f(x_i; \theta)\frac{\partial}{\partial \theta} \ln f(x_j; \theta)F(\vec x;\theta) \, d\vec x = \int_{m}\frac{\partial}{\partial \theta} \ln f(x_i; \theta) f(x_i;\theta)dx_i \int_{m}\frac{\partial}{\partial \theta}\ln f(x_j; \theta)f(x_j;\theta)dx_j

We notice that

∫m∂∂θln⁡f(xi;θ)f(xi;θ)dxi=∫m∂∂θf(xi;θ)dxi=0\int_{m}\frac{\partial}{\partial \theta} \ln f(x_i; \theta) f(x_i;\theta)dx_i = \int_{m}\frac{\partial}{\partial \theta} f(x_i;\theta) dx_i = 0

,

since 1=∫mf(x;θ) dx  ⟹  0=∫m∂∂θf(xi;θ)dxi.1=\int_{m}f(x;\theta)\, dx \implies 0 = \int_{m}\frac{\partial}{\partial \theta} f(x_i;\theta) dx_i.

Example. Let X1,…,XnX_1, \ldots, X_n be a random sample of N(μ,σ2)N\left(\mu, \sigma^2\right) where μ\mu is to be estimated. Then Xˉ\bar{X} is an MVUE of μ\mu.

Solution: E[Xˉ]=nE[X]n=μ\mathbb{E}[\bar X]=\frac{n\mathbb{E}[X]}{n} = \mu and V⁡[Xˉ]=V⁡[∑i=1nXin]=nn2V⁡[X]=σ2n.\operatorname{V}[\bar X] = \operatorname{V}\left[\frac{\sum_{i=1}^n X_i}{n}\right] = \frac{n}{n^2}\operatorname{V}[X] = \frac{\sigma^2}{n}.

We know the normal distribution has pdf: f(x)=1σ2πexp⁡(−(x−μ)22σ2)f(x) = \frac{1}{\sigma\sqrt{2\pi}}\exp\left(-\frac{(x-\mu)^2}{2\sigma^2}\right), then ln⁡f(x)=ln⁡(12πσ)−(x−μ)22σ2\ln f(x) = \ln\left(\frac{1}{\sqrt{2\pi}\sigma}\right) - \frac{(x-\mu)^2}{2\sigma^2}, then∂∂μln⁡f(x)=−μ−xσ2\frac{\partial}{\partial \mu} \ln f(x) = -\frac{\mu-x}{\sigma^2} and (∂∂μln⁡f(x))2=(x−μ)2σ4\left(\frac{\partial}{\partial \mu} \ln f(x)\right)^2 = \frac{(x-\mu)^2}{\sigma^4}

Then I(μ)=∫−∞∞(x−μ)2σ4=1σ2I(\mu) = \int_{-\infty}^{\infty} \frac{(x-\mu)^2}{\sigma^4} = \frac{1}{\sigma^2} and so we will have

1nI(μ)=1n1σ2=σ2n=V⁡[X].\frac{1}{n I(\mu)} = \frac{1}{n \frac{1}{\sigma^2}} = \frac{\sigma^2}{n} = \operatorname{V}[X].

So Xˉ\bar{X} is an MVUE of μ\mu.

We will review the Cramer-Rao inequality:

var⁡(ϕ)×(nE[(∂∂θln⁡f(x;θ))2])≥1\operatorname{var}(\phi) \times \left(n \mathbb{E}\left[\left(\frac{\partial }{\partial \theta}\ln f(x ; \theta)\right)^2\right]\right) \geq 1

If we are given two point estimators Θ1\Theta_1 and Θ2\Theta_2 of our parameter θ\theta. How can we decide which one to us. Let's pick a case where Θ1\Theta_1 is the MVUE of θ\theta, then we will have

V⁡(Θ1)×(nI(θ))=1\operatorname{V}(\Theta_1) \times \left(n I(\theta)\right) = 1

We also know that

V⁡(Θ2)×(nI(θ))≥1\operatorname{V}(\Theta_2) \times \left(n I(\theta)\right) \ge 1

and so we will have essentially:

V⁡(Θ2)×(nI(θ))≥V⁡(Θ1)×(nI(θ))\operatorname{V}(\Theta_2) \times \left(n I(\theta)\right) \ge \operatorname{V}(\Theta_1) \times \left(n I(\theta)\right)

If we take the reciprocal of the inequality, we will have

1V⁡(Θ2)×(nI(θ))≤1V⁡(Θ1)×(nI(θ))\frac{1}{\operatorname{V}(\Theta_2) \times \left(n I(\theta)\right)} \le \frac{1}{\operatorname{V}(\Theta_1) \times \left(n I(\theta)\right)}

.

Here, comes the definition of efficiency. If an unbiased estimator is more efficient than the other, then it will be Θ1\Theta_1 in the above inequality. So the efficiency of an unbiased estimator Θ\Theta is defined as

e(Θ)=1V⁡(Θ)×(nI(θ)).e(\Theta) =\frac{1}{\operatorname{V}(\Theta) \times \left(n I(\theta)\right)}.

and

e(Θ1)e(Θ2)=V⁡[Θ2]V⁡[Θ1].\frac{e(\Theta_1)}{e(\Theta_2)} = \frac{\operatorname{V}[\Theta_2]}{\operatorname{V}[\Theta_1]}.

Example. Let X1,…,Xn∼Uniform⁡(0,β)X_1, \ldots, X_n \sim \operatorname{Uniform}(0, \beta) be a random sample where β\beta is a parameter. Show that both 2Xˉ2 \bar{X} and n+1nYn\frac{n+1}{n} Y_n are unbiased estimators of β\beta. Compare their efficiency.

First, let's consider the variance of uniform distribution. We know that the mean of the above uniform distribution takes β2.\frac{\beta}{2}. And the variance of the distribution is 1β∫0β(x−β/2)2 dx=13x3∣x=−β/2β/2⋅1β=112β2.\frac{1}{\beta}\int_0^{\beta} (x-\beta/2)^2 \, dx = \frac{1}{3}x^3 \bigg|_{x=-\beta/2}^{\beta/2} \cdot \frac{1}{\beta} = \frac{1}{12}\beta^2.

And so E[2Xˉ]=2⋅β2=β.\mathbb{E}[2\bar{X}] = 2\cdot\frac{\beta}{2}=\beta. and V⁡[2Xˉ]=4n2⋅nβ212=β23n\operatorname{V}[2\bar{X}] = \frac{4}{n^2} \cdot \frac{n\beta^2}{12} = \frac{\beta^2}{3n}

Now let's consider Pr⁡[Yn=y]=n(∫0y1β dy)n−11β=n(yβ)n−11β=n⋅yn−1βn\Pr[Y_n=y] = n \left(\int_0^{y} \frac{1}{\beta}\, dy\right)^{n-1} \frac{1}{\beta} =n \left( \frac{y}{\beta}\right)^{n-1} \frac{1}{\beta} = n\cdot \frac{y^{n-1}}{\beta^n}

And so E[Yn]=∫0βn⋅ynβn dy=nn+1yn+1βn∣y=0y=β=nn+1β\mathbb{E}[Y_n] = \int_0^\beta n\cdot \frac{y^n}{\beta^n} \,dy = \frac{n}{n+1} \frac{y^{n+1}}{\beta^n} \bigg|_{y=0}^{y=\beta} = \frac{n}{n+1} \beta

And so

E[n+1nYn]=n+1nnn+1β=β.\mathbb{E}\left[\frac{n+1}{n}Y_n\right] = \frac{n+1}{n}\frac{n}{n+1} \beta = \beta.

Now let's consider:

E[Yn2]=∫0βy2⋅n⋅yn−1βn dy=nβn∫0βyn+1 dy=nβnβn+2n+2=nn+2β2.\mathbb{E}[Y_n^2] = \int_0^{\beta} y^2 \cdot n \cdot \frac{y^{n-1}}{\beta^n} \, dy \\=\frac{n}{\beta^n}\int_0^{\beta} y^{n+1} \, dy \\= \frac{n}{\beta^n} \frac{\beta^{n+2}}{n+2}\\= \frac{n}{n+2}\beta^2.

And so

V⁡[Yn]=E[Yn2]−(E[Yn])2=nn+2β2−(nn+1β)2=n(n+1)2−n2(n+2)(n+2)(n+1)2β2=n(n2+2n+1)−n3−2n2(n+1)2(n+2)β2=n(n+1)2(n+2)β2\operatorname{V}[Y_n] = \mathbb{E}[Y_n^2]- (\mathbb{E}[Y_n])^2 = \frac{n}{n+2}\beta^2 - \left(\frac{n}{n+1}\beta\right)^2=\frac{n(n+1)^2 -n^2(n+2)}{(n+2)(n+1)^2}\beta^2 = \frac{n(n^2+2n+1) -n^3 -2n^2}{(n+1)^2(n+2)}\beta^2 = \frac{n}{(n+1)^2(n+2)}\beta^2

An so V⁡[n+1nYn]=(n+1n)2V⁡[Yn]=(n+1n)2n(n+1)2(n+2)β2=1n(n+2)β2\operatorname{V}\left[\frac{n+1}{n}Y_n\right] = \left(\frac{n+1}{n}\right)^2\operatorname{V}[Y_n] = \left(\frac{n+1}{n}\right)^2 \frac{n}{(n+1)^2(n+2)}\beta^2 = \frac{1}{n(n+2)}\beta^2

So the ratio of

e(n+1nYn)e(2Xˉ)=13nβ21n(n+2)β2=n+23\frac{e(\frac{n+1}{n}Y_n)}{e(2\bar{X})} = \frac{\frac{1}{3n}\beta^2}{\frac{1}{n(n+2)}\beta^2} = \frac{n+2}{3}

If n>1n >1, then 2Xˉ2\bar{X} is more efficient than n+1nYn\frac{n+1}{n}Y_n.

Definition. Let Θ^\hat{\Theta} be any point estimator of θ\theta. Then the mean square error (MSE) of Θ^\hat{\Theta} is defined as

MSE⁡(Θ^)=E[(Θ^−θ)2]\operatorname{MSE}(\hat{\Theta})=\mathbb{E}\left[(\hat{\Theta}-\theta)^2\right]

Then we will have

E[(Θ^−θ)2]=E[(Θ^−Θ+Θ−θ)2]=E[(Θ^−Θ)2+(Θ−θ)2]=E[(Θ^−Θ)2]+(Θ−θ)2=V⁡[Θ^]+b(Θ^)\mathbb{E}\left[(\hat{\Theta}-\theta)^2\right] = \mathbb{E}\left[(\hat{\Theta}-\Theta +\Theta-\theta)^2\right] \\= \mathbb{E}\left[(\hat{\Theta}-\Theta)^2 +(\Theta-\theta)^2\right]\\=\mathbb{E}[(\hat{\Theta}-\Theta)^2] +(\Theta-\theta)^2 \\= \operatorname{V}[\hat{\Theta}]+b(\hat{\Theta})

where V⁡[Θ^]\operatorname{V}[\hat{\Theta}] is the variance of Θ^\hat{\Theta} and Θ=E[Θ^]\Theta = \mathbb{E}[\hat{\Theta}] and b(Θ^)b(\hat{\Theta}) is the bias of Θ^\hat{\Theta}.

Example. Let's compare the Mean Squared Error (MSE) of two estimators for σ2\sigma^2: S2S^2 and n−1nS2\frac{n-1}{n} S^2, for a normal population N(μ,σ2)N(\mu, \sigma^2).

Solution: Let's consider the variance of S2S^2 and n−1nS2\frac{n-1}n{S^2} and also the bias of S2S^2 and n−1nS2.\frac{n-1}{n}S^2.

For S2S^2, E[S2]=σ2\mathbb{E}[S^2] = \sigma^2 and since (n−1)S2σ2∼χn−12\frac{(n-1)S^2}{\sigma^2} \sim \chi_{n-1}^2 so we will have

V⁡[(n−1)S2σ2]=2(n−1)\operatorname{V}\left[\frac{(n-1)S^2}{\sigma^2}\right] =2(n-1)

and we also know that V⁡[(n−1)S2σ2]=(n−1)2σ4V⁡[S2]\operatorname{V}\left[\frac{(n-1)S^2}{\sigma^2}\right] = \frac{(n-1)^2}{\sigma^4}\operatorname{V}[S^2]

so we will have V⁡[S2]=2σ4n−1.\operatorname{V}[S^2] = \frac{2\sigma^4}{n-1}.

And also E[n−1nS2]=n−1nσ2\mathbb{E}[\frac{n-1}{n}S^2] = \frac{n-1}{n}\sigma^2 and V⁡[n−1nS2]=(n−1n)22σ4n−1=2(n−1n2)σ4\operatorname{V}[\frac{n-1}{n}S^2] = \left(\frac{n-1}{n}\right)^2 \frac{2\sigma^4}{n-1} = 2\left(\frac{n-1}{n^2}\right)\sigma^4

So the MSE of S2S^2 is 2σ4n−1\frac{2\sigma^4}{n-1} and MSE of n−1nS2\frac{n-1}{n}S^2 is 2(n−1n2)σ4+1n2σ4=2n−1n2σ42\left(\frac{n-1}{n^2}\right)\sigma^4 + \frac{1}{n^2}\sigma^4 =\frac{2n-1}{n^2}\sigma^4

so the ratio will be

MSE⁡[n−1nS2]MSE⁡[S2]=2n−1n2σ42n−1σ4=(2n−1)(n−1)2n2=2n2−3n+12n2=1+1−3n2n2<1\frac{\operatorname{MSE}[\frac{n-1}{n}S^2]}{\operatorname{MSE}[S^2]} = \frac{\frac{2n-1}{n^2}\sigma^4}{\frac{2}{n-1}\sigma^4} =\frac{(2n-1)(n-1)}{2n^2}= \frac{2n^2 -3n +1}{2n^2}= 1+ \frac{1-3n}{2n^2}<1

So n−1nS2\frac{n-1}{n}S^2 has less MSE than S2S^2.

Consistency is defined as follows: An estimator Θ^\hat{\Theta} of θ\theta, based on a random sample of size nn, is considered consistent if, for any positive value cc, the probability approaches zero as the sample size nn tends to infinity that the absolute difference between the estimator Θ^\hat{\Theta} and the true parameter θ\theta is greater than cc.

lim⁡n→∞Pr⁡[∣Θˉ−θ∣>c]=0\lim_{n\to\infty} \Pr[\left|\bar\Theta-\theta\right|>c] = 0

Theorem. If Θ^\hat{\Theta} is an unbiased estimator of θ\theta and V⁡[Θ^]→0\operatorname V[\hat{\Theta}] \rightarrow 0 as n→∞n \rightarrow \infty, then Θ^\hat{\Theta} is a consistent estimator of θ\theta.

Proof:

We know Chebyshev's inequality, then for any real number k>0k>0,

Pr⁡(∣Θ^−θ∣≥kV⁡[Θ^])≤1k2\Pr(|\hat{\Theta}-\theta| \geq k \operatorname V[\hat{\Theta}]) \leq \frac{1}{k^2}

Setting kk to satisfy kV⁡[Θ^]=ck\operatorname V[\hat{\Theta}] = c, then by sending nn to infinity we will have

lim⁡n→∞Pr⁡(∣Θ^−θ∣≥c)≤lim⁡n→∞(V⁡[Θ^])2c2=0\lim_{n\to\infty}\Pr(|\hat{\Theta}-\theta| \geq c) \leq \lim_{n\to\infty}\frac{\left(\operatorname V[\hat{\Theta}]\right)^2}{c^2} =0

Example. Suppose S2S^2 is the sample variance of the random sample from a normal population N(μ,σ2)N\left(\mu, \sigma^2\right), then S2S^2 is a consistent estimator of σ2\sigma^2.

We know from the previous that (n−1)S2σ2∼χn−12\frac{(n-1)S^2}{\sigma^2}\sim \chi_{n-1}^2 so

(n−1)2σ4V⁡[S2]=2(n−1)  ⟹  V⁡[S2]=2σ4n−1\frac{(n-1)^2}{\sigma^4}\operatorname V[S^2] = 2(n-1) \implies \operatorname V[S^2] =\frac{2\sigma^4}{n-1}

then we will have

lim⁡n→∞V[S2]=lim⁡n→∞2σ4n−1=0\lim_{n\to \infty} V[S^2] =\lim_{n\to \infty}\frac{2\sigma^4}{n-1} =0

So S2S^2 is consistent.

Example: Let ff be a probability density function (pdf) with a finite mean μ\mu and variance σ2\sigma^2.

Consider a natural number nn, and let X1,…,XnX_1, \ldots, X_n be a random sample drawn from ff.

Additionally, let YnY_n follow a Bernoulli distribution with parameter 1n\frac{1}{n} and be independent of the random sample.

We define the estimator Θ^n\hat{\Theta}_n as Θ^n=n2Yn+(1−Yn)Xˉn\hat{\Theta}_n = n^2 Y_n + \left(1 - Y_n\right) \bar{X}_n, where Xˉn=1n∑i=1nXi\bar{X}_n = \frac{1}{n} \sum_{i=1}^n X_i represents the sample mean.

Show that Θ^n\hat{\Theta}_n is neither unbiased nor asymptotically unbiased, but it is a consistent estimator of μ\mu.

E[Θ^n]=n2E[Yn]+E[1−Yn]E[Xnˉ]=n+n−1nμ\mathbb{E}[\hat{\Theta}_n] = n^2 \mathbb{E}[Y_n] + \mathbb{E}[1-Y_n] \mathbb{E}[\bar{X_n}] = n +\frac{n-1}{n}\mu

So Θ^n\hat{\Theta}_n is neither unbiased nor asymptotically unbiased.

lim⁡n→∞Pr⁡[∣Θ^n−μ∣≥c]=lim⁡n→∞Pr⁡[∣Θ^n−μ∣≥c∣Yn=0]Pr⁡[Yn=0]+Pr⁡[∣Θ^n−μ∣≥c∣Yn=1]Pr⁡[Yn=1]=lim⁡n→∞Pr⁡[∣Θ^n−μ∣≥c∣Yn=0](1−1n)+Pr⁡[∣Θ^n−μ∣≥c∣Yn=1]1n=lim⁡n→∞Pr⁡[∣Xˉn−μ∣≥c]≤lim⁡n→∞σ2c2n=0\lim_{n\to\infty}\Pr\left[\left|\hat\Theta_n-\mu\right| \ge c\right] = \lim_{n\to\infty}\Pr\left[\left|\hat\Theta_n-\mu\right| \ge c | Y_n=0\right] \Pr[Y_n=0]+\Pr\left[\left|\hat\Theta_n-\mu\right| \ge c| Y_n=1\right] \Pr[Y_n=1] \\=\lim_{n\to\infty}\Pr\left[\left|\hat\Theta_n-\mu\right| \ge c | Y_n=0\right] (1-\frac{1}{n})+\Pr\left[\left|\hat\Theta_n-\mu\right| \ge c| Y_n=1\right] \frac{1}{n}\\=\lim_{n\to\infty}\Pr\left[\left|\bar{X}_n-\mu\right| \ge c \right] \le \lim_{n\to\infty}\frac{\sigma^2}{c^2n} = 0

.

Definition: An estimator Θ^\hat{\Theta} is considered sufficient for the parameter θ\theta if the conditional probability of the random sample X1,…,XnX_1, \ldots, X_n given Θ^=θ^\hat{\Theta}=\widehat{\theta} is independent of θ\theta. In other words, the probability distribution fX1,…,Xn∣Θ^(x1,…,xn∣θ^)f_{X_1, \ldots, X_n \mid \widehat{\Theta}}\left(x_1, \ldots, x_n \mid \widehat{\theta}\right) does not depend on the specific value of θ\theta.

Example. If X1,…,XnX_1, \ldots, X_n is a random sample of Bernoulli(p)\text{Bernoulli}(p), then Θ^=Xˉ\hat{\Theta}=\bar{X} is a sufficient estimator of pp.

Proof. Pr⁡[X⃗=x⃗]=∏i=1npxi(1−p)1−xi=p∑i=1nxi(1−p)n−∑i=1nxi\Pr[\vec{X} =\vec{x}] = \prod_{i=1}^n p^{x_i}(1-p)^{1-x_i} = p^{\sum_{i=1}^n x_i}(1-p)^{n-\sum_{i=1}^nx_i} and

Pr⁡[Θ^=θ]=Pr⁡[∑i=1nxi=nΘ^=nθ]=(nnθ)pnθpn(1−θ)=nΘ^=nθ]=(nnθ)p∑i=1nxipn−∑i=1nxi\Pr[\hat{\Theta} =\theta]\\=\Pr[\sum_{i=1}^n x_i=n\hat{\Theta} =n\theta]\\= {n \choose n \theta}p^{n\theta} p^{n(1-\theta)} = n\hat{\Theta} =n\theta]\\= {n \choose n \theta}p^{\sum_{i=1}^n x_i} p^{n-\sum_{i=1}^n x_i}

Then

Pr⁡[X⃗=x⃗]Pr⁡[Θ^=θ]=1(n∑i=1nxi)\frac{\Pr[\vec{X} =\vec{x}]}{\Pr[\hat{\Theta} =\theta]} = \frac{1}{{n\choose \sum_{i=1}^n x_i}}

So Θ^\hat \Theta is a sufficient estimator.

Example. Let X1,X2,X3X_1, X_2, X_3 be a random sample of Bernoulli (θ)(\theta), then Θ^=\hat{\Theta}= 16(X1+2X2+3X3)\frac{1}{6}\left(X_1+2 X_2+3 X_3\right) is not a sufficient estimator of θ\theta.

Pr⁡[X1=x1,X2=x2,X3=x3]=θx1+x2+x3(1−θ)3−x1−x2−x3.\Pr[X_1 =x_1, X_2 = x_2, X_3 = x_3] = \theta^{x_1+x_2+x_3} (1-\theta)^{3-x_1-x_2-x_3}. Pr⁡[Θ^=12]=Pr⁡[X1+2X2+3X3=3]=Pr⁡[X1=0,X2=0,X3=1]+Pr⁡[X1=1,X2=1,X3=0]=θ(1−θ)2+(1−θ)θ2\Pr[\hat \Theta =\frac{1}{2}] =\Pr[X_1+2X_2+3X_3 =3] \\= \Pr[X_1 =0, X_2 = 0, X_3 = 1] + \Pr[X_1 =1, X_2 = 1, X_3 = 0] \\= \theta(1-\theta)^2 + (1-\theta)\theta^2

And

Pr⁡[X1=0,X2=0,X3=1]Pr⁡[Θ^=12]=θ(1−θ)2θ(1−θ)2+(1−θ)θ2=1−θ1−θ+θ=1−θ\frac{\Pr[X_1 =0, X_2 = 0, X_3 = 1]}{\Pr[\hat \Theta =\frac{1}{2}]} = \frac{\theta(1-\theta)^2 }{\theta(1-\theta)^2 +(1-\theta)\theta^2} \\= \frac{1-\theta}{1-\theta+\theta} = 1-\theta

Theorem: Θ^\hat{\Theta} is a sufficient estimator of θ\theta if and only if the joint probability mass function (pmf) or probability density function (pdf) of X1,…,XnX_1, \ldots, X_n can be expressed as a product of two functions, ϕ(θ^;θ)\phi(\hat{\theta}; \theta) and h(x1,…,xn)h(x_1, \ldots, x_n), where the function hh does not depend on θ\theta.

Example. Consider a normal population N(μ,σ2)N\left(\mu, \sigma^2\right) for known σ2\sigma^2. Show that Xˉ\bar{X} is a sufficient estimator of μ\mu.

Solution:

Pr⁡[X⃗=x]=1σn(2π)n/2exp⁡(−∑i=1n(xi−μ)22σ2)=1σn(2π)n/2exp⁡(−∑i=1n(xi−Xˉ+Xˉ−μ)22σ2)=1σn(2π)n/2exp⁡(−∑i=1n(xi−Xˉ)2+n(Xˉ−μ)22σ2)=(exp⁡(−n(Xˉ−μ)22σ2))⋅∏i=1n1(2πσ2)1/2exp⁡(−xi−Xˉ2σ2)\Pr[\vec{X} = x] = \frac{1}{\sigma^n(2\pi)^{n/2}} \exp\left(-\sum_{i=1}^n\frac{(x_i-\mu)^2}{2\sigma^2}\right) \\= \frac{1}{\sigma^n(2\pi)^{n/2}} \exp\left(-\sum_{i=1}^n\frac{(x_i-\bar{X}+\bar{X}-\mu)^2}{2\sigma^2}\right) \\= \frac{1}{\sigma^n(2\pi)^{n/2}} \exp\left(-\frac{\sum_{i=1}^n(x_i-\bar{X})^2+n(\bar{X}-\mu)^2}{2\sigma^2}\right)\\ = \left(\exp(-\frac{n(\bar{X}-\mu)^2}{2\sigma^2})\right)\cdot\prod_{i=1}^{n} \frac{1}{(2\pi\sigma^2)^{1/2}} \exp\left(-\frac{x_i -\bar{X}}{2\sigma^2}\right)

So the estimator is sufficient.

Now, let's discuss approaches for constructing point estimators. There are three common methods used for this purpose:

Method of Moments

Maximum Likelihood Estimation

Bayesian Estimation

The Method of Moments is a technique used to estimate the parameters θ1,…,θr\theta_1, \ldots, \theta_r of a distribution ff. The approach involves setting up a system of rr equations:

μk′(θ1,…,θr)=mk′,for k=1,…,r,\mu_k^{\prime}\left(\theta_1, \ldots, \theta_r\right) = m_k^{\prime}, \quad \text{for } k = 1, \ldots, r,

where μk′\mu_k^{\prime} represents the kk-th population moment (e.g., mean, variance) of the distribution ff, and mk′m_k^{\prime} represents the corresponding kk-th sample moment (calculated from the given data x1,…,xnx_1, \ldots, x_n). Solving this system of equations yields the estimates for the parameters:

θ^k=θ^k(x1,…,xn),for k=1,…,r.\widehat{\theta}_k = \widehat{\theta}_k\left(x_1, \ldots, x_n\right), \quad \text{for } k = 1, \ldots, r.

Thus, the resulting estimators obtained through the Method of Moments are denoted as Θ^k=Θ^k(X1,…,Xn)\hat{\Theta}_k = \hat{\Theta}_k\left(X_1, \ldots, X_n\right) for k=1,…,rk = 1, \ldots, r.

Example. Given a random sample of size nn from Uniform⁡(a,b)\operatorname{Uniform}(a, b), use the method of moments to obtain an estimator of a,ba, b.

We know that the first moment of the uniform distribution is a+b2\frac{a+b}{2} and the second moment of the uniform distribution is a2+ab+b23.\frac{a^2+ab+b^2}{3}. Then we will have

{a+b2=xa2+ab+b23=y\begin{cases} \frac{a+b}{2} = x \\ \frac{a^2+ab+b^2}{3} = y\end{cases}

,

where x=Xˉx = \bar{X} is the sample mean and y=X2ˉy = \bar{X^2} is the sample second moment.

Then we will have a=2x−ba = 2x - b and so b2−2bx+4x2=a2+ab+b2=3y  ⟹  b2−2bx+4x2−3y=0  ⟹  Δ=4b2−4(4x2−3y)=4(b2+3y−4x2)b^2 - 2 b x + 4 x^2=a^2+ab+b^2=3y \implies b^2-2bx + 4x^2 - 3y = 0\implies \Delta = 4b^2 - 4(4x^2 - 3y) = 4(b^2 +3y- 4x^2) and so

b=2x+2b2+3y−4x22b = \frac{2x +2\sqrt{b^2+3y-4x^2}}{2}

can be an estimator of bb.

We can use the similar procedure to solve aa and get a=2x−2b2+3y−4x22a = \frac{2x -2\sqrt{b^2+3y-4x^2}}{2}

Example. Given a random sample of size nn from Gamma⁡(α,β)\operatorname{Gamma}(\alpha, \beta), use the method of moments to obtain estimators of α\alpha and β\beta.

Solution, we will use the same definition for x,yx,y as the above probelm but for gamma distribution, then we will have

{αβ=xα(α+1)β2=y\begin{cases}\alpha \beta = x\\ \alpha(\alpha+1)\beta^2 = y\end{cases}

And so

{αβ=x(α+1)β=yx\begin{cases}\alpha \beta =x \\ (\alpha+1)\beta = \frac{y}{x}\end{cases}

And so

{α=x2y−x2β=yx−x=y−x2x\begin{cases} \alpha= \frac{x^2}{y-x^2} \\ \beta = \frac{y}{x}-x = \frac{y-x^2}{x}\end{cases}

Maximum likelihood estimation

The Maximum Likelihood Estimation (MLE) is a method used to estimate the parameter θ\theta of a statistical distribution, given the observed values x1,…,xnx_1, \ldots, x_n. To perform MLE, we define the likelihood function L(θ)L(\theta), which is the joint probability density function (pdf) or probability mass function (pmf) of the observed data x1,…,xnx_1, \ldots, x_n when treated as a function of the parameter θ\theta. The likelihood function is given by:

L(θ)=fX1,…,Xn(x1,…,xn;θ)=∏i=1nf(xi;θ).L(\theta) = f_{X_1, \ldots, X_n}\left(x_1, \ldots, x_n; \theta\right) = \prod_{i=1}^n f\left(x_i; \theta\right).

In this equation, f(xi;θ)f\left(x_i; \theta\right) represents the pdf or pmf of each individual data point xix_i, and the product of these probabilities is taken for all nn observed data points.

The MLE of θ\theta, denoted as θ^\hat{\theta}, is the value that maximizes the likelihood function L(θ)L(\theta). In other words, it is the parameter value that makes the observed data most probable, given the assumed statistical model characterized by f(x;θ)f\left(x; \theta\right). Mathematically, we find θ^\hat{\theta} by solving:

θ^=arg⁡max⁡θL(θ).\hat{\theta} = \arg\max_{\theta} L(\theta).

The value θ^\hat{\theta} obtained in this way is referred to as the Maximum Likelihood Estimate (MLE) of θ\theta, which provides an estimate of the unknown parameter based on the observed data. The MLE is a widely used and valuable method for parameter estimation in various statistical models and machine learning algorithms.

Example. Given xx successes in nn trials, find the MLE of θ\theta in the corresponding Binomial⁡(n,θ)\operatorname{Binomial}(n, \theta).

We see that the probability we want to maximize is

p(X=x;θ)=(nx)θx(1−θ)n−xp(X = x; \theta) = {n \choose x} \theta^x (1-\theta)^{n-x}

If we take derivative with respect to θ\theta and setting it to zero, we will have the following:

∂∂θp(X=x;θ)=(nx)(xθx−1(1−θ)n−x−(n−x)θx(1−θ)n−x−1)=0\frac{\partial}{\partial \theta}p(X = x; \theta) = {n \choose x} \left(x\theta^{x-1} (1-\theta)^{n-x} -(n-x)\theta^x (1-\theta)^{n-x-1}\right)=0

and so we will have

x(1−θ)−(n−x)θ=0  ⟹  x−xθ−nθ+xθ=0  ⟹  θ=xn.x(1-\theta)-(n-x) \theta = 0 \implies x -x\theta -n\theta+x\theta =0\implies \theta = \frac{x}{n}.

Example. Let X1,…,XnX_1, \ldots, X_n be a random sample from Exponential distribution(θ)(\theta). Find the MLE of θ\theta.

Solution:

So the exponential distribution has the following pdf:

fX1(x)=1θexp⁡(−xθ)f_{X_1}(x) = \frac{1}{\theta} \exp(-\frac{x}{\theta})

and so the joint pdf will have the following:

fX⃗(x⃗)=1θnexp⁡(−∑i=1nxiθ)f_{\vec X}(\vec x) = \frac{1}{\theta^n} \exp\left(-\frac{\sum_{i=1}^n x_i}{\theta}\right)

If we take ln⁡\ln both sides and maximize the ln⁡\ln formula, we will have

∂∂θln⁡fX⃗(x⃗)=∂∂θ(−nln⁡(θ)−∑i=1nxiθ)=−nθ+θ−2∑i=1nxi=0\frac{\partial}{\partial\theta} \ln f_{\vec X}(\vec x) = \frac{\partial}{\partial\theta}\left( -n\ln(\theta)-\frac{\sum_{i=1}^n x_i}{\theta}\right)\\ = -\frac{n}{\theta}+\theta^{-2}\sum_{i=1}^n x_i = 0

It means that

θ(∑i=1nxi)−1=n−1  ⟹  θ=∑i=1nxin.\theta \left(\sum_{i=1}^n x_i\right)^{-1} = n^{-1} \implies \theta = \frac{\sum_{i=1}^nx_i}{n}.

Example. Let X1,…,XnX_1, \ldots, X_n be a random sample of Uniform(0, β)\left.\beta\right). Find the MLE of β\beta.

We will have the following pdf:

fX⃗(x⃗)=∏i=1nf(xi;β)=∏i=1n1βIxi≤β(xi)={β−n if β≥max⁡1≤i≤nxi0 otherwisef_{\vec X}(\vec x) = \prod_{i=1}^n f(x_i;\beta) = \prod_{i=1}^n \frac{1}{\beta} I_{x_i \le \beta}(x_i) = \begin{cases}\beta^{-n} & \text{ if }\beta \ge \max_{1\le i \le n}x_i \\ 0 &\text{ otherwise}\end{cases}

and therefore, β=max⁡xi\beta = \max x_i is the maximum likelihood estimator.

Example. Let X1,…,XnX_1, \ldots, X_n be a random sample of N(μ,σ2)N\left(\mu, \sigma^2\right) where both μ\mu and σ2\sigma^2 are unknown. Find the MLE of μ\mu and σ2\sigma^2.

We have the following pdf:

fX⃗(x⃗)=(2πσ2)−n/2exp⁡(−∑(xi−μ)22σ2)=(2πu)−n/2exp⁡(−∑(xi−μ)22u)f_{\vec X}(\vec x) = (2\pi \sigma^2)^{-n/2}\exp(-\frac{\sum(x_i-\mu)^2}{2\sigma^2}) \\= (2\pi u)^{-n/2}\exp(-\frac{\sum(x_i-\mu)^2}{2u})

where u=σ2u = \sigma^2 and if we take natural log, we will have

v:=ln⁡fX⃗(x⃗)=−n2ln⁡(2πu)−∑(xi−μ)22uv:= \ln f_{\vec X}(\vec x) = -\frac{n}{2}\ln(2\pi u)-\frac{\sum(x_i-\mu)^2}{2u}

Then

∂∂uv=−n2u+∑(xi−μ)22u2=0\frac{\partial}{\partial u} v = -\frac{n}{2u} +\frac{\sum(x_i-\mu)^2}{2u^2} =0

and

∂∂μv=∑μ−xiu2=0\frac{\partial}{\partial \mu} v = \frac{\sum \mu-x_i}{u^2} =0

and so μ=∑xin\mu = \frac{\sum x_i}{n} and so

nu=∑(xi−μ)2  ⟹  u=∑(xi−μ)2nnu = \sum (x_i - \mu)^2 \implies u = \frac{\sum (x_i - \mu)^2}{n}

Bayesian estimation (Maximum Posterior Distribution)

ln⁡ϕ(θ∣x1,…,xn)=ln⁡p(θ)+∑i=1nln⁡f(xi∣θ)−ln⁡g(x1,…,xn)\ln \phi\left(\theta \mid x_1, \ldots, x_n\right)=\ln p(\theta)+{\sum_{i=1}^n \ln f\left(x_i \mid \theta\right)}-{\ln g\left(x_1, \ldots, x_n\right)}

We can see the summation is the log-likelihood and we know that ln⁡p(θ)\ln p(\theta) is serving as a regularization to the likelihood function.

Example. Let XX follow Binomial⁡(n,θ)\operatorname{Binomial}(n, \theta) for unknown θ∈(0,1)\theta \in(0,1). Suppose the prior distribution of θ\theta is Beta⁡(α,β)\operatorname{Beta}(\alpha, \beta) for some given α,β>0\alpha, \beta>0. Find the posterior distribution and Bayesian estimate of θ\theta.

The posterior distribution will be proportional to the following:

(nx)θx(1−θ)n−xΓ(α+β)Γ(α)Γ(β)θα−1(1−θ)β−1=Γ(α+β)Γ(α)Γ(β)(nx)θx+α−1(1−θ)n+β−x−1{n \choose x}\theta^{x}(1-\theta)^{n-x}\frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)}\theta^{\alpha-1}(1-\theta)^{\beta-1} = \frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)}{n \choose x}\theta^{x+\alpha-1}(1-\theta)^{n+\beta-x-1}

Then if we take ln⁡\ln and focus only on θ\theta, then we will have

(x+α−1)ln⁡θ+(n+β−x−1)ln⁡(1−θ)(x+\alpha-1)\ln \theta+(n+\beta-x-1)\ln(1-\theta)

.

If we take partial derivative with respect to θ\theta, then we will have

x+α−1θ+n+β−x−1θ−1=0  ⟹  (x+α−1+n+β−x−1)θ−(x+α−1)=0  ⟹  θ=x+α−1n+α+β−2.\frac{x+\alpha-1}{\theta}+\frac{n+\beta-x-1}{\theta-1} =0 \implies (x+\alpha-1 +n +\beta -x -1)\theta -(x+\alpha-1) =0 \implies \theta = \frac{x+\alpha-1}{n+\alpha+\beta-2}.

Example. Suppose X1,…,XnX_1, \ldots, X_n is a random sample of N(μ,σ2)N\left(\mu, \sigma^2\right) where σ2\sigma^2 is known. Assume the prior distribution of μ\mu is N(μ0,σ02)N\left(\mu_0, \sigma_0^2\right) for some known μ0\mu_0 and σ02\sigma_0^2. Find the posterior distribution of μ\mu and the Bayesian estimate.

Solution:

The posterior distribution of μ\mu follows the following:

(2πσ2)−n/2exp⁡(−∑i(Xi−μ)22σ2)(2πσ02)−1/2exp⁡(−(μ−μ0)22σ02)(2\pi\sigma^2)^{-n/2}\exp\left(-\frac{\sum_{i}(X_i-\mu)^2}{2\sigma^2}\right) (2\pi\sigma_0^2)^{-1/2}\exp\left(-\frac{(\mu-\mu_0)^2}{2\sigma_0^2}\right)

We can see that

∑i(Xi−μ)2σ2+(μ−μ0)2σ02=∑iXi2+μ2−2Xiμσ2+μ2+μ02−2μμ0σ02=(σ02n+σ2)μ2−2(nXˉσ02+μ0σ2)μ+σ2μ02+σ02∑iXi2(σσ0)2\frac{\sum_{i}(X_i-\mu)^2}{\sigma^2} + \frac{(\mu-\mu_0)^2}{\sigma_0^2} = \frac{\sum_{i}X_i^2+\mu^2-2X_i\mu}{\sigma^2} + \frac{\mu^2+\mu_0^2-2\mu \mu_0}{\sigma_0^2} \\= \frac{(\sigma^2_0 n+ \sigma^2)\mu^2-2(n\bar{X} \sigma^2_0 +\mu_0\sigma^2)\mu + \sigma^2 \mu_0^2+\sigma_0^2\sum_i X_i^2}{(\sigma\sigma_0)^2}

And so μ\mu is having normal distribution with 2nXˉσ02+μ0σ2σ02n+σ2\frac{2 n \bar{X}\sigma_0^2 + \mu_0\sigma^2}{\sigma_0^2n +\sigma^2} as mean and σ2σ02σ02n+σ2\frac{\sigma^2 \sigma_0^2}{\sigma_0^2 n +\sigma^2} as the variance.

Example. Suppose X1,…,XnX_1, \ldots, X_n is a random sample of N(μ,σ2)N\left(\mu, \sigma^2\right) where σ2\sigma^2 is known. Assume the prior distribution of μ\mu is N(μ0,σ02)N\left(\mu_0, \sigma_0^2\right) for some known μ0\mu_0 and σ02\sigma_0^2. Find the posterior distribution of μ\mu and the Bayesian estimate.

Solution:

The posterior distribution of μ\mu follows the following:

(2πσ2)−n/2exp⁡(−∑i(Xi−μ)22σ2)(2πσ02)−1/2exp⁡(−(μ−μ0)22σ02)(2\pi\sigma^2)^{-n/2}\exp\left(-\frac{\sum_{i}(X_i-\mu)^2}{2\sigma^2}\right) (2\pi\sigma_0^2)^{-1/2}\exp\left(-\frac{(\mu-\mu_0)^2}{2\sigma_0^2}\right)

We can see that

∑i(Xi−μ)2σ2+(μ−μ0)2σ02=∑iXi2+μ2−2Xiμσ2+μ2+μ02−2μμ0σ02=(σ02n+σ2)μ2−2(nXˉσ02+μ0σ2)μ+σ2μ02+σ02∑iXi2(σσ0)2\frac{\sum_{i}(X_i-\mu)^2}{\sigma^2} + \frac{(\mu-\mu_0)^2}{\sigma_0^2} = \frac{\sum_{i}X_i^2+\mu^2-2X_i\mu}{\sigma^2} + \frac{\mu^2+\mu_0^2-2\mu \mu_0}{\sigma_0^2} \\= \frac{(\sigma^2_0 n+ \sigma^2)\mu^2-2(n\bar{X} \sigma^2_0 +\mu_0\sigma^2)\mu + \sigma^2 \mu_0^2+\sigma_0^2\sum_i X_i^2}{(\sigma\sigma_0)^2}

And so μ\mu is having normal distribution with 2nXˉσ02+μ0σ2σ02n+σ2\frac{2 n \bar{X}\sigma_0^2 + \mu_0\sigma^2}{\sigma_0^2n +\sigma^2} as mean and σ2σ02σ02n+σ2\frac{\sigma^2 \sigma_0^2}{\sigma_0^2 n +\sigma^2} as the variance.

And the Bayesian estimator will be

∂∂μ∑i(Xi−μ)22σ2+(μ−μ0)22σ02=∑i(μ−Xi)σ2+μ−μ0σ02=0\frac{\partial}{\partial \mu}\frac{\sum_{i}(X_i-\mu)^2}{2\sigma^2}+\frac{(\mu-\mu_0)^2}{2\sigma_0^2} = \frac{\sum_i (\mu-X_i)}{\sigma^2} + \frac{\mu -\mu_0}{\sigma_0^2}= 0

and it means that

(nσ2+1σ02)μ=∑Xiσ2+μ0σ02  ⟹  μ=(nσ2+1σ02)−1(∑Xiσ2+μ0σ02)\left(\frac{n}{\sigma^2}+\frac{1}{\sigma_0^2}\right)\mu=\frac{\sum X_i}{\sigma^2}+\frac{\mu_0}{\sigma_0^2} \implies \mu = \left(\frac{n}{\sigma^2}+\frac{1}{\sigma_0^2}\right)^{-1}\left(\frac{\sum X_i}{\sigma^2}+\frac{\mu_0}{\sigma_0^2}\right)

.