I have to predict weekly order bookings. I have data from 2015 till 2018. The data is available at weekly level. It shows a repeat every 13 weeks..that is basically same variations in every quarter. Like last week of quarter having highest booking etc.

Also I tried find the seasonality using tbats$seasonal.periods and it comes to be 13 and not 52.

What should I use as frequency when creating a ts object in R?

Also, what will be the best way to get the most effective arima model here:

  1. arima with Fourier terms for K <= 6 (13 being the frequency)
  2. 12 dummy variables for 13 weeks for each week of quarter
  3. sarima

1 Answer 1


If you want to go with single seasonality, then try both 13 and 52, keep a holdout set, fit various models along the lines of your points 1-3, and see which model with which seasonality performs best in a holdout sample, e.g., using or .

Alternatively, also try fitting , by creating an msts object. Models that can account for such multiple seasonalities include TBATS (which you already use) and BATS. Again, decide based on a holdout forecast.

We can't say which one of these models will perform best without seeing your data. I would suspect SARIMA to work best, since it has the fewest free parameters to estimate and you don't have a whole lot of data.

  • $\begingroup$ I checked for multiple seasonality by declaring: data =msts(data2,seasonal.periods =c(13,52)).I ran the model with tbats to get the seasonal.periods and I still get only 13 and not 13 and 52 $\endgroup$ Mar 26, 2018 at 7:52
  • $\begingroup$ tbats() may be checking whether or not to include one frequency and in your case decide not to use 52. Unfortunately, the help page does not explain how it does this. You may want to look into the source code. $\endgroup$ Mar 26, 2018 at 7:57
  • $\begingroup$ > data<-ts(data2,frequency = 52, start =c(1,1)) > a<-tbats(data[,6]) > a$seasonal.periods NULL > data<-ts(data2,frequency = 13, start =c(1,1)) > a<-tbats(data[,6]) > a$seasonal.periods [1] 13 > data<-msts(data2,seasonal.periods = c(13,52)) > a<-tbats(data[,6]) > a$seasonal.periods NULL > $\endgroup$ Mar 26, 2018 at 8:22
  • $\begingroup$ Source code for tbats with respect to msts: if (is.null(seasonal.periods)) { if (any(class(y) == "msts")) seasonal.periods <- attr(y, "msts") else if (class(y) == "ts") seasonal.periods <- frequency(y) else { y <- as.ts(y) seasonal.periods <- 1 } } else { if (!any(class(y) == "ts")) y <- msts(y, seasonal.periods) } seasonal.periods <- unique(pmax(seasonal.periods, 1)) if (all(seasonal.periods == 1)) seasonal.periods <- NULL $\endgroup$ Mar 26, 2018 at 8:23
  • $\begingroup$ Please help with the source code for tbats with respect to msts. $\endgroup$ Mar 26, 2018 at 9:53

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.