Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/288.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python ARIMA plot_predict()将预测放置在错误的时间点_Python_Pandas_Time Series_Prediction_Arima - Fatal编程技术网

Python ARIMA plot_predict()将预测放置在错误的时间点

Python ARIMA plot_predict()将预测放置在错误的时间点,python,pandas,time-series,prediction,arima,Python,Pandas,Time Series,Prediction,Arima,所以我遇到了一个相当奇怪的问题。 我已经设置了运行ARIMA预测的代码,这在理论上是可行的。 然而,当我试图用标记为axis的方法得出最终结果时,预测是放在1970年,而不是放在最近的实际日期之后,目前应该是2020年的9个月之后 我使用的是转换成熊猫系列的数据,这些数据是从excel表格中获取的。 该代码以某种方式编程,它始终与来自同一excel工作表的自更新信息一起工作 //---代码: 我还添加了一张图片,以便您可以直观地看到我遇到的问题 有人知道我做错了什么吗 predictions_

所以我遇到了一个相当奇怪的问题。 我已经设置了运行ARIMA预测的代码,这在理论上是可行的。 然而,当我试图用标记为axis的方法得出最终结果时,预测是放在1970年,而不是放在最近的实际日期之后,目前应该是2020年的9个月之后

我使用的是转换成熊猫系列的数据,这些数据是从excel表格中获取的。 该代码以某种方式编程,它始终与来自同一excel工作表的自更新信息一起工作

//---代码:

我还添加了一张图片,以便您可以直观地看到我遇到的问题

有人知道我做错了什么吗

predictions_ARIMA_diff = pd.Series(results_ARIMA.fittedvalues, copy=True) # all datas have same number
predictions_ARIMA_diff_cumsum = predictions_ARIMA_diff.cumsum() #mistake happens here
predictions_ARIMA_log = pd.Series(indexedDataset_logScale["Offered Calls"].iloc[0], index=indexedDataset_logScale.index) # at this point all dates have the same number (6.434547)
predictions_ARIMA_log = predictions_ARIMA_log.add(predictions_ARIMA_diff_cumsum,fill_value=0) # this adds too long # this turns all the numbers into the 6.8, etc. format
            print("predictions_ARIMA_log, after adding", predictions_ARIMA_log)

predictions_ARIMA = np.exp(predictions_ARIMA_log) # why does it not reset? It is cumulatively getting larger # this does give the right numbers

fig, ax = plt.subplots()
ax = predictions_ARIMA.loc["30.09.2018":].plot(ax=ax) #ax=ax
ax.set_ylabel("Anrufe in 100")
ax.set_xlabel("Anzahl Monate")
fig = results_ARIMA.plot_predict(start=1, end=len(predictions_ARIMA)+6, ax=ax,                                             plot_insample=False)