Teaching with GAUSS Time Series#
This page maps GAUSS Time Series functions to chapters in four textbooks commonly used in PhD econometrics and time series courses. Each exercise below includes runnable GAUSS code alongside the relevant textbook reference.
Hamilton (1994) — Time Series Analysis#
The standard reference for PhD time series econometrics. Covers ARMA, VAR, Kalman filter, spectral analysis, unit roots, cointegration, and regime switching.
Ch. |
Topic |
GAUSS function |
Exercise idea |
|---|---|---|---|
3-4 |
ARMA processes, forecasting |
Fit ARIMA to Nile river data. Compare auto-selected vs fixed order. |
|
5 |
Maximum likelihood estimation |
|
Compare CSS vs ML estimation on AirPassengers. Examine log-likelihood surface. |
11 |
Vector autoregressions |
Replicate a 3-variable monetary policy VAR. Select lag order by AIC/BIC. |
|
11.4 |
Granger causality |
Test whether FFR Granger-causes GDP in the monetary policy VAR. |
|
11.6 |
Impulse response functions |
Compute Cholesky IRFs. Discuss ordering sensitivity. |
|
11.7 |
VAR forecasting |
Compare frequentist vs Bayesian forecast intervals. |
|
12 |
Bayesian analysis |
Estimate Minnesota BVAR. Compare log marginal likelihood across priors. |
|
13 |
Kalman filter |
|
GAUSS ARIMA uses Kalman filter internally. Show equivalence with Hamilton Ch. 13 formulas. |
21 |
ARCH / heteroskedasticity |
Estimate SV-BVAR and show time-varying volatility captures ARCH effects. |
Lutkepohl (2005) — New Introduction to Multiple Time Series Analysis#
The definitive VAR reference. Covers estimation, specification, structural analysis, cointegration, and state-space models for multivariate systems.
Ch. |
Topic |
GAUSS function |
Exercise idea |
|---|---|---|---|
2.1 |
VAR(p) processes and stability |
Estimate VAR(4). Check companion eigenvalues for stationarity. |
|
2.3 |
Impulse responses and FEVD |
Compute IRFs at posterior mean. Verify FEVD rows sum to 1. |
|
2.3.4 |
Historical decomposition |
Decompose GDP into shock contributions. Verify reconstruction equals observed. |
|
3.2 |
OLS estimation |
Estimate VAR by OLS. Examine coefficient layout. Match Eq. 3.2.1. |
|
3.5 |
Forecasting from estimated VAR |
Generate h-step forecasts with MSE-based confidence intervals. |
|
3.6 |
Granger causality |
Test all pairwise Granger causality in a 3-variable system. |
|
4.3 |
Model selection criteria |
Compare AIC, BIC, HQ across lag orders 1-8. Discuss disagreements. |
|
5 |
Bayesian estimation |
Minnesota prior BVAR. Compare posterior with OLS to visualize shrinkage. |
|
9 |
Structural VARs |
Cholesky vs sign-restricted identification. Compare IRFs. |
Kilian & Lutkepohl (2017) — Structural Vector Autoregressive Analysis#
The modern SVAR textbook. Covers identification (short-run, long-run, sign restrictions), estimation, inference, and applications to oil markets and monetary policy.
Ch. |
Topic |
GAUSS function |
Exercise idea |
|---|---|---|---|
2 |
VAR models |
Estimate reduced-form VAR. Compare OLS and Bayesian. |
|
4 |
Structural VAR tools |
Full structural analysis pipeline: IRF → FEVD → HD. |
|
5 |
Bayesian VAR analysis |
Minnesota prior with GLP hyperparameter optimization. Compare marginal likelihoods. |
|
8 |
Short-run restrictions |
Cholesky (recursive) identification. Replicate Christiano, Eichenbaum & Evans (1999). |
|
10-11 |
Long-run restrictions |
(planned) |
Blanchard-Quah decomposition. Zero restrictions planned for future release. |
13 |
Sign restrictions |
Replicate Uhlig (2005) monetary policy identification. Examine acceptance rates. |
|
13.5 |
Sign-restricted FEVD |
Posterior FEVD bands under sign restrictions. |
|
16 |
Large BVARs |
Scale to 20 variables. Compare conjugate BVAR (3s) vs SV-BVAR (8s) on large system. |
Hyndman & Athanasopoulos (2021) — Forecasting: Principles and Practice (3rd ed.)#
The modern forecasting textbook. Free online at otexts.com/fpp3. Covers ARIMA, exponential smoothing, regression, decomposition, and forecast evaluation. Uses R in the text — the table below shows the GAUSS equivalents.
Ch. |
Topic |
GAUSS function |
R equivalent |
|---|---|---|---|
3 |
STL decomposition |
|
|
5.8 |
Forecast accuracy (RMSE, MASE) |
|
|
9 |
ARIMA models |
|
|
9.5 |
Auto ARIMA selection |
|
|
9.7 |
Seasonal ARIMA |
|
|
9.9 |
ARIMA forecasting |
|
|
10 |
Dynamic regression (ARIMAX) |
|
|
12.3 |
VAR models |
|
|
12.3 |
VAR forecasting |
|
Replication Exercises#
These self-contained exercises use shipped data or live FRED data and can be assigned as homework.
Exercise 1: The Box-Jenkins Airline Model (Hamilton Ch. 3-5, FPP3 Ch. 9)
This exercise fits SARIMA(0,1,1)(0,1,1)[12] to the AirPassengers data and forecasts 24 months ahead:
library timeseries;
fname = getGAUSSHome("pkgs/timeseries/examples/data/airline_passengers.csv");
y = loadd(fname, "passengers");
// arimaFit(y, p, d, q, sp, sd, sq, period)
result = arimaFit(y, p=0, d=1, q=1, sp=0, sd=1, sq=1, period=12);
fc = arimaForecast(result, 24);
Exercise 2: Monetary Policy VAR (Hamilton Ch. 11, Lutkepohl Ch. 2-4, K&L Ch. 8)
This exercise estimates a 3-variable VAR on GDP, CPI, and FFR, then computes and interprets IRFs:
library timeseries;
fname = getGAUSSHome("pkgs/timeseries/examples/data/us_macro_quarterly.csv");
data = loadd(fname);
result = varFit(data, p=4);
irf = irfCompute(result, 20);
fevd = fevdCompute(irf);
Exercise 3: Bayesian Shrinkage (Lutkepohl Ch. 5, K&L Ch. 5)
This exercise compares OLS and BVAR out-of-sample forecast accuracy using a train/test split:
library timeseries;
fname = getGAUSSHome("pkgs/timeseries/examples/data/us_macro_quarterly.csv");
data = loadd(fname);
// Split: first 160 obs for estimation, last 40 for evaluation
y_train = data[1:160, .];
y_test = asMatrix(data[161:200, .]);
// OLS forecast
rv = varFit(y_train, p=4, quiet=1);
fc_ols = varForecast(rv, 40);
// BVAR forecast
br = bvarFit(y_train, p=4, ar=0, quiet=1);
fc_bvar = bvarForecast(br, 40);
// Compare RMSE
{ rmse_ols, mase_ols, smape_ols } = fcMetrics(y_test, fc_ols.forecasts);
{ rmse_bvar, mase_bvar, smape_bvar } = fcMetrics(y_test, fc_bvar.forecasts);
print "RMSE OLS:" rmse_ols;
print "RMSE BVAR:" rmse_bvar;
Exercise 4: Kilian (2009) Oil Market SVAR (K&L Ch. 8, 13)
This exercise replicates the Kilian (2009) oil market structural analysis using live FRED data:
// See pkgs/timeseries/examples/fred_oil_market_svar.e for the complete script
Exercise 5: Model Comparison with Bayes Factors (K&L Ch. 5)
This exercise uses the log marginal likelihood to compare models with different hyperparameter settings:
library timeseries;
fname = getGAUSSHome("pkgs/timeseries/examples/data/us_macro_quarterly.csv");
data = loadd(fname);
// Optimize hyperparameters
ho = bvarHyperopt(data);
print "Optimal overall_tightness:" ho.overall_tightness;
print "Maximized log ML:" ho.log_ml;
// Compare with fixed hyperparameters
r_tight = bvarFit(data, overall_tightness=0.01, quiet=1);
r_loose = bvarFit(data, overall_tightness=1.0, quiet=1);
r_opt = bvarFit(data, ctl=ho.ctl);
print "Log ML (tight):" r_tight.log_ml;
print "Log ML (loose):" r_loose.log_ml;
print "Log ML (optimal):" r_opt.log_ml;
See also
Guides Getting Started, Choosing a VAR Model, GAUSS vs R vs BEAR: Side-by-Side