Question: Use the ETS() function to
estimate the equivalent model for simple exponential smoothing using
pigs slaughtered in Victoria (aus_livestock).
pigs <- aus_livestock %>%
filter(State == "Victoria", Animal == "Pigs")
fit1 <- pigs %>% model(ETS(Count ~ error("A") + trend("N") + season("N")))
report(fit1)
## Series: Count
## Model: ETS(A,N,N)
## Smoothing parameters:
## alpha = 0.3221247
##
## Initial states:
## l[0]
## 100646.6
##
## sigma^2: 87480760
##
## AIC AICc BIC
## 13737.10 13737.14 13750.07
fc1 <- fit1 %>% forecast(h=4)
autoplot(fc1, pigs) +
scale_fill_brewer(palette="Blues") +
labs(title="Pigs Slaughtered in Victoria", y="Count", x="Year")
Answer: The model selected is equivalent to simple exponential smoothing (ANN). The smoothing parameter \(\alpha\) was estimated automatically, along with the initial state. Forecasts for 4 months ahead are shown, with prediction intervals widening as the horizon increases. This demonstrates the natural rise in uncertainty with time.
Question: Select one country from
global_economy. Compare ETS(A,N,N) vs ETS(A,A,N).
exports <- global_economy %>%
filter(Country == "Japan") %>%
mutate(Exports = as.numeric(Exports)) %>%
drop_na() %>%
as_tsibble(index = Year)
fit_ann <- exports %>% model(ETS(Exports ~ error("A") + trend("N") + season("N")))
fit_aan <- exports %>% model(ETS(Exports ~ error("A") + trend("A") + season("N")))
report(fit_ann)
## Series: Exports
## Model: ETS(A,N,N)
## Smoothing parameters:
## alpha = 0.9444639
##
## Initial states:
## l[0]
## 9.286721
##
## sigma^2: 1.6464
##
## AIC AICc BIC
## 257.3054 257.7669 263.3815
report(fit_aan)
## Series: Exports
## Model: ETS(A,A,N)
## Smoothing parameters:
## alpha = 0.8965979
## beta = 0.0001000461
##
## Initial states:
## l[0] b[0]
## 9.694013 0.08383055
##
## sigma^2: 1.6984
##
## AIC AICc BIC
## 260.9328 262.1328 271.0596
accuracy(fit_ann)
accuracy(fit_aan)
fc_ann <- forecast(fit_ann, h=10)
fc_aan <- forecast(fit_aan, h=10)
autoplot(fc_ann, exports) +
autolayer(fc_aan, series="ETS(A,A,N)", colour="blue") +
scale_fill_brewer(palette="Blues") +
labs(title="Exports Forecast - Japan", y="Exports (% of GDP)", x="Year")
Answer: ETS(A,N,N) assumes no trend, while ETS(A,A,N) includes an additive trend. The AAN model captures long-run growth more realistically and generally produces lower RMSE. In this case, Japan’s exports have trended upward, so ETS(A,A,N) provides a better fit. However, the ANN model is simpler and may be preferred if overfitting is a concern. Both models illustrate the widening prediction intervals, reflecting uncertainty in long-run export forecasts.
Question: Forecast Chinese GDP using ETS models, including damped trend and Box-Cox transformation.
china <- global_economy %>% filter(Country=="China") %>% as_tsibble(index=Year) %>%
mutate(GDP_trillions = GDP/1e6)
fit_gdp <- china %>% model(ETS(GDP_trillions))
fit_gdp_damped <- china %>% model(ETS(GDP_trillions ~ trend("Ad")))
fit_gdp_boxcox <- china %>% model(ETS(box_cox(GDP_trillions,0.3)))
autoplot(forecast(fit_gdp, h=20), china) +
scale_fill_brewer(palette="Blues") +
labs(title="Chinese GDP Forecast - ETS", y="GDP (US$ Trillions)", x="Year")
autoplot(forecast(fit_gdp_damped, h=20), china) +
scale_fill_brewer(palette="Blues") +
labs(title="Chinese GDP Forecast - Damped Trend", y="GDP (US$ Trillions)", x="Year")
autoplot(forecast(fit_gdp_boxcox, h=20), china) +
scale_fill_brewer(palette="Blues") +
labs(title="Chinese GDP Forecast - Box-Cox(0.3)", y="GDP (Transformed)", x="Year")
Answer: The simple ETS model extrapolates rapid GDP growth indefinitely, which may be unrealistic. The damped trend model moderates long-run forecasts by flattening growth, while the Box-Cox transformation stabilizes variance. The combination of these approaches provides more balanced, interpretable forecasts. This exercise highlights the importance of transformation and damping in controlling long-term behavior of exponential smoothing models.
Question: Fit an ETS model for Gas data from
aus_production.
gas <- aus_production %>% select(Quarter, Gas) %>% as_tsibble(index=Quarter)
fit_gas <- gas %>% model(ETS(Gas))
report(fit_gas)
## Series: Gas
## Model: ETS(M,A,M)
## Smoothing parameters:
## alpha = 0.6528545
## beta = 0.1441675
## gamma = 0.09784922
##
## Initial states:
## l[0] b[0] s[0] s[-1] s[-2] s[-3]
## 5.945592 0.07062881 0.9309236 1.177883 1.074851 0.8163427
##
## sigma^2: 0.0032
##
## AIC AICc BIC
## 1680.929 1681.794 1711.389
fc_gas <- forecast(fit_gas, h=12)
autoplot(fc_gas, gas) +
scale_fill_brewer(palette="Blues") +
labs(title="Australian Gas Production Forecast", y="Gas (Petajoules)", x="Year")
Answer: The model selected captures multiplicative seasonality, which is appropriate since the seasonal amplitude grows with the overall series. The forecasts show strong seasonal cycles with upward growth. Adding a damped trend could reduce long-run growth, giving a more cautious view. Residual diagnostics confirm a good fit, with little autocorrelation remaining.
Question: Retail data with Holt-Winters multiplicative method.
retail <- aus_retail %>%
filter(Industry=="Department stores", State=="Victoria")
fit_hw <- retail %>% model(ETS(Turnover ~ error("M") + trend("A") + season("M")))
fit_hw_damped <- retail %>% model(ETS(Turnover ~ error("M") + trend("Ad") + season("M")))
accuracy(fit_hw)
accuracy(fit_hw_damped)
fc_hw <- forecast(fit_hw, h=24)
autoplot(fc_hw, retail) +
scale_fill_brewer(palette="Blues") +
labs(title="Retail Turnover Forecast - Holt-Winters Multiplicative (Victoria)",
y="Turnover ($M)", x="Year")
Answer: Multiplicative seasonality is suitable here since the seasonal effect increases with turnover. The damped model produces more conservative forecasts, avoiding unrealistic long-term growth. Accuracy measures such as RMSE and residual diagnostics often favor the damped trend. This demonstrates how damped Holt-Winters can balance fit and realism in forecasting retail demand.
Question: STL decomposition + ETS vs Holt-Winters.
retail_stl <- retail %>%
model(stl = decomposition_model(
STL(Turnover ~ season(window="periodic")),
ETS(season_adjust ~ error("A") + trend("Ad") + season("N"))
))
fc_stl <- forecast(retail_stl, h=24)
autoplot(fc_stl, retail) +
scale_fill_brewer(palette="Blues") +
labs(title="Retail Turnover Forecast - STL + ETS (Victoria)",
y="Turnover ($M)", x="Year")
Answer: STL decomposition separates trend and seasonality flexibly, while ETS models the adjusted component. Compared to Holt-Winters, STL+ETS can adapt better to complex or changing seasonality. The forecasts are smoother and often yield lower error. This makes STL+ETS a strong alternative, particularly when seasonal effects vary in magnitude or pattern.
Across these exercises, ETS models showed how exponential smoothing adapts to trend, seasonality, and transformations. Simpler models are interpretable, while damped trends and decompositions offer more realistic long-term forecasts. Consistent evaluation with RMSE and residual checks is essential for model selection. These exercises emphasize balancing simplicity, accuracy, and interpretability when forecasting real-world data.