初级农民-请到新手上路获取积分
- 积分
- 9
- 大米
- 颗
- 鳄梨
- 个
- 水井
- 尺
- 蓝莓
- 颗
- 萝卜
- 根
- 小米
- 粒
- 学分
- 个
- 注册时间
- 2023-4-27
- 最后登录
- 1970-1-1
|
Maximize likelihood estimation ..
Maximum likelihood estimation (MLE) is a method of estimating the parameters of a statistical model. Given some observed data and a statistical model, the method provides estimates for the model's parameters that maximize the likelihood of the observed data given those parameters.
The likelihood function \( L(\theta; X) \) quantifies how well the data \( X \) is described by the model with parameters \( \theta \). The maximum likelihood estimates are the values of \( \theta \) that maximize this function. Mathematically, this is expressed as:
\[
\hat{\theta}_{MLE} = \arg\max_{\theta} L(\theta; X)
\]
In other words, we are looking for the values of \( \theta \) that make the observed data \( X \) most probable.
To find these values, one typically takes the natural logarithm of the likelihood function to create the log-likelihood function \( \log L(\theta; X) \). This is often easier to work with mathematically, and it turns products into sums, making the calculations more tractable.
\[
\hat{\theta}_{MLE} = \arg\max_{\theta} \log L(\theta; X)
\]
To find the values of \( \theta \) that maximize the log-likelihood, you typically take the derivative of the log-likelihood function with respect to the parameters, set the derivatives equal to zero, and solve for the parameters. Depending on the complexity of the model and the likelihood function, finding the maximum likelihood estimates could involve straightforward algebraic solutions, numerical methods, or even advanced optimization techniques.
MLE for linear regression
Maximum Likelihood Estimation (MLE) can be used to find the best-fitting line in linear regression. In the simplest case, let's assume we have a linear model defined as:
\[
y = \beta_0 + \beta_1 x + \epsilon
\]
where \( y \) is the dependent variable, \( x \) is the independent variable, \( \beta_0 \) and \( \beta_1 \) are the parameters we want to estimate, and \( \epsilon \) is the error term, usually assumed to be normally distributed with mean zero and variance \( \sigma^2 \).
The likelihood function for a given set of data \( (x_1, y_1), (x_2, y_2), \ldots, (x_n, y_n) \) would be the joint probability of observing all these \( y_i \)'s given the \( x_i \)'s and parameters \( \beta_0 \), \( \beta_1 \), and \( \sigma^2 \). Assuming the errors \( \epsilon \) are independent and normally distributed, the likelihood function \( L \) is:
\[.1point3acres
L(\beta_0, \beta_1, \sigma^2) = \prod_{i=1}^{n} \frac{1}{\sqrt{2\pi\sigma^2}} e^{-\frac{(y_i - \beta_0 - \beta_1 x_i)^2}{2\sigma^2}}.
\]
Taking the natural logarithm, we get the log-likelihood function \( \log L \):
\[
\log L = -\frac{n}{2} \log(2\pi) - \frac{n}{2} \log(\sigma^2) - \frac{1}{2\sigma^2} \sum_{i=1}^{n} (y_i - \beta_0 - \beta_1 x_i)^2
\]
To maximize \( \log L \), we need to find \( \beta_0 \), \( \beta_1 \), and \( \sigma^2 \) that maximize this function. In other words, we take the partial derivatives with respect to \( \beta_0 \), \( \beta_1 \), and \( \sigma^2 \), set them equal to zero, and solve for these parameters.
In practice, this will yield the same estimates for \( \beta_0 \) and \( \beta_1 \) as the least squares method in the context of simple linear regression. This is because maximizing the log-likelihood for a linear regression model with normally distributed errors is mathematically equivalent to minimizing the sum of the squared errors, which is the objective function in least squares estimation.
.1point3acres
Nonetheless, the approach through MLE has the benefit of generalizing more easily to other kinds of distributions for the error term \( \epsilon \), should that be necessary.
Simple concrete example
Let's consider a simple concrete example with a small dataset.
. From 1point 3acres bbs
**Dataset**:
```
x: 1, 2, 3, 4, 5
y: 2.1, 4.2, 6.0, 7.9, 10.1
```. Waral dи,
.
We want to fit a linear regression model \( y = \beta_0 + \beta_1 x \) to this data.
**Step 1**: Define the likelihood function.
.
Given the assumption that the errors are normally distributed, the likelihood function for observing the given y-values given the x-values and parameters \( \beta_0 \) and \( \beta_1 \) is:
\[
L(\beta_0, \beta_1, \sigma^2) = \prod_{i=1}^{5} \frac{1}{\sqrt{2\pi\sigma^2}} e^{-\frac{(y_i - \beta_0 - \beta_1 x_i)^2}{2\sigma^2}}
\]. Waral dи,
**Step 2**: Define the log-likelihood function.
Taking the natural logarithm:
\[
\log L = -\frac{5}{2} \log(2\pi) - \frac{5}{2} \log(\sigma^2) - \frac{1}{2\sigma^2} \sum_{i=1}^{5} (y_i - \beta_0 - \beta_1 x_i)^2. 1point 3 acres
\]
**Step 3**: Maximize the log-likelihood.
To keep this explanation tractable, I'll summarize this step. In practice, you would take the partial derivatives of \( \log L \) with respect to \( \beta_0 \), \( \beta_1 \), and \( \sigma^2 \), set them to zero, and solve the resulting equations. This will yield values for \( \beta_0 \), \( \beta_1 \), and \( \sigma^2 \) that maximize the likelihood of observing the data.
For simple linear regression, this approach will yield the same values for \( \beta_0 \) and \( \beta_1 \) as the least squares method:
\[
\beta_1 = \frac{n(\Sigma xy) - (\Sigma x)(\Sigma y)}{n\Sigma x^2 - (\Sigma x)^2}.1point3acres
\]
\[
\beta_0 = \frac{\Sigma y - \beta_1 (\Sigma x)}{n}
\]
. .и
Computing for the given data:
\[
\beta_1 = \frac{5(110.7) - (15)(30.3)}{5(55) - (15)^2} = 2.02
\]
\[
\beta_0 = \frac{30.3 - 2.02(15)}{5} = 0.08
\]
So, the linear regression line that best fits our data (in the least squares sense and under our assumptions) is:. 1point 3 acres
\[. 1point3acres
y = 0.08 + 2.02x
\]
Again, using MLE with normal error assumptions for simple linear regression leads to the same results as using the least squares method. The power of MLE is more evident when moving beyond these simple scenarios. |
|