我尝试使用sm.tsa.statespace.SARIMAX进行自回归拟合。但是我遇到了一个警告,然后我想为这个模型设置频率信息。 曾经遇到过这种情况的人,你能帮助我吗?
fit1 = sm.tsa.statespace.SARIMAX(train.Demand, order=(1, 0, 0),
enforce_stationarity=False,
enforce_invertibility=False).fit()
y_hat['AR'] = fit1.predict(start="1975-01-01", end="1975-12-01", dynamic=True)
plt.figure(figsize=(16,8))
plt.plot( train['Demand'], label='Train')
plt.plot(test['Demand'], label='Test')
plt.plot(y_hat_avg['AR'], label='AR')
plt.legend(loc='best')
plt.show()
C:\Users\thach.le\Anaconda3\lib\site-packages\statsmodels-0.8.0-py3.6-win-
amd64.egg\statsmodels\tsa\base\tsa_model.py:165: ValueWarning: No frequency
information was provided, so inferred frequency MS will be used.
% freq, ValueWarning)
谢谢
pandas
DataFrame
发送到statsmodels
函数时才会出现错误。 - Coreyfrom statsmodels.tools.sm_exceptions import ValueWarning
warnings.simplefilter('ignore', ValueWarning)
- ooolllooo