岭回归的置信区间

Confidence intervals for Ridge regression

我无法在岭回归中计算置信区间。我有这个型号。

model5 <- glmnet(train_x,train_y,family = "gaussian",alpha=0, lambda=0.01)

当我进行预测时,我使用这些命令:

test_pred <- predict(model5, test_x, type = "link")

有人知道如何计算预测的置信区间吗?

事实证明,glmnet 不提供标准误差(因此不给您置信区间),如 here and also addressed in this vignette 所述(摘录如下):

It is a very natural question to ask for standard errors of regression coefficients or other estimated quantities. In principle such standard errors can easily be calculated, e.g. using the bootstrap.

Still, this package deliberately does not provide them. The reason for this is that standard errors are not very meaningful for strongly biased estimates such as arise from penalized estimation methods. Penalized estimation is a procedure that reduces the variance of estimators by introducing substantial bias. The bias of each estimator is therefore a major component of its mean squared error, whereas its variance may contribute only a small part.

Unfortunately, in most applications of penalized regression it is impossible to obtain a sufficiently precise estimate of the bias. Any bootstrap-based calculations can only give an assessment of the variance of the estimates. Reliable estimates of the bias are only available if reliable unbiased estimates are available, which is typically not the case in situations in which penalized estimates are used.

Reporting a standard error of a penalized estimate therefore tells only part of the story. It can give a mistaken impression of great precision, completely ignoring the inaccuracy caused by the bias. It is certainly a mistake to make confidence statements that are only based on an assessment of the variance of the estimates, such as bootstrap-based confidence intervals do.

Reliable confidence intervals around the penalized estimates can be obtained in the case of low dimensional models using the standard generalized linear model theory as implemented in lm, glm and coxph. Methods for constructing reliable confidence intervals in the high-dimensional situation are, to my knowledge, not available.

但是,如果您坚持使用置信区间,请查看 this post。