statsmodels ARIMA 的结果与原始数据的比较 [英] Comparison of results from statsmodels ARIMA with original data

查看:31
本文介绍了statsmodels ARIMA 的结果与原始数据的比较的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含季节性成分的时间序列.我将 statsmodels ARIMA 与

I have a time series with seasonal components. I fitted the statsmodels ARIMA with

model = tsa.arima_model.ARIMA(data, (8,1,0)).fit()

例如.现在,我明白 ARIMA 与我的数据不同.我如何比较来自

For example. Now, I understand that ARIMA differences my data. How can I compare the results from

prediction = model.predict()
fig, ax = plt.subplots()
data.plot()
prediction.plot()

由于数据将是原始数据并且预测是不同的,因此平均值在 0 左右,与数据的平均值不同?

as data will be the original data and prediction is differenced, and so has a mean around 0, different from the mean of data?

推荐答案

作为 documentation 显示,如果将关键字 typ 传递给 predict 方法,答案可以显示在原始预测变量中:

As the documentation shows, if the keyword typ is passed to the predict method, the answer can be show in the original predictor variables:

typ : str {‘linear’, ‘levels’}

    ‘linear’ : Linear prediction in terms of the differenced endogenous variables.
    ‘levels’ : Predict the levels of the original endogenous variables.

所以电话是

model = tsa.arima_model.ARIMA(data, (12,1,0)).fit()
arima_predict = model.predict('2015-01-01','2016-01-01', typ='levels')

这篇关于statsmodels ARIMA 的结果与原始数据的比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆