线性回归最大似然估计
Linear Regression MLE
题目详情
考虑线性回归设定。给定训练集 ,并假设在给定输入的条件下, 条件独立。我们的目标是估计线性回归模型的参数 。
最大似然估计定义为:
推导 的闭式解。
提示:对似然取对数,并利用“最大化对数似然”等价于“最小化负对数似然”。
Consider the linear regression setting with training data , and assume are conditionally independent given their inputs.
The maximum likelihood estimator is
Assuming a Gaussian noise model, derive a closed-form expression for .
不中返提示: work with the log-likelihood (equivalently, the negative log-likelihood).
解析
假设经典线性回归的高斯噪声模型:
且条件独立,则似然为
取对数并忽略与 无关的常数项,最大化对数似然等价于最小化平方残差和:
对目标函数求导并令梯度为零:
若 可逆,则
若不可逆,则用伪逆得到最小二乘解:。
Original Explanation
Assume the standard Gaussian noise model:
with conditional independence. Then the likelihood is
Taking logs and dropping constants independent of , maximizing the log-likelihood is equivalent to minimizing the sum of squared residuals:
Differentiate and set the gradient to zero:
If is invertible, the unique minimizer is
If it is not invertible, the MLE corresponds to a least-squares solution, e.g. using the Moore--Penrose pseudoinverse.