-1

I have hourly data and when I plot the ACF and PCF. The data I can see highly depends on the value 24 hour back. This means today value at 7 PM highlighr depends on 7PM values of last days. So I'm not what should be the p,q values. this is stationary dataset

fig = plt.figure(figsize=(12,8))
ax1 = fig.add_subplot(211)
fig = sm.graphics.tsa.plot_acf(data2['Count'],lags=80,ax=ax1)
ax2 = fig.add_subplot(212)
fig = sm.graphics.tsa.plot_pacf(data2['Count'],lags=80,ax=ax2)

enter image description here

user641812
  • 335
  • 5
  • 19
  • "The data highly depends on the value 24 hour back <...> this is stationary dataset" - the ACF shows that your data has a seasonal component, so it's not stationary – ForceBru Dec 18 '21 at 22:53

1 Answers1

1

When you create a non-seasonal (or "normal") ARIMA model, you have a time series and perform an autoregression and an moving average model on the lags of the time series. If you have seasonal data, you should use the seasonal ARIMA, e.g. the SARIMAX from statsmodels. It basically creates a "derivative" time series of only the specific lags in the previous seasons. So for example, if you try to predict the value for 7 PM, it creates a time series of all observations at 7 PM. I wrote a more specific explaination here:

How does the seasonal component of Seasonal ARIMA work?

You then create a SARIMAX model on the data. You have two sets of parameters, the order=(p, d, q) is for the "normal", non-seasonal part. You have an aditional set of parameters seasonal_order=(P, D, Q, m). m is the length of a season, so 24. P, D and Q are used to create an ARIMA model on the derivative, seaonsal time series.

https://www.statsmodels.org/dev/generated/statsmodels.tsa.statespace.sarimax.SARIMAX.html

Arne Decker
  • 808
  • 1
  • 3
  • 9