how to apply boxcox for multiple series in tsibble

140 views Asked by At

I would like to apply boxcox transformation for many series in tsibble data. Can't figure how to do it.

require(fpp3)
require(fpp)
require(fable)
require(tsibble)
require(tsibbledata)
require(feasts)
require(ggplot2)
require(lubridate)

long = aus_production %>%
  select(Quarter, Beer, Bricks) %>%  
  gather(var, value, 2:3) %>% 
  as_tsibble()

lam = long %>%
  features(value, features = guerrero) 

long %>% 
  nest(-var) %>% 
  inner_join(lam) %>% 
  mutate(data_lambda = purrr::map(.x = data, ~box_cox(.x, lambda_guerrero)))

I tried many combinations, but failed. Maybe there is simpler option. This is simple example, with two series, but I can imagine, that I have 200 series, so I don't want to do it with hard coding.

Best Sewe

0

There are 0 answers