I'm a complete beginner to time series forecasting, so I worry that some of my questions might be downright stupid, but here we go.

My Code:

I am trying to fit a SARIMAX model to predict CPRAVG while having 8 other exogenous variable. The data is not like a stock market data, i.e. it is predictable. I'm using order = (7,0,5) --> obtained using arma_order_select_ic. Dickey Fuller test on the original data's endogeneous variable (CPRAVG) returns a P value of 0.002, so it appears stationary, however, the original data shows a clear upward trend, so I don't understand what's going on here. The final forecast shows a downward trend while the original data has an upward trend.

My model parameters:

 SARIMAX Results Dep. Variable:     CPRAVG  No. Observations:   9974
Model:  SARIMAX(7, 0, 5)    Log Likelihood  -5897.069
Date:   Mon, 02 Aug 2021    AIC     11836.139
Time:   08:37:53    BIC     11987.501
Sample:     01-01-2009  HQIC    11887.381
    - 03-11-2009        
Covariance Type:    opg         
    coef    std err     z   P>|z|   [0.025  0.975]
PROP    0.0015  8.68e-06    170.638     0.000   0.001   0.001
BUT     -0.0152     1.69e-05    -894.922    0.000   -0.015  -0.015
FLW     -6.903e-06  9.76e-09    -707.424    0.000   -6.92e-06   -6.88e-06
COT     0.0006  2.63e-06    221.046     0.000   0.001   0.001
TEMP    0.0004  3.09e-06    133.100     0.000   0.000   0.000
PRESS   0.0278  0.001   26.193  0.000   0.026   0.030
DRAFT   -0.0074     3.12e-05    -237.741    0.000   -0.007  -0.007
ETH     -0.0013     8.2e-06     -156.076    0.000   -0.001  -0.001
ar.L1   -0  0.001   -0  1.000   -0.002  0.002
ar.L2   -0  0.001   -0  1.000   -0.002  0.002
ar.L3   -0  0.001   -0  1.000   -0.002  0.002
ar.L4   -0  0.001   -0  1.000   -0.002  0.002
ar.L5   -0  0.001   -0  1.000   -0.002  0.002
ar.L6   -0  0.002   -0  1.000   -0.005  0.005
ar.L7   0   0.002   0   1.000   -0.004  0.004
ma.L1   0   0.001   0   1.000   -0.002  0.002
ma.L2   0   0.001   0   1.000   -0.002  0.002
ma.L3   0   0.001   0   1.000   -0.002  0.002
ma.L4   0   0.001   0   1.000   -0.002  0.002
ma.L5   -0  0.001   -0  1.000   -0.002  0.002
sigma2  7.306e-06   2.68e-08    272.748     0.000   7.25e-06    7.36e-06
Ljung-Box (L1) (Q):     8888.83     Jarque-Bera (JB):   415.72
Prob(Q):    0.00    Prob(JB):   0.00
Heteroskedasticity (H):     1.20    Skew:   0.05
Prob(H) (two-sided):    0.00    Kurtosis:   4.00

P>|z| column returns 0 for almost all exog parameters. Does that mean it shows a high correlation with the endogenous variable?

I have no idea how to improve my model, any help will be great! Thanks.

  • $\begingroup$ Hi, what kind of dickey fuller test did you do, the default test with just a constant in the regression? Did you also do a kpss test? As a rule of thumb, ARIMA parameters should typically not succeed two, keep the model as simple as possible. Your biggest improvement for now will lie in correctly assessing the order of integration, worry about the correct lag order of your parameters later. Most of your explanatory parameters are zero with zero std, this suggests strongly you are fitting the wrong model. $\endgroup$ Commented Aug 2, 2021 at 11:23
  • $\begingroup$ Yeah, the default one. I did not specify the regression parameter. And no, I didn't do a kpss test. How do I decide on the parameters? $\endgroup$ Commented Aug 2, 2021 at 13:46
  • $\begingroup$ If you see a clear upward trend, yet the dickey fuller test suggests there is none, I suspect you accidentally did a dickey fuller test for trend stationairy series. However, the statsmodels webpage states the default settings do a regression with just a constant, no linear trend. This is counter-intuitive. I suggest, if you \ really believe there is a linear trend, do your own ACF and PACF analysis after differencing your data once and come up with a new arima(p,1,q) model and see whether it outperforms your current sarimax(7,0,5). If you look for references, its called box-jenkins approach. $\endgroup$ Commented Aug 3, 2021 at 19:47
  • $\begingroup$ Hi! Thanks, I will do that. In the meantime, can you have a look at my notebook? The graphs are there. Also, I did try with a (p,1,q) model that was mostly hit and trial, and there wasn't really much of a difference in output. I suspect I'm doing something fundamentally wrong. $\endgroup$ Commented Aug 4, 2021 at 1:58

1 Answer 1


A couple of points to note after reviewing your notebook:

  1. Your dataset is structured in 10-minute intervals. Given that the time period is so short, there is going to be a lot of random noise in the data and not enough meaningful patterns, i.e. signal. If the time series were longer, e.g. weekly or monthly data, then the patterns would be more meaningful. As a general rule, the longer the time period, the less noise. Therefore, I'm not sure that SARIMAX is the best choice, since any forecasts would be superficial given the noise in the data.

  2. Following on from this point, would it be possible for you to aggregate the data? e.g. sum up or get the average for CPRAVG per day/week/month, depending on the time period you are trying to forecast? e.g. if you are trying to forecast a week out, then working with 10-minute data doesn't make much sense. You might find that the ARIMA model shows a more credible prediction under these circumstances? You may not even need independent variables under this scenario, a basic ARIMA model will do.

  3. You have only generated a PACF, but I would recommend generating an ACF and investigating when does the correlation peak after the first dip. This will indicate where a seasonal pattern is likely to be present. Again, this depends on your time period. You are more likely to observe a seasonal pattern across weekly data as opposed to 10-minute intervals.

  • $\begingroup$ Hi Michael! Thanks for your reply. Yeah, I can consolidate my dataset into daily average values of CPRAVG. The data is over a period of 3 months, so that will leave me with roughly 90 entries. Is that enough for a prediction? Also, my data is definitely not seasonal, the CPRAVG increases as time goes by, that's how our furnaces work. $\endgroup$ Commented Aug 7, 2021 at 7:16
  • $\begingroup$ Also, I would like to have independent variables, because I would like to control these variables, and see how that affects my prediction. $\endgroup$ Commented Aug 7, 2021 at 7:16
  • $\begingroup$ Certainly, you can still include independent variables. I think 90 entries should be enough, and with daily data you are filtering out a lot of the noise that would come with shorter time periods. $\endgroup$ Commented Aug 7, 2021 at 13:45
  • $\begingroup$ Thank you, @Michael Grogan. Daily averages seemed to do the trick, and I am getting much better results. still not perfect, but encouraging. $\endgroup$ Commented Aug 24, 2021 at 7:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.