Method of Moments and Maximum Likelihood Estimation

Method of Moments

Basic Idea of the Method of Moments

Idea: the method of moments estimates parameters on the principle that the sample moments equal the population moments. Its core idea is to use the sample moments to estimate the population moments, and then to estimate the parameters through the relation between the population moments and the parameters.

Theoretical Basis of the Method of Moments

Theoretical basis: by the law of large numbers, when the sample size is sufficiently large the sample moments converge in probability to the population moments, that is: 1n∑i=1nXik→PE(Xk)\frac{1}{n}\sum_{i=1}^n X_i^k \xrightarrow{P} E(X^k)

Steps of the Method of Moments

Steps:

  1. Determine the number of parameters: suppose the population distribution has kk unknown parameters θ1,θ2,…,θk\theta_1, \theta_2, \dots, \theta_k
  2. Compute the population moments: compute the first through the kk-th population moments, expressed in terms of the parameters
  3. Compute the sample moments: compute the first through the kk-th sample moments
  4. Establish the equations: equate the sample moments to the population moments to establish kk equations
  5. Solve the equations: solve these kk equations to obtain the estimators of the parameters

Advantages and Disadvantages of the Method of Moments

Advantages:

  • Simple to compute and easy to understand
  • Does not require knowing the specific form of the population distribution
  • Applicable to all kinds of distributions

Disadvantages:

  • May not yield the optimal estimator
  • For some distributions the moment estimator may not exist
  • The computation of high-order moments may be unstable

Example of the Method of Moments

Example 1: Parameter Estimation for the Normal Distribution

Population: X∼N(μ,σ2)X \sim N(\mu, \sigma^2)

Steps:

  1. First population moment: E(X)=μE(X) = \mu
  2. Second population moment: E(X2)=μ2+σ2E(X^2) = \mu^2 + \sigma^2
  3. First sample moment: 1n∑i=1nXi=X‾\frac{1}{n}\sum_{i=1}^n X_i = \overline{X}
  4. Second sample moment: 1n∑i=1nXi2\frac{1}{n}\sum_{i=1}^n X_i^2
  5. Establish the equations:
    • X‾=μ\overline{X} = \mu
    • 1n∑i=1nXi2=μ2+σ2\frac{1}{n}\sum_{i=1}^n X_i^2 = \mu^2 + \sigma^2
  6. Solving gives:
    • μ^=X‾\hat{\mu} = \overline{X}
    • σ^2=1n∑i=1nXi2−X‾2=1n∑i=1n(Xi−X‾)2\hat{\sigma}^2 = \frac{1}{n}\sum_{i=1}^n X_i^2 - \overline{X}^2 = \frac{1}{n}\sum_{i=1}^n (X_i - \overline{X})^2

Example 2: Parameter Estimation for the Poisson Distribution

Population: X∼Poisson(λ)X \sim Poisson(\lambda)

Steps:

  1. First population moment: E(X)=λE(X) = \lambda
  2. First sample moment: 1n∑i=1nXi=X‾\frac{1}{n}\sum_{i=1}^n X_i = \overline{X}
  3. Establish the equation: X‾=λ\overline{X} = \lambda
  4. Solving gives: λ^=X‾\hat{\lambda} = \overline{X}

Example 3: Parameter Estimation for the Exponential Distribution

Population: X∼Exp(λ)X \sim Exp(\lambda)

Steps:

  1. First population moment: E(X)=1λE(X) = \frac{1}{\lambda}
  2. First sample moment: 1n∑i=1nXi=X‾\frac{1}{n}\sum_{i=1}^n X_i = \overline{X}
  3. Establish the equation: X‾=1λ\overline{X} = \frac{1}{\lambda}
  4. Solving gives: λ^=1X‾\hat{\lambda} = \frac{1}{\overline{X}}

Example 4: Parameter Estimation for the Uniform Distribution

Population: X∼U(a,b)X \sim U(a,b)

Steps:

  1. First population moment: E(X)=a+b2E(X) = \frac{a+b}{2}
  2. Second population moment: E(X2)=a2+ab+b23E(X^2) = \frac{a^2 + ab + b^2}{3}
  3. First sample moment: 1n∑i=1nXi=X‾\frac{1}{n}\sum_{i=1}^n X_i = \overline{X}
  4. Second sample moment: 1n∑i=1nXi2\frac{1}{n}\sum_{i=1}^n X_i^2
  5. Establish the equations:
    • X‾=a+b2\overline{X} = \frac{a+b}{2}
    • 1n∑i=1nXi2=a2+ab+b23\frac{1}{n}\sum_{i=1}^n X_i^2 = \frac{a^2 + ab + b^2}{3}
  6. Solving gives:
    • a^=X‾−3(1n∑i=1nXi2−X‾2)\hat{a} = \overline{X} - \sqrt{3(\frac{1}{n}\sum_{i=1}^n X_i^2 - \overline{X}^2)}
    • b^=X‾+3(1n∑i=1nXi2−X‾2)\hat{b} = \overline{X} + \sqrt{3(\frac{1}{n}\sum_{i=1}^n X_i^2 - \overline{X}^2)}

Maximum Likelihood Estimation

Basic Idea of Maximum Likelihood Estimation

Idea: maximum likelihood estimation is based on the thought that “the parameter value most likely to have produced the observed sample is the true value”. It chooses as the estimator the parameter value that makes the observed sample values most likely to occur.

Likelihood Function

Likelihood Function

Let the probability density function of the population XX be f(x;θ)f(x;\theta) and the sample be X1,X2,…,XnX_1, X_2, \dots, X_n. Then the likelihood function is defined as: L(θ)=∏i=1nf(Xi;θ)L(\theta) = \prod_{i=1}^n f(X_i;\theta)

Discrete case: if XX is a discrete random variable with probability function P(X=x;θ)P(X=x;\theta), then: L(θ)=∏i=1nP(X=Xi;θ)L(\theta) = \prod_{i=1}^n P(X=X_i;\theta)

Steps of Maximum Likelihood Estimation

Steps:

  1. Construct the likelihood function: L(θ)=∏i=1nf(Xi;θ)L(\theta) = \prod_{i=1}^n f(X_i;\theta)
  2. Take the logarithm: ln⁡L(θ)=∑i=1nln⁡f(Xi;θ)\ln L(\theta) = \sum_{i=1}^n \ln f(X_i;\theta)
  3. Differentiate: ∂ln⁡L(θ)∂θ=0\frac{\partial \ln L(\theta)}{\partial \theta} = 0
  4. Solve the equation: solve the equation above to obtain the maximum likelihood estimator

Properties of Maximum Likelihood Estimation

Property 1: invariance If θ^\hat{\theta} is the maximum likelihood estimator of θ\theta and g(θ)g(\theta) is a function of θ\theta, then g(θ^)g(\hat{\theta}) is the maximum likelihood estimator of g(θ)g(\theta).

Property 2: asymptotic properties Under regularity conditions, the maximum likelihood estimator has:

  • Consistency: θ^n→Pθ\hat{\theta}_n \xrightarrow{P} \theta
  • Asymptotic normality: n(θ^n−θ)→dN(0,I−1(θ))\sqrt{n}(\hat{\theta}_n - \theta) \xrightarrow{d} N(0, I^{-1}(\theta))
  • Asymptotic efficiency: its variance attains the Cramér-Rao lower bound

Examples of Maximum Likelihood Estimation

Example 1: Parameter Estimation for the Normal Distribution

Population: X∼N(μ,σ2)X \sim N(\mu, \sigma^2)

Steps:

  1. Likelihood function: L(μ,σ2)=∏i=1n12πσe−(Xi−μ)22σ2L(\mu, \sigma^2) = \prod_{i=1}^n \frac{1}{\sqrt{2\pi}\sigma} e^{-\frac{(X_i-\mu)^2}{2\sigma^2}}
  2. Log-likelihood function: ln⁡L(μ,σ2)=−n2ln⁡(2π)−n2ln⁡(σ2)−12σ2∑i=1n(Xi−μ)2\ln L(\mu, \sigma^2) = -\frac{n}{2}\ln(2\pi) - \frac{n}{2}\ln(\sigma^2) - \frac{1}{2\sigma^2}\sum_{i=1}^n (X_i-\mu)^2
  3. Differentiate with respect to μ\mu: ∂ln⁡L∂μ=1σ2∑i=1n(Xi−μ)=0\frac{\partial \ln L}{\partial \mu} = \frac{1}{\sigma^2}\sum_{i=1}^n (X_i-\mu) = 0
  4. Solving gives: μ^=X‾\hat{\mu} = \overline{X}
  5. Differentiate with respect to σ2\sigma^2: ∂ln⁡L∂σ2=−n2σ2+12σ4∑i=1n(Xi−μ)2=0\frac{\partial \ln L}{\partial \sigma^2} = -\frac{n}{2\sigma^2} + \frac{1}{2\sigma^4}\sum_{i=1}^n (X_i-\mu)^2 = 0
  6. Solving gives: σ^2=1n∑i=1n(Xi−X‾)2\hat{\sigma}^2 = \frac{1}{n}\sum_{i=1}^n (X_i-\overline{X})^2

Example 2: Parameter Estimation for the Poisson Distribution

Population: X∼Poisson(λ)X \sim Poisson(\lambda)

Steps:

  1. Likelihood function: L(λ)=∏i=1nλXie−λXi!L(\lambda) = \prod_{i=1}^n \frac{\lambda^{X_i} e^{-\lambda}}{X_i!}
  2. Log-likelihood function: ln⁡L(λ)=∑i=1n(Xiln⁡λ−λ−ln⁡Xi!)=ln⁡λ∑i=1nXi−nλ−∑i=1nln⁡Xi!\ln L(\lambda) = \sum_{i=1}^n (X_i \ln \lambda - \lambda - \ln X_i!) = \ln \lambda \sum_{i=1}^n X_i - n\lambda - \sum_{i=1}^n \ln X_i!
  3. Differentiate: ∂ln⁡L∂λ=1λ∑i=1nXi−n=0\frac{\partial \ln L}{\partial \lambda} = \frac{1}{\lambda}\sum_{i=1}^n X_i - n = 0
  4. Solving gives: λ^=X‾\hat{\lambda} = \overline{X}

Example 3: Parameter Estimation for the Exponential Distribution

Population: X∼Exp(λ)X \sim Exp(\lambda)

Steps:

  1. Likelihood function: L(λ)=∏i=1nλe−λXi=λne−λ∑i=1nXiL(\lambda) = \prod_{i=1}^n \lambda e^{-\lambda X_i} = \lambda^n e^{-\lambda \sum_{i=1}^n X_i}
  2. Log-likelihood function: ln⁡L(λ)=nln⁡λ−λ∑i=1nXi\ln L(\lambda) = n \ln \lambda - \lambda \sum_{i=1}^n X_i
  3. Differentiate: ∂ln⁡L∂λ=nλ−∑i=1nXi=0\frac{\partial \ln L}{\partial \lambda} = \frac{n}{\lambda} - \sum_{i=1}^n X_i = 0
  4. Solving gives: λ^=n∑i=1nXi=1X‾\hat{\lambda} = \frac{n}{\sum_{i=1}^n X_i} = \frac{1}{\overline{X}}

Example 4: Parameter Estimation for the Bernoulli Distribution

Population: X∼B(1,p)X \sim B(1,p)

Steps:

  1. Likelihood function: L(p)=∏i=1npXi(1−p)1−Xi=p∑i=1nXi(1−p)n−∑i=1nXiL(p) = \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}^n X_i}
  2. Log-likelihood function: ln⁡L(p)=∑i=1nXiln⁡p+(n−∑i=1nXi)ln⁡(1−p)\ln L(p) = \sum_{i=1}^n X_i \ln p + (n-\sum_{i=1}^n X_i) \ln(1-p)
  3. Differentiate: ∂ln⁡L∂p=∑i=1nXip−n−∑i=1nXi1−p=0\frac{\partial \ln L}{\partial p} = \frac{\sum_{i=1}^n X_i}{p} - \frac{n-\sum_{i=1}^n X_i}{1-p} = 0
  4. Solving gives: p^=1n∑i=1nXi=X‾\hat{p} = \frac{1}{n}\sum_{i=1}^n X_i = \overline{X}

Comparison of the Two Methods

Computational Complexity

Method of moments: simple to compute, only the sample moments need to be computed Maximum likelihood estimation: relatively more complex to compute, requiring differentiation and solving equations

Estimation Performance

Method of moments: may not yield the optimal estimator Maximum likelihood estimation: yields the optimal estimator under regularity conditions

Applicability

Method of moments: applicable to all kinds of distributions, without needing to know the specific form Maximum likelihood estimation: requires knowing the specific form of the distribution

Asymptotic Properties

Method of moments: has consistency, but does not necessarily have asymptotic efficiency Maximum likelihood estimation: has consistency, asymptotic normality, and asymptotic efficiency

Exercises

Exercise 1

Estimate the parameter by the method of moments: given that the sample x1,x2,…,xnx_1, x_2, \dots, x_n comes from X∼Poisson(λ)X \sim Poisson(\lambda).

parameter estimationmethod of momentssample moments

Approach: Use the method of moments, equating the sample moments to the population moments.

Steps:

  1. First population moment: E(X)=λE(X) = \lambda
  2. First sample moment: 1n∑i=1nxi=x‾\frac{1}{n}\sum_{i=1}^n x_i = \overline{x}
  3. Set x‾=λ\overline{x} = \lambda
  4. Solving gives: λ^=x‾\hat{\lambda} = \overline{x}

Answer: λ^=x‾\hat{\lambda} = \overline{x}

Exercise 2

Estimate the parameters by maximum likelihood estimation: given that the sample x1,x2,…,xnx_1, x_2, \dots, x_n comes from X∼N(μ,σ2)X \sim N(\mu, \sigma^2).

parameter estimationmaximum likelihood estimationlikelihood function

Approach: Use maximum likelihood estimation: construct the likelihood function and differentiate.

Steps:

  1. Likelihood function: L(μ,σ2)=∏i=1n12πσe−(xi−μ)22σ2L(\mu, \sigma^2) = \prod_{i=1}^n \frac{1}{\sqrt{2\pi}\sigma} e^{-\frac{(x_i-\mu)^2}{2\sigma^2}}
  2. Log-likelihood function: ln⁡L(μ,σ2)=−n2ln⁡(2π)−n2ln⁡(σ2)−12σ2∑i=1n(xi−μ)2\ln L(\mu, \sigma^2) = -\frac{n}{2}\ln(2\pi) - \frac{n}{2}\ln(\sigma^2) - \frac{1}{2\sigma^2}\sum_{i=1}^n (x_i-\mu)^2
  3. Differentiate with respect to μ\mu: ∂ln⁡L∂μ=1σ2∑i=1n(xi−μ)=0\frac{\partial \ln L}{\partial \mu} = \frac{1}{\sigma^2}\sum_{i=1}^n (x_i-\mu) = 0
  4. Solving gives: μ^=x‾\hat{\mu} = \overline{x}
  5. Differentiate with respect to σ2\sigma^2: ∂ln⁡L∂σ2=−n2σ2+12σ4∑i=1n(xi−μ)2=0\frac{\partial \ln L}{\partial \sigma^2} = -\frac{n}{2\sigma^2} + \frac{1}{2\sigma^4}\sum_{i=1}^n (x_i-\mu)^2 = 0
  6. Solving gives: σ^2=1n∑i=1n(xi−x‾)2\hat{\sigma}^2 = \frac{1}{n}\sum_{i=1}^n (x_i-\overline{x})^2

Answer: μ^=x‾\hat{\mu} = \overline{x}, σ^2=1n∑i=1n(xi−x‾)2\hat{\sigma}^2 = \frac{1}{n}\sum_{i=1}^n (x_i-\overline{x})^2

Exercise 3

Let X1,X2,…,XnX_1, X_2, \dots, X_n be a sample from the population X∼U(0,θ)X \sim U(0, \theta). Estimate the parameter θ\theta by the method of moments.

parameter estimationmethod of momentssample moments

Approach: Use the method of moments, equating the sample moments to the population moments.

Steps:

  1. First population moment: E(X)=θ2E(X) = \frac{\theta}{2}
  2. First sample moment: X‾=1n∑i=1nXi\overline{X} = \frac{1}{n}\sum_{i=1}^n X_i
  3. Set X‾=θ2\overline{X} = \frac{\theta}{2}
  4. Solving gives: θ^=2X‾\hat{\theta} = 2\overline{X}

Answer: θ^=2X‾\hat{\theta} = 2\overline{X}

Exercise 4

Let X1,X2,…,XnX_1, X_2, \dots, X_n be a sample from the population X∼Exp(λ)X \sim Exp(\lambda). Estimate the parameter λ\lambda by maximum likelihood estimation.

parameter estimationmaximum likelihood estimationlikelihood function

Approach: Use maximum likelihood estimation: construct the likelihood function and differentiate.

Steps:

  1. Likelihood function: L(λ)=∏i=1nλe−λXi=λne−λ∑i=1nXiL(\lambda) = \prod_{i=1}^n \lambda e^{-\lambda X_i} = \lambda^n e^{-\lambda \sum_{i=1}^n X_i}
  2. Log-likelihood function: ln⁡L(λ)=nln⁡λ−λ∑i=1nXi\ln L(\lambda) = n \ln \lambda - \lambda \sum_{i=1}^n X_i
  3. Differentiate: ∂ln⁡L∂λ=nλ−∑i=1nXi=0\frac{\partial \ln L}{\partial \lambda} = \frac{n}{\lambda} - \sum_{i=1}^n X_i = 0
  4. Solving gives: λ^=n∑i=1nXi=1X‾\hat{\lambda} = \frac{n}{\sum_{i=1}^n X_i} = \frac{1}{\overline{X}}

Answer: λ^=1X‾\hat{\lambda} = \frac{1}{\overline{X}}

Exercise 5

Compare the advantages and disadvantages of the method of moments and maximum likelihood estimation.

parameter estimationmethod of momentsmaximum likelihood estimation

Approach: Compare them in terms of computational complexity, estimation performance, applicability, and so on.

Steps:

  1. Computational complexity:

    • Method of moments: simple to compute, only the sample moments need to be computed
    • Maximum likelihood estimation: relatively more complex to compute, requiring differentiation and solving equations
  2. Estimation performance:

    • Method of moments: may not yield the optimal estimator
    • Maximum likelihood estimation: yields the optimal estimator under regularity conditions
  3. Applicability:

    • Method of moments: applicable to all kinds of distributions, without needing to know the specific form
    • Maximum likelihood estimation: requires knowing the specific form of the distribution
  4. Asymptotic properties:

    • Method of moments: has consistency, but does not necessarily have asymptotic efficiency
    • Maximum likelihood estimation: has consistency, asymptotic normality, and asymptotic efficiency

Answer: the method of moments is simple to compute but its performance may not be as good as maximum likelihood estimation, whereas maximum likelihood estimation is more complex to compute but performs better


Summary

Symbols Used in This Article

Greek LetterPronunciationDescription
λ\lambdaLambda (lambda)denotes the parameter of the Poisson and exponential distributions
μ\muMu (mu)denotes the population mean
σ\sigmaSigma (sigma)denotes the population standard deviation

Found an issue with this content?

Tell us what could be improved.