简体   繁体   English

在Python中的ARIMA预测

[英]ARIMA prediction in python

I have a time-series forecasting problem that I am using the statsmodels python package, I applied the ARIMA MODEL, In python sm.tsa.ARIMA(data, (p,1,q)) usually transform the data to the first different, for example if we have a raw data (y1,y2,y3,y4....), first thing ARIMA Find the first difference,(y1-y2,y2-y3,....), so it make the model from this new data (first difference data). 我有一个时间序列预测问题,我正在使用statsmodels python包,我应用了ARIMA MODEL,在python中sm.tsa.ARIMA(数据,(p,1,q))通常将数据转换为第一个不同的,例如,如果我们有一个原始数据(y1,y2,y3,y4 ....),首先是ARIMA找到第一个差异,(y1-y2,y2-y3,....),所以它使模型从这个新数据(第一个差异数据)。 my question when I found the model 我找到模型时的问题

arma_mod1=sm.tsa.ARIMA(firstdifference, (p,1,q))

I can predict the first difference data as follow 我可以预测第一个差异数据如下

predict_oil =arma_mod11.predict('1980', '2026').

MY QUESTION: How can I predict the future raw data ( the main data not the first difference data) using Arima? 我的问题:如何使用Arima预测未来的原始数据(主要数据不是第一个差异数据)?

Thanks 谢谢

The predict method takes an optional parameter named typ which lets you decide whether to have predictions in the original time series or in the differenced one. 预测方法采用名为typ的可选参数,该参数允许您决定是在原始时间序列中还是在差异时间段中进行预测。

You should use 你应该用

predict_oil =arma_mod11.predict('1980', '2026', typ='levels')

I don't think this will be still helpful for you, but maybe it will be for others. 我不认为这对你有用,但也许对其他人有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM