ARIMA 模型:plot_diagnostics 共享错误

ARIMA models : plot_diagnostics share error

我正在使用 plot_diagnostics 绘制 ARIMA 模型。

我的密码是

mod = sm.tsa.statespace.SARIMAX(y,
                            order=(1, 1, 1),
                            seasonal_order=(1, 1, 0, 12),
                            enforce_stationarity=False,
                            enforce_invertibility=False)
results = mod.fit()
print(results.summary().tables[1])

到目前为止一切都很好。 但是当我尝试使用 plot_diagonistic 时,出现了错误。

results.plot_diagnostics(figsize=(30,15))
plt.show()

错误是

ValueError: operands could not be broadcast together with shapes (9,) (3,) (9,) 

不确定为什么会这样。谢谢

尝试更改 plot_diagnostic 中的滞后值,请参见下面的示例:

results.plot_diagnostics(**lags=4**,figsize=(30,15))

在更改滞后值时,请注意您的错误消息参数:

ValueError: operands could not be broadcast together with shapes (9,) (3,) (9,)

消息可能会更改,因此您可以相应地调整滞后值并解决错误。