1.5.10 预测
(1)下面的代码生成了两个子图,第一个子图展示了一阶差分的时间序列图,而第二个和第三个子图则显示了差分序列的自相关函数(ACF)和偏自相关函数(PACF)。
from statsmodels.graphics.tsaplots import plot_acf
from statsmodels.graphics.tsaplots import plot_pacf
#figure setup
fig = plt.figure(figsize=(24,12))
ax1 = fig.add_subplot(2,1,1)
ax1.set_title('1st Order Differencing')
ax2 = fig.add_subplot(2,2,3)
ax3 = fig.add_subplot(2,2,4)
#plots
ax1.plot(y_d