tidyverts / fabletools

General fable features useful for extension packages
http://fabletools.tidyverts.org/
89 stars 31 forks source link

Feature request: add automatic selection of Box Cox transformation parameter to `box_cox()` #100

Closed zenggyu closed 5 years ago

zenggyu commented 5 years ago

The function BoxCox.lambda() in the forecast package provides such functionality. It would be nice to include it in fabletools::box_cox(), perhaps through an additional parameter method that can be used to specify the selection method (defaults to method = NULL, meaning no auto selection).

mitchelloharawild commented 5 years ago

The feasts package provides the guerrero() function, which uses Guerrero's method to determine an appropriate Box Cox transformation parameter.

Because of transformation is more general in fable I haven't figured out how box_cox(lambda = "auto") can be implemented whilst retaining automatic back transformation. I could implement this and raise an error whenever the transformations are back-transformed.

Currently we recommend a two step process, first determine the appropriate lambda using features(data, response_variable, guerrero) and then use the saved best result in the transformation.

zenggyu commented 5 years ago

Oh, I didn't know about that, thanks!