I'm working on data consisting in product sales over a period of more than a year. The purpose is that of forecasting future values of the sales, but as of now I'm trying to fit my data..

ts <- xts(sales,order.by=dates,frequency=7)

Here is what my series looks like (see the abundance of missing values in the spring of 2014 as well as a cyclical component spiking in the summer of 2015). enter image description here

First of all I thought about checking whether I could obtain stationarity allowing to fit models like ARMA or ARIMA. There's no particular trend but there is a cyclic component, so I chose to first difference my data:

enter image description here

It looks stationary, I may choose to transform the data to stabilize the variance. Though what I'm interested in is to check the ACF and PACF functions, to try to infer orders of AR and MA components. Here is the ACF and PACF enter image description here enter image description here (of the original data, not 1st difference). I don't find them pretty intuitive as both contain some AR characteristics (there seems to be a weekly seasonal component) as MA (the PACF seems sinusoidal and not cut off as a just AR model would suggest). To give further information I plot also september 2015 data just to show the possible weekly seasonal component:

enter image description here

Every saturday there's a spark in sales followed by a deep (note however that one week the deep is on Monday (september the 7th) the next 3 weeks is on Wednesday) So, it seems difficult to me to guess the proper model, in particular the proper orders of p,d and q in the ARIMA. I get help from R:

fit <- auto.arima(sales, approximation=FALSE,trace= FALSE)

With R choosing a ARIMA (3,1,2) with no seasonal component. Augmentd Dickey-Fuller test gives a 3.5% p-value where H1 is stationarity, so it seems stationary.

I have a couple of questions:

  1. Is it correct to consider the whole series or would you rather suggest to consider a thinner period where there is no particular trend given by the cyclical component? For instance September-Decemeber 2015.
  2. What did I miss in the ACF and PACF plots? The examples I often find on textbooks are trivial with a slowly decaying ACF and a cut off PACF for an AR(viceversa for a MA), but here my low expertise doesn't make ring any bell.
  3. I didn't consider exponential smoothing techniques, given the stationarity and no trend, would you suggest any other technique (state space models maybe) ?

Thank you very much for your help and sorry for the length of the post, but I do believe this can help you in helping me with the problem.

  • $\begingroup$ Since the data are non seasonal given the results, but being that saturday peak evident I'm thinking about inserting a binary regressor in my ARIMA model, which equals 1 when it is saturday.. $\endgroup$ – Tommaso Guerrini Oct 18 '16 at 10:23
  • $\begingroup$ Please post your data , country of origin and starting date in a csv file (column oriented) and I will try and help. $\endgroup$ – IrishStat Oct 18 '16 at 11:51
  • $\begingroup$ @IrishStat thank you for trying to help me, unfortunately the data are private and I am not allowed to share it .. $\endgroup$ – Tommaso Guerrini Oct 18 '16 at 15:37
  • $\begingroup$ I suggest that you double code the data via z=(x-a)/b where you specify a and b to mask the data and simply post the z series $\endgroup$ – IrishStat Oct 18 '16 at 16:55
  • $\begingroup$ If you can't post your data then it is idifficult for me to try and help you understand some specifics ( the devil is in the details ! ). If you wish we can set up a chat session or you can send an email to me with specific detailed questions and I will try and help you. $\endgroup$ – IrishStat Oct 25 '16 at 12:28

Your Answer

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

Browse other questions tagged or ask your own question.