I have a database with hourly records. When I perform my ADF and KPSS test the p-value is less than alpha 0.05 so the series is assumed to be stationary. But by plotting the ACF the delays are all out it shows that the series is not stationary. with two or more differentiation still can't remove the trend and seasonality! someone has already found this problem!

  • $\begingroup$ A low p-value of the KPSS tests suggests nonstationarity. ADF test suggests lack of a unit root, hence no differencing is needed. Why would you think differencing should help? Significant values of ACF do not imply nonstationarity. Since you mention SARIMA, why don't you let auto.arima in R pick a model for you? The model will take care of stochastic and (simple forms of) deterministic trends as well as seasonality. $\endgroup$ Mar 14 '20 at 10:22
  • $\begingroup$ thanks for your answer @RichardHardy. I'm sending you my results. I don't think they're right. stat ADF = -6.349416230014464 p-value = 2.6333871594962958e-08 and stat KPSS = 10.18962466162416 p-value = 0.01 $\endgroup$ Mar 14 '20 at 10:49
  • $\begingroup$ with pm.ato_arima I had SARIMAX(13, 2, 1) Log Likelihood -24612.451 $\endgroup$ Mar 14 '20 at 10:56
  • $\begingroup$ sarima because I have seosonality 24*7 (hours and days) $\endgroup$ Mar 14 '20 at 11:07

There are different ways to make your time series non-stationary. The most common ways are to take the difference (y_new = y_now - y_before) or take the logarithm of the y variable.

You want to remove stationarity because your model will not be able to capture the trend of the time series because it has never seen similar values before.

In order to deal with seasonality, the easiest way is to include the lags of the y var. Which lags should you include? That will be shown on the Partial Autocorrelation Plot, those lags that are significant.

Another way to deal with the seasonality, that proves to be very effective is to include fourier tranformations of the y var as features/regressors in your data. The fourier transformations have the characteristic to decompose time series into trend, seasonalities (daily, weekly, monthly etc) and the rest.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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