线性回归指标
Linear Regression: Coefficients, Variance, LASSO, Ridge
题目详情
解释 OLS 系数、它们的方差、、调整 ,并比较 LASSO 与 Ridge。
英文原题
Explain OLS coefficients, their variance, , adjusted , and compare LASSO vs Ridge.
解析
OLS 系数:在线性模型 (含截距可把 1 列并入 )下,最小二乘解为
前提是 可逆。
系数方差:若误差满足 、(同方差、独立),则
实际中用残差方差估计 ,并由对角元得到每个系数的标准误。
:衡量拟合优度
其中 SSE 为残差平方和,SST 为总平方和。加入自变量不会降低 。
调整 :惩罚加入过多自变量
其中 为样本数, 为参数个数(含截距)。
Ridge vs LASSO:
-
Ridge(L2):
使系数连续收缩、降低方差,但通常不会把系数压到严格 0。 -
LASSO(L1):
倾向于产生稀疏解(部分系数被压到 0),可做变量选择。
两者都是通过引入偏差换取方差下降(bias-variance tradeoff), 越大收缩越强。
英文解析
OLS Coefficients: Under the linear model (where the intercept can be incorporated into as a column of ones), the least squares solution is
provided that is invertible.
Coefficient Variance: If the errors satisfy and (homoscedasticity and independence), then
In practice, is estimated using the residual variance, and the standard errors for each coefficient are derived from the diagonal elements.
: Measures the goodness of fit
where SSE is the sum of squared residuals and SST is the total sum of squares. Adding predictors will not decrease .
Adjusted : Penalizes the inclusion of too many predictors
where is the sample size and is the number of parameters (including the intercept).
Ridge vs LASSO:
-
Ridge (L2):
Causes coefficients to shrink continuously, reducing variance, but typically does not shrink coefficients to exactly zero. -
LASSO (L1):
Tends to produce sparse solutions (shrink some coefficients to zero) and can perform variable selection.
Both methods achieve a bias-variance tradeoff by introducing bias to reduce variance; a larger results in stronger shrinkage.