Confidence intervals for model prediction

帅比萌擦擦* 提交于 2019-12-01 04:22:58

We've been meaning to make this easier to get to. You should be able to use

from statsmodels.sandbox.regression.predstd import wls_prediction_std
prstd, iv_l, iv_u = wls_prediction_std(results)

If you have any problems, please file an issue on github.

additionally you can try to use the get_prediction method.

values_to_predict = pd.DataFrame({'X' : [12], 'M' : [1], 'E' : [2]})
predictions = result.get_prediction(values_to_predict)
predictions.summary_frame(alpha=0.05)

I found the summary_frame() method buried here and you can find the get_prediction() method here. You can change the significance level of the confidence interval and prediction interval by modifying the "alpha" parameter.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!