beer <- aus_production |>
filter_index("1992 Q1" ~ .) |>
select(Quarter, Beer)
beer_train <- beer |> filter_index(. ~ "2007 Q4")
fit_beer <- beer_train |>
model(
SNAIVE = SNAIVE(Beer),
TSLM = TSLM(Beer ~ trend() + season()),
SARIMA = ARIMA(Beer)
)
fc_beer <- fit_beer |> forecast(h = 10)Note 15: Model Selection, Information Criteria & Forecast Accuracy
Module 3: ARIMA & SARIMA Models
Learning Objectives
After completing this note, you will be able to:
- Define AIC, AICc, and BIC from the maximized log-likelihood and explain how each penalizes model complexity.
- Apply the Three Incomparability Rules to avoid invalid AIC/AICc/BIC comparisons across differencing orders, transformations, or model families.
- Evaluate out-of-sample point forecasts using MAE, RMSE, MAPE, and scale-free MASE, noting MAPE’s zero-division pitfall.
- Assess full predictive distributions using Winkler scores, CRPS, and empirical 80%/95% prediction interval coverage.
1. Likelihood-Based Information Criteria
Inside a single model class evaluated on the same data vector of length \(n\), information criteria balance goodness of fit (measured by the maximized log-likelihood \(\ln \hat{L}\)) against the number of estimated parameters \(k\) (including all ARMA coefficients, constant/drift, and the innovation variance \(\sigma^2\)):
\[ \text{AIC} = -2\ln\hat{L} + 2k, \qquad \text{AICc} = \text{AIC} + \frac{2k(k + 1)}{n - k - 1}, \qquad \text{BIC} = -2\ln\hat{L} + k\ln n. \]
In the special case of Gaussian linear regression (OLS), \(-2\ln\hat{L} = n\ln(\text{RSS}/n) + \text{const}\); for ARIMA and state-space models, software computes the exact Gaussian state-space likelihood. Note two practical properties:
- AICc adds a finite-sample bias correction that prevents selecting overparameterized models when \(n\) is modest; as \(n \to \infty\), \(\text{AICc} \to \text{AIC}\). Minimizing AICc asymptotically minimizes one-step-ahead predictive error.
- BIC imposes a stronger complexity penalty whenever \(\ln n > 2\) (\(n \ge 8\)), favoring more parsimonious models and consistently identifying the true finite-order model if it lies in the candidate set.
The Three Incomparability Rules
Never compare raw AIC, AICc, or BIC values across models that violate any of the following rules:
- Different differencing orders \((d, D)\): Differencing drops \(d + mD\) initial observations and replaces \(y_t\) with \(\nabla^d \nabla_m^D y_t\). Because the two log-likelihoods are evaluated on different data vectors of different lengths, their AICc values live on incompatible scales.
- Different response transformations: Fitting a model to \(\ln y_t\) instead of \(y_t\) changes the scale of the probability density unless the Jacobian term \(-\sum_t \ln y_t\) is added to the log-likelihood.
- Distinct model classes (for example, ARIMA vs. ETS): Different model families employ different likelihood initializations and state-space parameterizations, making raw information criteria non-comparable across classes.
Whenever models differ in \((d, D)\), transformations, or model class, you must compare them on out-of-sample forecast accuracy on the original response scale.
2. Out-of-Sample Point and Distributional Accuracy
Let \(e_{T+h} = y_{T+h} - \hat{y}_{T+h|T}\) denote the forecast error over a test set of \(H\) observations. Standard point accuracy metrics summarize errors from complementary angles:
\[ \text{MAE} = \frac{1}{H}\sum_{h=1}^H |e_{T+h}|, \qquad \text{RMSE} = \sqrt{\frac{1}{H}\sum_{h=1}^H e_{T+h}^2}, \qquad \text{MAPE} = \frac{100}{H}\sum_{h=1}^H \left|\frac{e_{T+h}}{y_{T+h}}\right|. \]
- Minimizing MAE targets the forecast median, whereas minimizing RMSE targets the forecast mean and penalizes large errors quadratically.
- MAPE is unit-free but undefined or explosive whenever \(y_{T+h}\) is zero or near zero (for example, percentage growth rates, net savings, or intermittent demand) and asymmetrically penalizes over-forecasts more heavily than under-forecasts.
- MASE (Mean Absolute Scaled Error) solves both problems by scaling MAE by the in-sample one-step naive (or seasonal naive) MAE:
\[ \text{MASE} = \frac{\text{MAE}}{\frac{1}{T - m}\sum_{t=m+1}^T |y_t - y_{t-m}|}. \]
A value \(\text{MASE} < 1\) means the model outperforms the in-sample seasonal naive benchmark on average.
Point accuracy ignores uncertainty calibration. To evaluate full predictive distributions, we track three proper scoring and calibration diagnostics:
- Empirical 80% / 95% coverage: The fraction of test observations falling inside the nominal 80% and 95% prediction intervals.
- Winkler score (for a \(100(1-\alpha)\%\) interval \([\ell_t, u_t]\)): rewards narrow intervals while imposing a linear penalty \((2/\alpha)\) for misses:
\[ W_{\alpha, t} = (u_t - \ell_t) + \frac{2}{\alpha}(\ell_t - y_t)\,\mathbf{1}_{\{y_t < \ell_t\}} + \frac{2}{\alpha}(y_t - u_t)\,\mathbf{1}_{\{y_t > u_t\}}. \]
- CRPS (Continuous Ranked Probability Score): integrates the squared difference between the forecast CDF \(\hat{F}_t(x)\) and the step function \(\mathbf{1}_{\{y_t \le x\}}\) over all \(x\), strictly rewarding both sharpness and calibration (lower is better, in the same units as \(y_t\)).
3. Worked Example: Australian Beer Production Holdout
We split aus_production$Beer (1992 Q1 to 2010 Q2) into a training set through 2007 Q4 and a 10-quarter test set (2008 Q1 to 2010 Q2), comparing three distinct model classes: Seasonal Naive (SNAIVE), linear trend plus seasonal dummies (TSLM), and SARIMA. Because these belong to different model classes, we compare them strictly on out-of-sample accuracy, not AICc.
fc_beer |>
anchor_fc(beer_train) |>
autoplot(beer |> filter_index("2002 Q1" ~ .), level = NULL, linewidth = 0.85) +
labs(
title = "Australian Beer Production: 10-Quarter Holdout Comparison",
subtitle = "Training: 1992 Q1 to 2007 Q4; Test: 2008 Q1 to 2010 Q2",
x = NULL, y = "Megalitres", color = "Model"
)
Now we compute point metrics, Winkler score (at 95% level), CRPS, and empirical 80%/95% coverage in one reproducible pipeline.
acc_tbl <- fc_beer |>
accuracy(
beer,
list(
point_accuracy_measures,
interval_accuracy_measures,
distribution_accuracy_measures
)
) |>
select(.model, MAE, RMSE, MAPE, MASE, winkler, CRPS)
cov_tbl <- fc_beer |>
hilo(level = c(80, 95)) |>
unpack_hilo(c(`80%`, `95%`)) |>
left_join(beer |> rename(actual = Beer), by = "Quarter") |>
as_tibble() |>
group_by(.model) |>
summarise(
Cov80 = mean(actual >= `80%_lower` & actual <= `80%_upper`),
Cov95 = mean(actual >= `95%_lower` & actual <= `95%_upper`)
)
left_join(acc_tbl, cov_tbl, by = ".model") |>
arrange(CRPS) |>
fmt_tbl(digits = 2, caption = "Out-of-sample point, interval, and distributional accuracy on Beer (10-quarter holdout).")| .model | MAE | RMSE | MAPE | MASE | winkler | CRPS | Cov80 | Cov95 |
|---|---|---|---|---|---|---|---|---|
| TSLM | 7.27 | 10.27 | 1.78 | 0.51 | 52.58 | 5.86 | 0.9 | 1 |
| SARIMA | 10.39 | 11.23 | 2.47 | 0.73 | 51.63 | 6.54 | 0.9 | 1 |
| SNAIVE | 13.40 | 14.31 | 3.17 | 0.94 | 86.31 | 8.71 | 1.0 | 1 |
All three models beat the naive benchmark on MASE (except SNAIVE itself, near 1.0). Notice how evaluating multiple metrics sharpens interpretation: TSLM edges out SARIMA on MAE, RMSE, and CRPS over this short 10-quarter linear-trend window, whereas SARIMA achieves the lowest 95% Winkler score because its stochastic-trend intervals are well-calibrated without being overly wide.
Practice Exercises
Exercise 1. Evaluate SNAIVE, TSLM(Electricity ~ trend() + season()), and ARIMA(log(Electricity) ~ 0 + pdq(1,1,1) + PDQ(0,1,1)) on aus_production$Electricity from 1980 Q1 onward, holding out the last 10 quarters (2008 Q1 to 2010 Q2). Report MAE, RMSE, MASE, and CRPS, and interpret which model performs best.
Solution
elec <- aus_production |>
filter_index("1980 Q1" ~ .) |>
select(Quarter, Electricity)
elec_tr <- elec |> filter_index(. ~ "2007 Q4")
fit_el <- elec_tr |>
model(
SNAIVE = SNAIVE(Electricity),
TSLM = TSLM(Electricity ~ trend() + season()),
SARIMA = ARIMA(log(Electricity) ~ 0 + pdq(1, 1, 1) + PDQ(0, 1, 1))
)
fit_el |>
forecast(h = 10) |>
accuracy(elec, list(point_accuracy_measures, distribution_accuracy_measures)) |>
select(.model, MAE, RMSE, MASE, CRPS) |>
arrange(CRPS) |>
fmt_tbl(digits = 2)| .model | MAE | RMSE | MASE | CRPS |
|---|---|---|---|---|
| SARIMA | 1618 | 1886 | 1.25 | 1087 |
| SNAIVE | 2336 | 2502 | 1.81 | 1563 |
| TSLM | 2414 | 2733 | 1.87 | 1956 |
SARIMA on log(Electricity) dominates every metric (lowest MAE, RMSE, MASE, and CRPS), because Australian electricity demand exhibits growing multiplicative seasonality and a nonlinearly accelerating trend that linear TSLM and static SNAIVE miss.
Exercise 2. On the elec_tr training series above, fit two models with different seasonal differencing orders: D0 = ARIMA(Electricity ~ 1 + pdq(1,0,0) + PDQ(1,0,0)) and D1 = ARIMA(Electricity ~ 1 + pdq(1,0,0) + PDQ(0,1,1)). Inspect their log_lik, AICc, and effective sample sizes, and explain why comparing their AICc values is invalid.
Solution
elec_trap <- elec_tr |>
model(
D0 = ARIMA(Electricity ~ 1 + pdq(1, 0, 0) + PDQ(1, 0, 0)),
D1 = ARIMA(Electricity ~ 1 + pdq(1, 0, 0) + PDQ(0, 1, 1))
)
glance(elec_trap) |>
select(.model, sigma2, log_lik, AICc, BIC) |>
fmt_tbl(digits = 2)| .model | sigma2 | log_lik | AICc | BIC |
|---|---|---|---|---|
| D0 | 911663 | -931.8 | 1872 | 1882 |
| D1 | 551166 | -867.1 | 1743 | 1753 |
D1 shows an AICc roughly 129 points lower than D0 (1743 vs. 1872), but that gap is not a valid likelihood comparison: seasonal differencing drops the first \(m = 4\) observations (\(n\) falls from 112 to 108) and changes the modeled variable from \(y_t\) to \(y_t - y_{t-4}\). Removing 4 terms from a negative log-likelihood sum automatically lowers AICc regardless of true forecast quality. Always select \((d, D)\) via unit-root diagnostics or out-of-sample evaluation.
Key Takeaways
- AICc and BIC balance log-likelihood fit against parameter count \(k\); AICc corrects small-sample bias for predictive accuracy, while BIC favors sparser models.
- Three Incomparability Rules: never compare AIC, AICc, or BIC across different differencing orders \((d, D)\), different response transformations without Jacobian adjustment, or distinct model classes (such as ARIMA vs. ETS).
- Avoid MAPE when observations approach zero; use MASE for scale-free point comparisons across series.
- Pair point metrics (MAE, RMSE, MASE) with distributional scores (Winkler score, CRPS, and empirical coverage) so uncertainty calibration is tested alongside mean accuracy.