I m using tsibble
package tourism
.
trying to do transformation and fit models to it.
library(tsibble)
library(feasts)
library(dplyr)
sum_tourism <- tourism %>%
group_by(Region) %>%
summarise(sum_trips=sum(Trips))
fit <- function(ts, col){
lambda <- ts %>%
features(col, features=guerrero) %>%
pull(lambda_guerrero)
mod <- model(ts, arima=ARIMA(box_cox(col, lambda=lambda)))
return(mod)
}
models <- sum_tourism %>%
split(sum_tourism$Region) %>%
map(~fit(.x, .x$sum_trips))
it gives me error. pls help. thx
! object 'lambda' not found