Solved – Number of Days in a Monthly Forecast

forecastingrtime series

So for the last few months I've been doing a lot of forecasting for my company and specifically I've been looking at monthly forecasts of total weight of different categories of products output's each month. I've been using time series models such as Arima, ETS, and tslm() within R to do my forecasting, as well as using cross validation to select a model. Over the last two days I've been presenting my results and discussing implementation of my forecasts. But, I've been asked the same question multiple times and I don't know the answer to it, so let me ask you guys. If this has been asked before, I apologize. I'll write out a few questions that hopefully will make clear what I'm trying to understand. Also, I'd like to keep technical answers about the models in the context of R, since that's what I'm using.

  • Do time series models take into account the number of days in a month?

  • Particularly, do time series models consider the number of business days in a month? (or is there a way to incorporate this?)

  • Do we even need to worry about this when forecasting using a time series model or does the model account for this?

For instance, lets say in October of 2014 a certain category sold 35,000 lbs of a product, and that there were 31 days, 23 of which were business days. Well for this year, 2015, there are still 31 days, but now there are only 22 business days.

Just some background on the data, I have monthly data that starts in August of 2008.

  • So would it possibly be better to average the weight per month with the number of business days and forecast out this way since the # of business days change month to month and year to year?

Best Answer

This is a very frequent happening. The series data shows spikes due to the difference in the number of days.

So, there is a technique called Calender Adjustment, where instead of plotting the net value against the time, the average value per time stamp is considered.

Example: Average value per month.

So, when the time series is adjusted accordingly (by considering the average value per time stamp; instead of the net overall value), the problem of complexity is solved.

And on your question about: Do we even need to worry about this when forecasting using a time series model or does the model account for this? As you can see that this difference in the number of days per month increases the complexity of the series, so by the calender adjustment technique, one can simplify the model without losing on the features and details of the data.

So, now we take into account the number of days, and do not need to consider the number of business days in a month and also do not need to worry about this when forecasting using a time series model.

So, that would smoothen the plot and effectively remove the variation due to the different month lengths; thus making the pattern simpler.

The picture would make things more clear:

This is excellently explained here.

The R code:

library("fpp")
monthdays <- rep(c(31,28,31,30,31,30,31,31,30,31,30,31),14)
monthdays[26 + (4*12)*(0:2)] <- 29
par(mfrow=c(2,1))
plot(milk, main="Monthly milk production per cow",
  ylab="Pounds",xlab="Years")
plot(milk/monthdays, main="Average milk production per cow per day", 
  ylab="Pounds", xlab="Years")