我一直在更改AR和MA系数,但仍然相同。所以这是我的代码:
model = ARIMA(df, order =(4,0,4))
results_ARIMA = model.fit(disp=0)
print(results_ARIMA.summary())
n = 520
result = results_ARIMA.forecast(steps=n+1)[0]
result.head()
array([ 41.95623053, 41.98185411, 41.89815634, 41.94481325,
41.87636322, 41.89761647, 41.82752735, 41.87473589,
41.80196085, 41.82483214, 41.76732314, 41.80917335,
41.73434308, 41.76354033, 41.71405822, 41.74715261,
41.67522211, 41.71211599, 41.66466619, 41.68942922,
41.62553526, 41.66771581, 41.61747084, 41.63769232,
41.58473465, 41.6272783 , 41.57252176, 41.59344323,
41.55081621, 41.58859627, 41.53118001, 41.55706031,
41.52102605, 41.55097806, 41.49517932, 41.52744945,
41.49288592, 41.51522557, 41.46560754, 41.50239611,
41.46506061, 41.48297757, 41.44226148, 41.47941698,
41.43768935, 41.45574504, 41.42363582, 41.45670059,
41.41206449, 41.43408257, 41.40750963, 41.43371217,
41.38983724, 41.41725247, 41.39183213, 41.41121285,
41.37212952, 41.40349845, 41.37549464, 41.39071864,
41.35894938, 41.39076871, 41.35865194, 41.37367136,
41.34914894, 41.37753874, 41.34247627, 41.36070523,
41.34090922, 41.36336173, 41.32848649, 41.35132692,
…
模型取历史数据的平均值并预测未来。 如果你绘制数据,你会得到右线。 当您的历史数据没有很强的季节性时,就会发生这种情况,因此模型会取以前值的平均值并预测未来的数据点。(简而言之,模型很难在没有强烈季节性的情况下进行准确的预测( 希望回答你的问题。