Solved – Daily forecasting using ARIMA in R

arimaforecastingrtime series

I am new to time series modeling in R. I have sales data of one year and three months only. I am trying to do sales forecasting at the day level or max at the week level. Following is the step I intend to follow

  1. Convert it into time series object using ts(data$qty, frequency= ??). Here I am very confused about frequency. I can see in data that there is some seasonality like sales is picking up in May, June, July and then again in festival seasons. I guess I cannot use 365 as I have only one year data. Please suggest what should be the frequency
  2. Decompose the time series. Subtract the seasonality and trend from the actual time series model
  3. Fit ARIMA to get a prediction
  4. Again add seasonality and trend to output the final forecast

Please provide feedback on this if its correct approach or not or if there is any other better way to handle it.

Best Answer

No need to subtract any seasonality.

I would recommend using a regression model with NO ARIMA component. Bring in 6 day of the week dummy variables, 11 month of the year variables, holiday variables while searching for outliers, level shifts, trend. Removing variables ("stepdown") that are not necessary and bringing ("stepup") in dummies for the outliers I listed.

We recommend using 3 years of data in order for holidays to exist on weekends and weekdays so that you can get an overall read on the lead and lag relationships. You can also search for day of the month dummy variables, but this is typically only necessary for CASH demand type problems. You can find the need to specify a week of the month dummy for special cases as well.

You can build a pivot table in Excel to compare the coefficients in the model to the % of the total for the day of the week and month of the year to get a "poor man's model" to confirm that the coefficients make sense.