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
To have the lambda object you need some modification in your code read this answer Using rlang's injection paradigm.
with this modification, the lambda vector is calculated and could be returned by the function.
I have some errors with your model please provide the r packages used in your code
Created on 2023-04-16 with reprex v2.0.2