抱歉,如果这是一个简单的问题/错误,但是当我尝试使用 statsmodels.tsa AR 预测时间序列时,预测会很快超过我拥有的数据。这不取决于模型的顺序或用于拟合 AR 模型的数据长度。
我究竟做错了什么?
from statsmodels.tsa.ar_model import AR
section1 = data[0:800]-np.mean(data[0:800])
plt.plot(section1)
x = AR(section1)
y = x.fit(5)
z = y.predict(10,1500)
plt.plot(z)