What Box-Cox transformation would you select for your retail data (from Exercise 7 in Section 2.10)?
set.seed(123)
myseries <- aus_retail %>%
filter(`Series ID` == sample(aus_retail$`Series ID`,1))
myseries %>% autoplot(Turnover) +
labs(title = "Retail Data Turnover",
y = "$AUD (Millions)")
lambda <- myseries %>%
features(Turnover, features = guerrero) %>%
pull(lambda_guerrero)
myseries %>% autoplot(box_cox(Turnover, lambda))+
labs(title = paste("Transformed Retail Turnover with \u03BB =", round(lambda, 2)))
myseries |>
features(Turnover,features = guerrero)
## # A tibble: 1 × 3
## State Industry lambda_guerrero
## <chr> <chr> <dbl>
## 1 Victoria Household goods retailing 0.215
Applying the Box-Cox transformation with a lambda value of 0.22 has improved the consistency of seasonal patterns in the data.
This transformation is beneficial for handling data with exponential growth by using a natural logarithm to stabilize variance and normalize the distribution.
The lambda value of 0.22 was selected based on Guerrero’s research, which identified it as effective for simplifying forecasting. This optimization makes the data more suitable for linear modeling and enhances prediction accuracy.
Overall, the transformation has led to a more uniform seasonal variation, facilitating better forecasting and analysis.