rlm_model之后的statsmodels摘要不匹配所使用的规范

发布于 2025-02-05 17:06:44 字数 1992 浏览 2 评论 0原文

我正在使用以下代码执行数据X和Y的TukeyBiWeight(Bisquare)鲁棒线性模型回归。

from sklearn import datasets, linear_model
from sklearn.metrics import mean_squared_error, r2_score
import statsmodels.api as sm
X = sm.add_constant(X)
rlm_model = sm.RLM(y, X, m=sm.robust.norms.TukeyBiweight())
rlm_results = rlm_model.fit()

尽管代码无问题运行,但总结是我的担心。运行以下内容之后:

rlm_results.summary()

输出以下内容。

                   Robust linear Model Regression Results                    
==============================================================================
Dep. Variable:                      y   No. Observations:               106721
Model:                            RLM   Df Residuals:                   106719
Method:                          IRLS   Df Model:                            1
Norm:                          HuberT                                         
Scale Est.:                       mad                                         
Cov Type:                          H1                                         
Date:                Wed, 08 Jun 2022                                         
Time:                        19:44:34                                         
No. Iterations:                    50                                         
==============================================================================
                 coef    std err          z      P>|z|      [0.025      0.975]
------------------------------------------------------------------------------
const          0.0377   9.14e-06   4117.608      0.000       0.038       0.038
x1            -0.0076   1.58e-05   -478.404      0.000      -0.008      -0.008
==============================================================================

If the model instance has been used for another fit with different fit
parameters, then the fit options might not be the correct ones anymore .

模型和方法是正确的,但是它说的规范不是我喂入M估计器字段的规范。有人知道为什么会发生这种情况吗?

I am using the below code to perform a TukeyBiweight(Bisquare) Robust linear Model Regression of data X and y.

from sklearn import datasets, linear_model
from sklearn.metrics import mean_squared_error, r2_score
import statsmodels.api as sm
X = sm.add_constant(X)
rlm_model = sm.RLM(y, X, m=sm.robust.norms.TukeyBiweight())
rlm_results = rlm_model.fit()

Although the code runs without issue, the summary is what worries me. After running the below:

rlm_results.summary()

The following is outputted.

                   Robust linear Model Regression Results                    
==============================================================================
Dep. Variable:                      y   No. Observations:               106721
Model:                            RLM   Df Residuals:                   106719
Method:                          IRLS   Df Model:                            1
Norm:                          HuberT                                         
Scale Est.:                       mad                                         
Cov Type:                          H1                                         
Date:                Wed, 08 Jun 2022                                         
Time:                        19:44:34                                         
No. Iterations:                    50                                         
==============================================================================
                 coef    std err          z      P>|z|      [0.025      0.975]
------------------------------------------------------------------------------
const          0.0377   9.14e-06   4117.608      0.000       0.038       0.038
x1            -0.0076   1.58e-05   -478.404      0.000      -0.008      -0.008
==============================================================================

If the model instance has been used for another fit with different fit
parameters, then the fit options might not be the correct ones anymore .

The model and method are correct, but the Norm it says was not the norm that I fed to the M estimator field. Does anyone know why this occurs?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文