auto_arima 不同时期给出相同的结果?

auto_arima gives same result for different periods?

我有示例数据集,我想预测 2 个周期的后续结果。 但是预测函数给了我相同的结果。

这是我的数据集(数据['t1']);

0     83.846
1     73.350
2     66.499
3     63.576
4     66.545
5     57.264
6     63.009
7     59.608
8     62.775
9     58.451
10    80.893
11    58.734
12    77.830
13    73.374
14    61.650
15    52.548
16    31.683
17    57.599
18    70.814
19    65.354
20    60.033
21    50.162
22    60.764
23    53.799
24    67.266
25    65.520
26    71.248
27    60.457
28    52.424
29    55.622
30    78.149
31    72.111 

代码;

from statsmodels.tsa.arima_model import ARIMA
import pmdarima as pm
model = pm.auto_arima(data['t1'], start_p=1, start_q=1,
                      test='adf',       # use adftest to find optimal 'd'
                      max_p=5, max_q=5, # maximum p and q
                      m=1,              # frequency of series
                      d=None,           # let model determine 'd'
                      seasonal=True,  
                      start_P=0, 
                      D=0, 
                      trace=True,
                      error_action='ignore',  
                      suppress_warnings=True, 
                      stepwise=True)

print(model.summary())

预测;

predict, conf_int  = model.predict(2,return_conf_int=True,alpha=0.05)
predict

结果;

array([71.88338364, 71.88338364])

我该如何解决这个问题?我的 auto_arima 模型有问题吗?

fit_summary;

Best model:  ARIMA(0,1,1)(0,0,0)[0]          
Total fit time: 0.579 seconds
                               SARIMAX Results                                
==============================================================================
Dep. Variable:                      y   No. Observations:                   34
Model:               SARIMAX(0, 1, 1)   Log Likelihood                -126.062
Date:                Mon, 15 Nov 2021   AIC                            256.124
Time:                        16:25:30   BIC                            259.117
Sample:                             0   HQIC                           257.131
                                 - 34                                         
Covariance Type:                  opg                                         
==============================================================================
                 coef    std err          z      P>|z|      [0.025      0.975]
------------------------------------------------------------------------------
ma.L1         -0.5351      0.156     -3.438      0.001      -0.840      -0.230
sigma2       120.5502     31.181      3.866      0.000      59.436     181.664
===================================================================================
Ljung-Box (L1) (Q):                   0.62   Jarque-Bera (JB):                 0.01
Prob(Q):                              0.43   Prob(JB):                         1.00
Heteroskedasticity (H):               1.11   Skew:                            -0.02
Prob(H) (two-sided):                  0.87   Kurtosis:                         2.94
===================================================================================

您的 ARIMA 模型只使用了最后一个分量,因此它是一个 MA 模型。这样的 MA 模型只能预测未来 q 步,因此在您的情况下只能预测一步。如果你想预测不止一步,你要么需要增加q,要么切换到AR模型。