In ordinary regression or ARIMA models, we assume that the variance of the errors is constant:
\[u_t \sim N (0, \sigma^2)\]
That’s called homoskedasticity. But in real-world financial or economic data (returns, inflation, exchange rates, etc.), you often see volatility clustering — periods of calm and periods of turbulence.
Example:
When markets are stable → small changes day after day
When crises hit → large swings for many days
So the variance (volatility) is changing over time. That’s called heteroskedasticity.
From ARIMA to ARCH
Engle (1982) introduced the ARCH model (Autoregressive Conditional Heteroskedasticity).
Idea: Let’s model the variance itself as something that depends on past squared shocks.
This Week’s Discussion: Chapters 11 and 12 of Forecasting: Principles and Practice (3rd ed.) and Chapter 16.4 of Econometrics with R
This week’s discussion focuses on hierarchical and grouped time series forecasting as well as modeling volatility clustering with ARCH and GARCH. These topics equip you with advanced tools for working with structured data and financial or economic series that exhibit time-varying variance.
Required Readings:
Hyndman and Athanasopoulos, Forecasting: Principles and Practice (3rd ed.), Chapters 11 and 12
Part 3: Volatility Modeling with ARCH and GARCH (Required)
Exploring Volatility Clustering:
Read Chapter 16.4 of Econometrics with R for an introduction to volatility clustering and the motivation behind ARCH and GARCH models.
Select or simulate a time series where you suspect time-varying volatility, such as financial returns, commodity prices, or any series with fluctuating variance.
I select MSFT monthly returns and fit a GARCH model from fGarch library.
# Plot closing prices over timeggplot(df_ts, aes(x =date, y =pct_change))+geom_line(color ="blue")+labs( title ="MSFT Daily Price Pct Change Over Time", x ="Date", y ="Closing Price (USD)")+theme_minimal()
Warning: Removed 1 row containing missing values or values outside the scale range
(`geom_line()`).
# Convert to monthly and calculate % changedf_monthly<-df_ts%>%group_by(year_month =floor_date(x =date, unit ="month"))%>%summarise(close =last(close), .groups ="drop")%>%mutate( pct_change =(close-lag(close))/lag(close)*100)%>%filter(!is.na(pct_change))# Plot closing prices over timeggplot(df_monthly, aes(x =year_month, y =pct_change))+geom_line(color ="blue")+labs( title ="MSFT Monthly Price Pct Change Over Time", x ="Date", y ="Closing Price (USD)")
Modeling Conditional Variance:
Fit an ARCH or GARCH model to your series using R (for example, the rugarch package).
Plot the estimated conditional variance and compare it to the unconditional variance from simpler models.
Interpret the significance of the parameters and how volatility evolves over time.
# plot sample autocorrelation of daily percentage changesacf(df_monthly$pct_change, main ="ACF")
NOTE: Packages 'fBasics', 'timeDate', and 'timeSeries' are no longer
attached to the search() path when 'fGarch' is attached.
If needed attach them yourself in your R script by e.g.,
require("timeSeries")
Attaching package: 'fGarch'
The following objects are masked from 'package:PerformanceAnalytics':
ES, VaR
The following object is masked from 'package:TTR':
volatility
??garchFit# estimate GARCH(1,1) model of daily percentage changesGARCH_MSFT<-garchFit(data =df_monthly$pct_change, trace =F)summary(GARCH_MSFT)
Title:
GARCH Modelling
Call:
garchFit(data = df_monthly$pct_change, trace = F)
Mean and Variance Equation:
data ~ garch(1, 1)
<environment: 0x12f42d430>
[data = df_monthly$pct_change]
Conditional Distribution:
norm
Coefficient(s):
mu omega alpha1 beta1
1.950128 2.857909 0.091861 0.864112
Std. Errors:
based on Hessian
Error Analysis:
Estimate Std. Error t value Pr(>|t|)
mu 1.95013 0.35279 5.528 3.24e-08 ***
omega 2.85791 1.24092 2.303 0.021275 *
alpha1 0.09186 0.02691 3.413 0.000642 ***
beta1 0.86411 0.03597 24.026 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Log Likelihood:
-1497.589 normalized: -3.482765
Description:
Thu Nov 6 17:49:31 2025 by user:
Standardised Residuals Tests:
Statistic p-Value
Jarque-Bera Test R Chi^2 33.6461530 4.941180e-08
Shapiro-Wilk Test R W 0.9833267 7.443937e-05
Ljung-Box Test R Q(10) 11.3157521 3.334529e-01
Ljung-Box Test R Q(15) 14.0746309 5.198766e-01
Ljung-Box Test R Q(20) 16.7351966 6.700954e-01
Ljung-Box Test R^2 Q(10) 8.2253855 6.068320e-01
Ljung-Box Test R^2 Q(15) 10.6071164 7.799156e-01
Ljung-Box Test R^2 Q(20) 16.5552186 6.816374e-01
LM Arch Test R TR^2 11.6309782 4.757525e-01
Information Criterion Statistics:
AIC BIC SIC HQIC
6.984135 7.021938 6.983965 6.999063
\(\omega\) = 2.91377: Long-run average variance (baseline risk level).
\(\alpha\) = 0.09266: Impact of the most recent shock. A large \(\epsilon_{t-1}^2\) will increase \(\sigma_t^2\) in the next period.
\(\beta_1\) = 0.86307: Persistence of volatility from the previous period. A high value indicates slow decay of volatility after shocks.
This formulation allows the volatility to change over time, capturing periods of high and low market turbulence.
The persistence parameter:
\[
\alpha_1 + \beta_1 = 0.95573
\]
is close to 1, indicating high volatility persistence — shocks to volatility tend to last for a long time.
# compute deviations of the percentage changes from their meandev_mean_MSFT<-df_monthly$pct_change-GARCH_MSFT@fit$coef[1]# plot deviation of percentage changes from meanplot(x =df_monthly$year_month, y =dev_mean_MSFT, type ="l", col ="steelblue", ylab ="Percent", xlab ="Date", main ="Estimated Bands of +- One Conditional Standard Deviation", cex.main=0.8, lwd =0.2)# add horizontal line at y = 0abline(0, 0)# add GARCH(1,1) confidence bands (one standard deviation) to the plotlines(x =df_monthly$year_month, GARCH_MSFT@fit$coef[1]+GARCH_MSFT@sigma.t, col ="darkred", lwd =0.5)lines(x =df_monthly$year_month, GARCH_MSFT@fit$coef[1]-GARCH_MSFT@sigma.t, , col ="darkred", lwd =0.5)
The light blue line appears to be the actual returns or residuals from a financial time series (likely % deviations from a mean).
The two red lines represent the estimated bands of ± 1 conditional standard deviation from a volatility model (likely a GARCH-type model).
Conditional variance changes over time based on recent information. In GARCH models, this means periods of high volatility widen the bands, while quiet periods narrow them.
Unconditional variance assumes volatility is constant over time — from a simple model like historical variance. This would be a flat horizontal band (same width everywhere).
Comparison:
If you plotted the unconditional variance, it would likely underestimate volatility during high-stress periods (e.g., late 1990s, 2008) and overestimate during calm periods.
The GARCH conditional variance adapts to spikes in volatility and periods of calm, making it better for risk estimation.
Discussion Questions:
In your dataset, how did the ARCH/GARCH model improve the understanding of volatility compared to traditional constant-variance models?
How would you incorporate volatility modeling into forecasting workflows alongside ETS or ARIMA models?
How ARCH/GARCH Improved Understanding of Volatility
The GARCH(1,1) model:
Captured volatility clustering
The plot shows that conditional standard deviation bands widen during turbulent market periods (e.g., dot-com bubble, 2008 financial crisis, COVID-19 shock) and narrow during calm periods.
A constant-variance model would have used one average variance level for all periods, missing this dynamic.
Quantified persistence of volatility
α₁ (0.09266) → About 9% of last period’s shock size carries into today’s volatility.
β₁ (0.86307) → About 86% of yesterday’s volatility persists today.
Feel free to ask questions if you need help installing packages or interpreting output.
Appendix
Week 6 Discussion, Hierarchical / VAR+VEC / GARCH
This Week’s Discussion: Chapters 11 and 12 of Forecasting: Principles and Practice (3rd ed.) and Chapter 16.4 of Econometrics with R
This week’s discussion focuses on hierarchical and grouped time series forecasting as well as modeling volatility clustering with ARCH and GARCH. These topics equip you with advanced tools for working with structured data and financial or economic series that exhibit time-varying variance.
Required Readings:
Hyndman and Athanasopoulos, Forecasting: Principles and Practice (3rd ed.), Chapters 11 and 12
Select a hierarchical dataset from the fpp3 package (e.g., tourism, PBS, or aus_livestock).
Visualize the hierarchy or grouping structure, highlighting different levels (e.g., region, state, or product).
Modeling and Forecasting Hierarchical Data:
Apply bottom-up, top-down, and middle-out approaches to forecast data at different hierarchical levels.
Compare the forecasts produced by each approach.
Evaluate forecast accuracy at each level using RMSE and MAPE.
Discussing Reconciliation Techniques:
Test forecast reconciliation methods, such as OLS reconciliation and MinT reconciliation, to ensure forecasts at different levels are consistent.
Explain how these methods balance accuracy and coherence across hierarchical levels.
Part 2: Grouped Time Series Forecasting
Exploring Grouped Data Structures:
Choose a grouped time series dataset from fpp3 (e.g., aus_retail or insurance) that can be grouped along multiple dimensions, such as location and product type.
Create visualizations to highlight different group structures in the data.
Modeling and Forecasting Grouped Data:
Fit models for each group using ETS, ARIMA, or dynamic regression methods.
Reconcile the forecasts using grouping strategies and evaluate their performance across groups.
Imagine you are forecasting product sales across different regions. Discuss how forecasts for one region might influence others and how reconciliation methods can improve reliability when multiple categories are involved.
Part 3: Volatility Modeling with ARCH and GARCH (Required)
Exploring Volatility Clustering:
Read Chapter 16.4 of Econometrics with R for an introduction to volatility clustering and the motivation behind ARCH and GARCH models.
Select or simulate a time series where you suspect time-varying volatility, such as financial returns, commodity prices, or any series with fluctuating variance.
Modeling Conditional Variance:
Fit an ARCH or GARCH model to your series using R (for example, the rugarch package).
Plot the estimated conditional variance and compare it to the unconditional variance from simpler models.
Interpret the significance of the parameters and how volatility evolves over time.
Discussion Questions:
In your dataset, how did the ARCH/GARCH model improve the understanding of volatility compared to traditional constant-variance models?
How would you incorporate volatility modeling into forecasting workflows alongside ETS or ARIMA models?
Response Guidelines
Initial Post:
Share your results, including R code, visualizations, and interpretations.
Highlight differences between hierarchical, grouped, and volatility modeling approaches.
Discuss how reconciliation and volatility modeling improved forecast reliability and risk assessment.
Peer Responses:
Engage with at least two classmates by comparing their modeling approaches and parameter choices.
Suggest enhancements or alternative ways to reconcile forecasts or model conditional variance.
Reflection Question:
Which forecasting approach—hierarchical, grouped, or volatility modeling—was most effective for your dataset, and why?
Tip for Students:
If you haven’t used GARCH models before, here’s an example using the rugarch package: