Maximum Likelihood Estimation (MLE)
Maximum Likelihood Estimation (MLE) is a fundamental method in statistical inference used to estimate the parameters of a statistical model. It is widely used in data science and machine learning because of its theoretical properties and practical applicability. This article dives deep into the principles of MLE, explores its properties, and provides detailed examples of how to apply it to estimate parameters in various statistical models.
Understanding Maximum Likelihood Estimation (MLE)
What is MLE?
Maximum Likelihood Estimation is a method for estimating the parameters of a statistical model by finding the parameter values that maximize the likelihood function. The likelihood function measures how plausible the observed data is given a set of parameter values.
Mathematically, if we have a statistical model with a parameter and a set of observed data , the likelihood function is defined as:
The goal of MLE is to find the parameter value that maximizes the likelihood function:
Assumptions:
- The likelihood must match the sampling design, dependence structure, censoring, and support of the data. The examples below use independent and identically distributed observations, which lets the joint density factor into a product, but MLE also applies to dependent observations when their joint likelihood is specified.
Likelihood vs. Probability
It’s important to distinguish between likelihood and probability:
-
Probability (): The probability of observing the data given specific parameter values . It is used to predict future data based on the model.
-
Likelihood (): A function of the parameters given the observed data . It represents how plausible the parameters are in explaining the observed data.
While probability is used to predict future data given a model, likelihood is used to infer model parameters from observed data.
Log-Likelihood
To simplify the maximization process, especially when dealing with products of probabilities, it’s common to work with the log-likelihood function. The log-likelihood is the natural logarithm of the likelihood function:
Maximizing the log-likelihood function gives the same result as maximizing the likelihood function , but with the advantage of turning products into sums, making the calculations easier and numerically more stable.
Properties of Maximum Likelihood Estimators
MLE has several desirable properties that make it a powerful method in statistical inference:
-
Consistency:
- Under identifiability and other regularity conditions, the MLE converges to the data-generating parameter as the sample size increases. Misspecification or non-identifiability can invalidate this claim.
-
Asymptotic Normality:
- For large samples, the distribution of the MLE is approximately normal (Gaussian) with a mean equal to the true parameter value and a variance equal to the inverse of the Fisher information. This allows for the construction of confidence intervals and hypothesis tests.
-
Asymptotic Efficiency:
- Under regularity conditions, the MLE asymptotically attains the information bound. A finite-sample MLE need not be unbiased or minimum variance.
-
Invariance:
- If is the MLE for , and is a function of , then the MLE for is . This property makes MLEs easy to work with when transforming parameters.
Invariance Example:
Suppose is the MLE for , and you are interested in estimating . According to the invariance property, the MLE for is .
-
Regularity Conditions:
- These properties require more than differentiability: the model must be correctly specified and identifiable, the true parameter should not be on a problematic boundary, and information must behave regularly. Mixtures, change points, and boundary tests are common exceptions.
Applying MLE to Estimate Parameters
Let’s explore how to apply MLE to estimate parameters in various statistical models through detailed examples.
Example 1: Estimating the Mean of a Normal Distribution
Problem Setup
Suppose you have a set of data points that you believe are drawn from a normal distribution with an unknown mean and a known variance . Your goal is to estimate the mean using MLE.
Step 1: Write Down the Likelihood Function
The likelihood function for the normal distribution is given by:
Given that is known and constant, we can focus on the part of the likelihood that depends on :
Step 2: Simplify Using the Log-Likelihood
Taking the logarithm of the likelihood function to get the log-likelihood:
The first term is constant with respect to , so we can ignore it when maximizing. Focus on the second term:
Step 3: Maximize the Log-Likelihood
To find the value of that maximizes the log-likelihood, take the derivative with respect to and set it to zero:
This simplifies to:
Which further simplifies to:
Thus, the MLE for is the sample mean:
Step 4: Interpretation
The MLE for the mean of a normal distribution with known variance is simply the arithmetic mean of the observed data. This result is intuitive and aligns with our understanding that the sample mean is a good estimator for the population mean.
Example 2: Estimating the Success Probability in a Binomial Distribution
Problem Setup
Suppose you are running an experiment where you flip a coin times and observe heads. You want to estimate the probability of getting heads using MLE.
Step 1: Write Down the Likelihood Function
The likelihood function for a Binomial distribution, where successes are observed out of trials, is given by:
Step 2: Simplify Using the Log-Likelihood
Taking the logarithm of the likelihood function to get the log-likelihood:
Again, the first term is constant with respect to , so we can focus on the second and third terms:
Step 3: Maximize the Log-Likelihood
To find the value of that maximizes the log-likelihood, take the derivative with respect to and set it to zero:
Solving for :
This simplifies to:
Thus, the MLE for is the sample proportion:
Step 4: Interpretation
The MLE for the probability of success in a binomial distribution is the observed proportion of successes. This result makes intuitive sense and is widely used in estimating probabilities from binary data.
Example 3: Estimating the Rate Parameter of a Poisson Distribution
Problem Setup
Suppose you are observing the number of events that occur in each of fixed intervals of time, and you believe the number of events in each interval follows a Poisson distribution with an unknown rate parameter . You observe events in total across all intervals. You want to estimate using MLE.
Step 1: Write Down the Likelihood Function
The likelihood function for the Poisson distribution, where events are observed in each interval, is given by:
Where is the number of events observed in each interval.
Step 2: Simplify Using the Log-Likelihood
Taking the logarithm of the likelihood function to get the log-likelihood:
Ignoring the constant term , the log-likelihood simplifies to:
Step 3: Maximize the Log-Likelihood
To find the value of that maximizes the log-likelihood, take the derivative with respect to and set it to zero:
Simplifying this:
Thus, the MLE for is the sample mean of the observed data:
Step 4: Interpretation
The MLE for the rate parameter of a Poisson distribution is the average number of events observed per interval. This makes intuitive sense, as the sample mean is the best estimate of the expected number of events in each interval.
Conclusion
Maximum Likelihood Estimation (MLE) is a powerful and versatile method for estimating the parameters of statistical models. Its consistency, efficiency, and normal approximation are large-sample results that depend on correct specification and regularity conditions.
In this article, we explored the principles of MLE, discussed its important properties, and demonstrated how to apply it to estimate parameters in various statistical models, including the normal, binomial, and Poisson distributions. Through detailed examples, we showed how MLE works in practice and how it can be used to derive meaningful parameter estimates from data.
Understanding and applying MLE is essential for data scientists and statisticians, as it forms the basis for many advanced techniques in machine learning, econometrics, and beyond. By mastering MLE, you can enhance your ability to build and interpret statistical models, leading to better insights and more informed decisions based on data.