gpt4 book ai didi

r - 岭回归的置信区间

转载 作者:行者123 更新时间:2023-12-04 23:16:37 25 4
gpt4 key购买 nike

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

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

当我做预测时,我使用这些命令:
test_pred <- predict(model5, test_x, type = "link")

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

最佳答案

原来glmnethere 所述,不提供标准误差(因此不提供置信区间)并在此 vignette 中得到解决(摘录如下):

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

Still, thispackage deliberately does not provide them. The reason for this isthat standard errors are not very meaningful for strongly biasedestimates such as arise from penalized estimation methods. Penalizedestimation is a procedure that reduces the variance of estimators byintroducing substantial bias. The bias of each estimator is therefore amajor component of its mean squared error, whereas its variance maycontribute only a small part.

Unfortunately, in most applications ofpenalized regression it is impossible to obtain a sufficiently preciseestimate of the bias. Any bootstrap-based calculations can only givean assessment of the variance of the estimates. Reliable estimates ofthe bias are only available if reliable unbiased estimates areavailable, which is typically not the case in situations in whichpenalized estimates are used.

Reporting a standard error of apenalized estimate therefore tells only part of the story. It can givea mistaken impression of great precision, completely ignoring theinaccuracy caused by the bias. It is certainly a mistake to makeconfidence statements that are only based on an assessment of thevariance of the estimates, such as bootstrap-based confidenceintervals do.

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


但是,如果您坚持置信区间,请查看 this邮政。

关于r - 岭回归的置信区间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39750965/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com