3

I am struggling to manually select the Box-Cox transformation in my TBATS function. I have a time series with multiple seasonality called belpex.

I have tried the following pieces of code:

belpex_Model <-  tbats(belpex,use.box.cox=TRUE,bc.lower=0,bc.upper=0.2)

As well as this:

belpex_Model <-  tbats(belpex,use.box.cox=TRUE,lambda=0)

However, in both cases, the output of the model is as follows:

TBATS(1, {2,2}, 0.838, {<24,11>, <168,6>})

From the documentation of tbats, the first output of TBATS is the parameter of the Box-Cox transformation.

As a result, the model that I obtain has no Box-Cox transformation despite I explicitly say so.

Another thing that I have noticed is that, despite:

belpex_Model <-  tbats(belpex,use.box.cox=TRUE,lambda=0)

returns that no Box-Cox transformation is used, the output model is quite different that the instruction:

belpex_Model <-  tbats(belpex)

Can it be that when using lambda=0 TBATS does use the proper Box-Cox transformation but that is not really reflected in the TBATS function?

Any other idea/suggestions of what I might be doing wrong?

kjetil b halvorsen
  • 63,378
  • 26
  • 142
  • 467
jesus
  • 131
  • 3

1 Answers1

1

Omega equals 1, this could imply that no Box-Cox transformation is necessary (see De Livera et al. 2010, S. 25-27 in footnote *).

An additional note: Also consider the source code of the TBATS function by typing 'tbats' to the R console and hitting enter. Since I can't reproduce your problem, I just can guess, that your data set may contain negative values which Box-Cox transformation can't handle. Then the use.box.cox argument will be set to FALSE (see line 58-61).

Both interval limits for the Box-Cox parameter will only by used, if any transformation will be executed.

See my examples:

set.seed(123)

numbers <- sample(rnorm(200), 200, replace = F, prob = NULL)
numbers_abs <- abs(sample(rnorm(200), 200, replace = F, prob = NULL))

my_msts <- msts(numbers, seasonal.periods = c(7, 14.25))
my_msts_abs <- msts(numbers_abs, seasonal.periods = c(7, 14.25))

tbats_abs <- tbats(my_msts_abs)
tbats_abs

tbats_abs_false <- tbats(my_msts_abs, use.box.cox = F)
tbats_abs_false

tbats_negative <- tbats(my_msts, use.box.cox = T)
tbats_negative

tbats_negative_false <- tbats(my_msts, use.box.cox = F)
tbats_negative_false

tbats_abs_interval <- tbats(my_msts_abs, use.box.cox = T, bc.lower = 0.2, bc.upper = 0.3)
tbats_abs_interval

tbats_interval <- tbats(my_msts, use.box.cox = T, bc.lower = 0.2, bc.upper = 0.3)
tbats_interval

*De Livera, Hyndman, Snyder (2010): Forecasting time series with complex seasonal patterns using exponential smoothing.

B..H
  • 11
  • 3