I am using tbats and bats functions and must be doing something wrong. I am using the following command for standard Holt-Winters with bats / tbats but getting an error.

tbats(y = data, use.box.cox = FALSE, use.trend = TRUE, use.damped.trend=FALSE,
      seasonal.periods = 24, use.arma.errors = FALSE)

This the error generated:

Error in 1:nrow(control.array) : argument of length 0

Same thing happens when I use bats.

But when I use the above command without use.damped.trend=FALSE I do get the answer. The problem is that the value of $\alpha=1.4$, which in my opinion is wrong.

  • $\begingroup$ Welcome to the site, @Anthony. I can't tell if this question is only about how to get something done in R. If so, it would be off-topic for CV (see our help page), but on-topic on Stack Overflow. If you have a substantive statistical question (eg, about $\alpha$), please edit to clarify; if not, flag your Q & we'll migrate it for you (please don't cross-post, though). $\endgroup$ – gung - Reinstate Monica Jun 10 '13 at 3:10
  • $\begingroup$ Both questions are equally important for me and are related. You may transfer it to the SO if your terms of use are violated. $\endgroup$ – Anthony Jun 10 '13 at 14:23
  • $\begingroup$ It seems it may fit acceptably well on either site, so it's up to you if you prefer it here or there. On another note, if you believe that @RobHyndman's answer is helpful (eg, I did, +1), or has resolved your question, you might want to upvote it by clicking on the upwards normal distribution, or accept it, by clicking on the check mark below the vote count. $\endgroup$ – gung - Reinstate Monica Jun 10 '13 at 14:26
  • $\begingroup$ Vote up is not allowed as it requires 15 reputations. I have clicked the check mark. $\endgroup$ – Anthony Jun 11 '13 at 1:38
  • $\begingroup$ Anthony, you should have the required reputation now. $\endgroup$ – Glen_b -Reinstate Monica Jun 15 '13 at 23:29
  1. The error is a bug. I'll fix it in the next version of the forecast package. In the meantime, you can simply omit either the use.damped.trend or use.trend argument.

  2. A smoothing parameter of $\alpha=1.4$ is not incorrect. Even for a simple exponential smoothing model, the admissible parameter region for $\alpha$ is (0,2), corresponding to the invertible region of the equivalent ARIMA(0,1,1) model. However, it is common to restrict the region to (0,1) because it provides for additional interpretability of the equations in terms of weighted averages. For a TBATS model, the admissible parameter region is complicated but it also allows for smoothing parameters to be larger than 1.

  • $\begingroup$ Thanks Rob for the clarification. But will the following command work for standard Holt Winters: tbats(y = data, use.box.cox = FALSE,seasonal.periods = 24, use.arma.errors = FALSE) as it will contain damped trend? $\endgroup$ – Anthony Jun 11 '13 at 1:40
  • $\begingroup$ It will only give a damped trend model if including the damping improves the AIC. $\endgroup$ – Rob Hyndman Jun 11 '13 at 3:32

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.