statsmodels ARIMA 结果与原始数据的比较

Comparison of results from statsmodels ARIMA with original data

我有一个包含季节性成分的时间序列。我用

安装了 statsmodels ARIMA
model = tsa.arima_model.ARIMA(data, (8,1,0)).fit()

例如。现在,我明白 ARIMA 会改变我的数据。我如何比较

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

由于数据将是原始数据,预测是有差异的,所以均值在 0 附近,与数据的均值不同?

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

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')