rlm_model之后的statsmodels摘要不匹配所使用的规范
我正在使用以下代码执行数据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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论