Home About Projects Blog Graph Resume Contact 中文
Back to list

1970年1月1日

2086 Lecture 3 Estimation And Maximum Likelihood

No description yet.

Lecture Note: Lecture 3 Notes.pdf

Previous: 2086 Lecture 2 - Expectation, Variance and Probability Distributions Next: 2086 Lecture 4 - Central Limit Theorem and Confidence Intervals

^\hat{} (hat): add a hat on any variable mean the estimated result of the variable, e.g θ^\hat{\theta} is the estimation of θ\theta

Sum of the squared error:

SSE(μ)=i=1n(yiμ)2\mathrm{SSE}(\mu) = \sum_{i=1}^{n} (y_i - \mu)^2

This represent that the sum of the squared error of every y value to the mean. We can us this to find the estimated mean μ^\hat{\mu}

The smaller the squared error is, means the closer the point yiy_i to μ\mu SSE measure that how close the μ\mu is to the samples. Since mean should be the point that have relatively closer to all sample points, then to find the best μ\mu, we need to make the SSE smallest.

μ^=argminμ{i=1n(yiμ)2}.\hat{\mu} = \arg \min_{\mu} \left\{ \sum_{i=1}^{n} (y_i - \mu)^2 \right\}.

Hence we this is the equation of μ\mu. This estimated mean can also be the best guess of the mean of real data, because we randomly choose samples from the real data, so then mean of sample should be close to mean of real data, especially when sample size goes larger.

Maximum Likelihood Estimation (MLE)

θ^ML(y)=argmaxθ{p(yθ)}.\hat{\theta}_{\mathrm{ML}}(\mathbf{y}) = \arg \max_{\theta} \left\{ p(\mathbf{y} \mid \theta) \right\}.

To find the best estimating parameters of probability distribution, consider we have a samples y where y = {y1,y2,...,yiy_1, y_2, ... ,y_i}.

p(yθ)p(\mathbf{y} \mid \theta) stands for the probability distribution we need

MLE is basically find the best probability distribution use parameters θ\theta that makes the probability of y observed in distribution maximum

For example, If we flip a coin 5 times, we get result y={1,1,1,0,0}

Then we have the θ\theta = {0.1, 0.2, 0.6, 1}

After using MLE, our best estimated parameter will be 0.6, because under Bernoulli distribution, 0.6 is the parameters that have highest probability to observe the result of y

Since all yiy_i in YY must be iid, so p(y1,y2,y3,...,yiθ)p(y_1,y_2,y_3,...,y_i | \theta) = p(y1θ)...p(yiθ)p(y_1|\theta)...p(y_i|\theta) Which can be denote as:

p(yθ)=i=1np(yiθ)p(\mathbf{y} \mid \theta) = \prod_{i=1}^{n} p(y_i \mid \theta)

We can also use negative-log likelihood instead of distribution likelihood, the function is:

θ^ML(y)=argminθ{L(yθ)}.\hat{\theta}_{\mathrm{ML}}(\mathbf{y}) = \arg \min_{\theta} \left\{ L(\mathbf{y} \mid \theta) \right\}.

Where:

L(yθ)=logp(yθ)L(\mathbf{y} \mid \theta) = -\log p(\mathbf{y} \mid \theta)

We can also rewrite this equation using log(ab) = log a + log b:

L(yθ)=i=1nlogp(yiθ)L(\mathbf{y} \mid \theta) = -\sum_{i=1}^{n} \log p(y_i \mid \theta)

We know that the turning point of a function is local maximum or minimum, and hence the first derivative of the function is 0 at the point.

We can find the θ\theta using:

0=L(yθ)θ0 = \frac{\partial L(\mathbf{y} \mid \theta)}{\partial \theta}

Estimator

Point estimation: estimator like MLE give us a specific value of parameter denote as θ^ML\hat{\theta}_{\mathrm{ML}}

Sampling distribution

When we us MLE to get the sample mean on every single different samples, we get different sample mean, although they are close to actual mean, but we can not measure that how accurate it is.

To find the closeness of our sample mean, we first assume population is normal distributed, where YN(μ,σ2)Y \sim N(\mu, \sigma^2)

We also have Samples Y1,Y2,...Y_1,Y_2,...

Here is the law of normal distribution

if Y1N(μ1,σ12) and Y2N(μ2,σ22) then Y1+Y2N(μ1+μ2,σ12+σ22);\text{if } Y_1 \sim N(\mu_1, \sigma_1^2) \text{ and } Y_2 \sim N(\mu_2, \sigma_2^2) \text{ then } Y_1 + Y_2 \sim N(\mu_1 + \mu_2, \sigma_1^2 + \sigma_2^2); and if YN(μ,σ2), then YcN(μc,σ2c2).\text{and if } Y \sim N(\mu, \sigma^2), \text{ then } \frac{Y}{c} \sim N\left(\frac{\mu}{c}, \frac{\sigma^2}{c^2}\right).

This means that if we add the samples from population together, we will get a combined normal distribution where i=1nYiN(nμ,nσ2)\sum_{i=1}^{n} Y_i \sim N(n\mu, n\sigma^2)

and we can then device this by n, we have

μ^ML(Y)N(μ,σ2n)\hat{\mu}_{\mathrm{ML}}(Y) \sim N\left(\mu, \frac{\sigma^2}{n}\right)

This indicate that when n, the sample size goes greater, the less the variance, which means there is less randomness in μ^ML\hat{\mu}_{\mathrm{ML}}

Analyzing the Estimator

To find our how well our Estimator is, we have 4 different metrics which are bias, variance, mean squared error and consistency

Bias

This is the equation for bias of a estimator:

bθ(θ^)=E ⁣[θ^(Y)]θb_{\theta}(\hat{\theta}) = \mathbb{E}\!\left[\hat{\theta}(Y)\right] - \theta

bias = Expectation of estimated parameter minus the actual parameter

In the other word, it measures the difference between average estimated parameter and actual parameter

If b>0, then expected estimated value is greater than actual one, then we are over-estimated

If b<0, then expected estimated value is smaller than actual one, then we are under-estimated

If b=0 means it match, then this estimator is unbiased

Variance

Varθ(θ^)=E ⁣[(θ^(Y)E ⁣[θ^(Y)])2]=V ⁣[θ^(Y)]\mathrm{Var}_{\theta}(\hat{\theta}) = \mathbb{E}\!\left[\left(\hat{\theta}(Y) - \mathbb{E}\!\left[\hat{\theta}(Y)\right]\right)^2\right] = \mathbb{V}\!\left[\hat{\theta}(Y)\right]

This is the formula of calculating variance of estimator, Basically same as the variance formula of random variable, but using estimated parameter θ^\hat{\theta} instead.

Mean Squared Error(MSE)

MSEθ(θ^)=E ⁣[(θ^(Y)θ)2]\mathrm{MSE}_{\theta}(\hat{\theta}) = \mathbb{E}\!\left[\left(\hat{\theta}(Y) - \theta\right)^2\right]

MSE will measure how well our estimator do the estimating. (θ^(Y)θ)2(\hat{\theta}(Y)-\theta)^2 represent the Squared Error, the distance from estimated parameter and actual parameter. Expectation simply just give use the expected or average squared error.

We can also wrote this formula using bias and variance:

MSEθ(θ^)=bθ2(θ^)+Varθ(θ^)\mathrm{MSE}_{\theta}(\hat{\theta}) = b_{\theta}^2(\hat{\theta}) + \mathrm{Var}_{\theta}(\hat{\theta})

Consistency

Consistency tells us that whether a predictor is consistent among samples.

θ^npθ\hat{\theta}_n \xrightarrow{p} \theta

It states that when nn \to \infty, then bias,variancebias, variance \to \infty if estimator is consistent, estimator does not have the systematic error, and also doesn’t have random variance overall.

Backlinks