robjhyndman / forecast

Forecasting Functions for Time Series and Linear Models
http://pkg.robjhyndman.com/forecast
1.11k stars 341 forks source link

Box-Cox transformation problem with tslm #886

Closed robjhyndman closed 3 years ago

robjhyndman commented 3 years ago

Seems to be a problem in applying the transformation to the whole of data rather than just the response variable.

library(forecast)
model1 <- tslm(Demand ~ trend + I(trend^2) + season, lambda = 'auto', data = fpp2::elecdaily)
#> Warning in guerrero(x, lower, upper): Guerrero's method for selecting a Box-Cox
#> parameter (lambda) is given for strictly positive data.

Created on 2021-06-28 by the reprex package (v2.0.0)