0
$\begingroup$

I have the following raw sales timeseries:

enter image description here

Clearly it's not stationary since it does have somewhat of an increasing trend (non-stationarity also verified by DF-test). By differencing I obtain the stationary series:

enter image description here

Then I take a peek on the ACF and PACF:

enter image description here enter image description here

Usually, one looks at both of these to find the order of MA and AR processes then combine them into an ARMA(p,q) process. However I find that the ACF is a bit odd since I have some large positive spikes every 7 lags. There are many significant lags between insignificant ones. And what can explain the first large negative lag?

With inspection of the PACF, we can learn how many AR terms we need to use to explain the autocorrelation pattern in a time series.

For example if the Partial Autocorrelation is significant at only first two lags and the remaining lags abruptly fall to zero, it suggests using an AR term of 2. But in my case the values seem very random and this makes it hard choosing the orders.

Does anyone have a good strategy of dealing with data like this that gives ACF's and PACF's like I've gotten? I'd appreciate any tips and tricks!

PS: Does the volatility clusterings in the data suggest use of a GARCH model instead of an ARMA? Or is there other models that would be better suited?

$\endgroup$
8
  • $\begingroup$ Always look at the ACF/PACF plots of the original time series (before you do any transformations). $\endgroup$ Commented Nov 9, 2021 at 8:53
  • $\begingroup$ @user2974951 - Yes I did that too, but they look quite similar so I only posted one of them. $\endgroup$
    – Parseval
    Commented Nov 9, 2021 at 9:07
  • $\begingroup$ Differencing the series was a bad idea as the series does not seem to have a unit root to begin with. You have doubled your error variance by differencing the series. $\endgroup$ Commented Nov 9, 2021 at 9:07
  • $\begingroup$ @RichardHardy - What would then be a better way of removing the trend? Only log-ing? $\endgroup$
    – Parseval
    Commented Nov 9, 2021 at 9:27
  • 1
    $\begingroup$ Probably because sales are not considered a topic in financial econometrics / financial time series analysis. However, most time series textbooks should have a section on deterministic time trends. You could start from time=c(1:length(x)); m1=lm(x~time); m2=lm(x~I(time^2)); m3=lm(x~I(exp(time)) and such, then extract the fitted values (the thrends) or the residuals (the remainder for further modeling) from the lm objects. $\endgroup$ Commented Nov 9, 2021 at 9:53

1 Answer 1

1
$\begingroup$

Your data contains weekly seasonality, as you have spikes every 7th day in your ACF. Probably you are selling more on a certain weekday than on others? Therefore ARMA-Modelling is not suitable. I propose the following:

  • As a first try, aggregate your data on a weekly basis and use an ARMA Model on that data.
  • If you need a daily forecast, use a more elaborate method that can deal with seasonality, such as SARIMA from the ASTSA package or use the Prophet package. Note that you also have yearly seasonality.

Btw, "stationary" means that the mean of a time series is independent of the time, and the autocorrelation only depends on the lag. Your time series is non-stationary, even after differentiating, as the autocorrelation of today with yesterday depends on whether today is a "spiky day" or not.

$\endgroup$
1
  • $\begingroup$ Thanks a lot for your answer. I've already tried prophet right of the bat and it worked very good when I added special events and occasions. What about an LSTM DNN? About the stationarity, well is the Dickey-Fuller test insufficient then? $\endgroup$
    – Parseval
    Commented Nov 10, 2021 at 14:31

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.