相关疑难解决方法(0)

StatsModels的置信度和预测间隔

我这样做linear regressionStatsModels:

import numpy as np
import statsmodels.api as sm
from statsmodels.sandbox.regression.predstd import wls_prediction_std

n = 100

x = np.linspace(0, 10, n)
e = np.random.normal(size=n)
y = 1 + 0.5*x + 2*e
X = sm.add_constant(x)

re = sm.OLS(y, X).fit()
print(re.summary())

prstd, iv_l, iv_u = wls_prediction_std(re)
Run Code Online (Sandbox Code Playgroud)

我的问题是,iv_liv_u为上,下置信区间预测区间

我如何得到别人?

我需要所有点的置信度和预测间隔,做一个情节.

python statistics statsmodels

39
推荐指数
3
解决办法
4万
查看次数

标签 统计

python ×1

statistics ×1

statsmodels ×1