2
$\begingroup$

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?
$\endgroup$
  • $\begingroup$ In finance we do account for day counts almost always. $\endgroup$ – Aksakal Aug 7 '15 at 18:00
  • 1
    $\begingroup$ Why don't you post your data in an excel format. On another note we have found that daily models work extremely well as they deal effectively with holiday effects e.g. Easter which moves from month to month $\endgroup$ – IrishStat Aug 7 '15 at 18:15
4
$\begingroup$

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")
$\endgroup$
  • $\begingroup$ Your answer is about plotting while the question concerns about modelling time-series. Maybe you could write a little bit more about this topic? $\endgroup$ – Tim Aug 7 '15 at 18:18
  • 1
    $\begingroup$ Thank you @Dawny33 for the help. I've been using FPP, but I haven't looked at that particular section in months and forgot about it. That definitely answered my question. $\endgroup$ – Jake Aug 7 '15 at 19:19
0
$\begingroup$

The short answer is YES, in some fields we do account for day counts. Finance is one of them. For instance, take a look busdays and tomonthly functions in MATLAB. They deal with dates and time series, yet unsurprisingly they're not in general calendar or time series packages, they're in finance toolboxes.

$\endgroup$
  • $\begingroup$ This has always been an optional feature of AUTOBOX which I have helped develop. $\endgroup$ – IrishStat Aug 7 '15 at 18:11

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.