Econometrics Toolbox: Worked examples

In-depth macroeconomic and financial walkthroughs of all six included models, covering economic intuition, mathematical formulations, Excel inputs, expected outputs, and interpretation.

← Overview · Getting started · Modeling guide · Methods guide · Examples · Reference

1. US Real GDP Growth — ARIMA(1,0,1)

Economic motivation & context

Gross Domestic Product (GDP) annualized quarterly growth measures the headline pace of macroeconomic expansion. Real GDP growth rates exhibit cyclical persistence (expansionary and contractionary momentum) alongside transient shocks (such as supply chain disruptions or fiscal stimulus expiration). A mixed autoregressive moving-average specification, \(\text{ARIMA}(1,0,1)\), captures both persistent inertia and the damping of one-off quarterly innovations without requiring difference filtering.

Mathematical formulation

\[(1 - \phi_1 L)(Y_t - \mu) = (1 + \theta_1 L) \varepsilon_t\]

Expanded:

\[Y_t = c + \phi_1 Y_{t-1} + \varepsilon_t + \theta_1 \varepsilon_{t-1}\]

where \(Y_t\) is the annualized real GDP growth rate (%), \(c = \mu (1 - \phi_1)\) is the constant drift, \(\phi_1\) is the autoregressive lag coefficient, \(\theta_1\) is the moving average shock coefficient, and \(\varepsilon_t \sim \mathcal{N}(0, \sigma^2)\).

Excel inputs

  • Start sheet:
    • Active model: us_gdp_growth
    • Forecast horizon: 4
    • Confidence level: 0.95
    • Frequency: Quarterly
  • Time Series Data sheet:
    • 28 quarterly observations spanning 2018-Q1 to 2024-Q4 in Series1.
    • Values include the pandemic shock of 2020-Q2 (\(-28.0\%\)) and the subsequent recovery of 2020-Q3 (\(+34.8\%\)).
  • Specification sheet:
    • p = 1, d = 0, q = 1.

Expected outputs & metrics

  • Status: OPTIMAL
  • Sample Periods: 28
  • Information Criteria:
    • Log-Likelihood: -95.9986
    • AIC: 199.9972
    • BIC: 205.3260
    • HQIC: 201.6263
  • Parameter Estimates:
    • const: 2.8336 (\(SE = 1.3508\), \(z = 2.0977\), \(p = 0.0359\))
    • ar.L1: 0.3702
    • ma.L1: -0.1554
    • sigma2: 49.5213
  • Forecasts (95% CI):
    • Step 1 (2025-Q1): Point: 2.8999, Lower: -11.2803, Upper: 17.0801, SE: 7.2349
    • Step 4 (2025-Q4): Point: 2.8351, Lower: -11.4628, Upper: 17.1331, SE: 7.2950
  • Diagnostics:
    • ADF test: \(p = 0.0071\) (PASS — stationary)
    • KPSS test: \(p = 0.1000\) (PASS — stationary)
    • Ljung-Box \(Q\): \(p = 0.8412\) (PASS — no autocorrelation)
    • Jarque-Bera: \(p = 0.1420\) (PASS — normal residuals)

Economic interpretation

The estimated unconditional mean annualized growth rate is approximately 2.83%, reflecting the long-run non-inflationary potential growth rate of the US economy. The positive autoregressive coefficient (\(\phi_1 \approx 0.37\)) confirms moderate expansionary inertia from one quarter to the next, while the moving average term (\(\theta_1 \approx -0.16\)) captures rapid absorption of transient macroeconomic shocks. Out-of-sample forecasts steadily mean-revert toward 2.83%.


2. Consumer Price Inflation — ARMA(1,0,0)

Economic motivation & context

Consumer Price Index (CPI) year-over-year inflation reflects persistent nominal pressure throughout supply chains, wage settlements, and monetary policy conditions. When central banks target an inflation anchor (e.g. 2%), inflation exhibits strong autoregressive memory: an inflation reading of 6% does not instantly collapse to 2% the following month. An \(\text{AR}(1)\) model tests whether post-pandemic inflation exhibits stationary mean reversion or persistent inertia.

Mathematical formulation

\[(1 - \phi_1 L)(Y_t - \mu) = \varepsilon_t \iff Y_t = c + \phi_1 Y_{t-1} + \varepsilon_t\]

where \(Y_t\) is the monthly headline CPI percentage rate (year-over-year), \(\phi_1\) measures inflation persistence (\(|\phi_1| < 1\) guarantees stationarity), and \(\mu = c / (1 - \phi_1)\) is the long-run inflation anchor.

Excel inputs

  • Start sheet:
    • Active model: cpi_inflation_arma
    • Forecast horizon: 4
    • Confidence level: 0.95
    • Frequency: Monthly
  • Time Series Data sheet:
    • 24 monthly observations spanning 2023-M01 (6.4%) through 2024-M12 (2.9%) in Series1.
  • Specification sheet:
    • p = 1, d = 0, q = 0.

Expected outputs & metrics

  • Status: OPTIMAL
  • Sample Periods: 24
  • Information Criteria:
    • Log-Likelihood: -14.7722
    • AIC: 35.5444
    • BIC: 39.0786
    • HQIC: 36.4821
  • Fitted Coefficients:
    • const: 3.5350
    • ar.L1: 0.9617 (\(SE = 0.0524\), \(z = 18.35\), \(p < 0.0001\), ***)
    • sigma2: 0.2031
  • Forecasts:
    • Step 1 (2025-M01): Point: 2.9244, Lower: 2.0411, Upper: 3.8077
    • Step 4 (2025-M04): Point: 2.9926, Lower: 1.8152, Upper: 4.1700

Economic interpretation

The autoregressive coefficient \(\phi_1 = 0.9617\) is statistically indistinguishable from a near-unit-root process (\(p < 0.001\)), providing strong empirical evidence of inflation stickiness. Month-over-month inflation disinflates slowly, requiring sustained monetary tightening to return to target. Out-of-sample projections forecast monthly CPI hovering near 2.9% to 3.0% over the near-term horizon.


3. Retail Sales with Consumer Sentiment — SARIMAX(1,1,1)x(0,1,1,4)

Economic motivation & context

Retail trade exhibits two pronounced statistical characteristics: strong quarterly seasonality (surging in Q4 due to holiday spending and contracting in Q1) and sensitivity to leading consumer sentiment. Fitting an ordinary linear model generates seasonal bias. A Seasonal Autoregressive Integrated Moving Average with Exogenous Regressors (\(\text{SARIMAX}\)) models seasonal differencing (\(\Delta_4\)) while simultaneously estimating the elasticity of retail volume with respect to the University of Michigan Consumer Sentiment Index.

Mathematical formulation

\[(1 - \phi_1 L)(1 - L)(1 - L^4) (Y_t - \beta X_t) = (1 + \theta_1 L)(1 + \Theta_1 L^4) \varepsilon_t\]

where \(Y_t\) is quarterly retail sales volume (\(Series1\)), \(X_t\) is the consumer sentiment index (\(Series2\)), \(\beta\) is the exogenous response coefficient, \((1-L)\) removes the stochastic trend, and \((1-L^4)\) removes quarterly seasonality.

Excel inputs

  • Start sheet:
    • Active model: retail_sales_sarimax
    • Forecast horizon: 4
    • Frequency: Quarterly
  • Time Series Data sheet:
    • 28 quarterly observations (2018-Q1 to 2024-Q4).
    • Series1: Retail sales index (\(95.2\) to \(141.8\)).
    • Series2: Consumer sentiment index (\(98.5\) down to \(50.0\) in 2022, rebounding to \(74.0\)).
  • Specification sheet:
    • p = 1, d = 1, q = 1, P = 0, D = 1, Q = 1, s = 4.

Expected outputs & metrics

  • Status: OPTIMAL
  • Information Criteria:
    • AIC: 90.2791
    • BIC: 94.4452
  • Fitted Coefficients:
    • Series2 (Sentiment \(\beta\)): Positive, statistically significant coefficient indicating higher sentiment bolsters discretionary purchasing.
    • ar.L1, ma.L1, ma.S.L4: Significant seasonal MA parameter absorbing regular Q4 holiday volume spikes.
  • Forecasts:
    • Step 1 (2025-Q1): Point: 136.6552
    • The forecast preserves the post-holiday Q1 seasonal dip while tracking the trend established by consumer sentiment.

Economic interpretation

Modeling retail sales without seasonal differencing causes severe residual autocorrelation (\(Q < 0.001\)). By introducing \((D=1, s=4)\) seasonal integration, the model eliminates seasonal spikes from the error term, allowing the analyst to measure the true exogenous effect of consumer confidence.


4. Treasury Yield Curve — VAR(1)

Economic motivation & context

The term structure of interest rates reflects the joint interaction between the Federal Reserve’s short-term policy rate (3-month Treasury bill) and the bond market’s long-term growth and inflation expectations (10-year Treasury note). Rather than assuming long yields depend on short yields unidirectionally, a Vector Autoregression (\(\text{VAR}\)) models both interest rates as endogenous variables that dynamically influence each other over time.

Mathematical formulation

\[\begin{bmatrix} r_{3m, t} \\ y_{10y, t} \end{bmatrix} = \begin{bmatrix} c_1 \\ c_2 \end{bmatrix} + \begin{bmatrix} a_{11} & a_{12} \\ a_{21} & a_{22} \end{bmatrix} \begin{bmatrix} r_{3m, t-1} \\ y_{10y, t-1} \end{bmatrix} + \begin{bmatrix} u_{1,t} \\ u_{2,t} \end{bmatrix}\]

Excel inputs

  • Start sheet:
    • Active model: treasury_rates_var
    • Forecast horizon: 4
    • Frequency: Quarterly
  • Time Series Data sheet:
    • 28 quarterly periods (2018-Q1 to 2024-Q4).
    • Series1: Short rate (3-month yield, ranging from 0.04% to 5.45%).
    • Series2: Long rate (10-year yield, ranging from 0.65% to 4.59%).
  • Specification sheet:
    • lags = 1.

Expected outputs & metrics

  • Status: OPTIMAL
  • Information Criteria:
    • AIC: -3.2842
    • BIC: -2.9963
    • HQIC: -3.1986
  • ShortRate Equation:
    • ShortRate: const: -0.714262 (\(p < 0.05\))
    • ShortRate: L1.ShortRate: 0.615835 (\(p < 0.001\))
    • ShortRate: L1.LongRate: 0.407183 (\(p < 0.05\))
  • LongRate Equation:
    • LongRate: const: 0.421915
    • LongRate: L1.ShortRate: 0.089124
    • LongRate: L1.LongRate: 0.781290
  • Granger Causality:
    • \(F\)-test on LongRate -> ShortRate: \(p < 0.05\), confirming that bond market yield movements precede central bank policy rate adjustments.

Economic interpretation

The VAR estimates confirm the Expectation Hypothesis of the term structure: long-term yields have strong forward-looking predictive power for future policy rates (\(a_{12} > 0\), Granger causality \(p < 0.05\)), while short rates adjust with gradual monetary policy inertia (\(a_{11} \approx 0.62\)).


5. Consumption & Disposable Income — Cointegration & ECM

Economic motivation & context

According to Milton Friedman’s Permanent Income Hypothesis and John Maynard Keynes’ consumption function, Real Personal Consumption Expenditures (\(C_t\)) and Real Disposable Personal Income (\(Y_t\)) both exhibit non-stationary, upward-trending growth paths (\(I(1)\)). Running ordinary regression on non-stationary variables generates spurious correlation (\(R^2 \approx 0.99\) despite invalid \(t\)-statistics). However, economic theory dictates that consumption and income share a stable long-run equilibrium: households cannot consume more than their income indefinitely. An Engle-Granger Error Correction Model (\(\text{ECM}\)) captures both the long-run cointegrating relationship and the dynamic short-run error-correction speed.

Mathematical formulation

Long-run Cointegrating Equation (Static OLS):

\[C_t = \beta_0 + \beta_1 Y_t + e_t\]

Short-run Dynamic Error Correction Equation:

\[\Delta C_t = c_0 + \alpha \hat{e}_{t-1} + \theta \Delta Y_t + \varepsilon_t\]

where \(\hat{e}_{t-1} = C_{t-1} - \hat{\beta}_0 - \hat{\beta}_1 Y_{t-1}\) is the lagged error correction term and \(\alpha\) is the adjustment velocity.

Excel inputs

  • Start sheet:
    • Active model: consumption_income_coint
    • Forecast horizon: 4
    • Frequency: Quarterly
  • Time Series Data sheet:
    • 28 quarterly observations of US Real Consumption (Series1, billions of USD) and US Real Disposable Income (Series2, billions of USD).
  • Specification sheet:
    • lags = 1.

Expected outputs & metrics

  • Status: OPTIMAL
  • Long-Run Cointegrating Vector:
    • Coint: const: 1292.4046
    • Coint: Beta (Income): 0.843974 (\(SE = 0.0152\), \(t = 55.43\), \(p < 0.0001\))
  • Short-Run Dynamic ECM:
    • ECM: const: 7.1245
    • ECM: ECT_lag1: -0.805109 (\(t = -3.89\), \(p = 0.0007\))
    • ECM: d(Income): 0.4128
  • Diagnostics:
    • ADF on raw levels shows WARN (unit root detected, confirming both series are \(I(1)\)).
    • Engle-Granger test on residuals confirms stationarity (\(p < 0.01\)), establishing valid cointegration.

Economic interpretation

The cointegrating beta of 0.8440 indicates that the long-run Marginal Propensity to Consume (MPC) is 84.4 cents of every real disposable income dollar. The adjustment parameter \(\alpha = -0.8051\) is negative and highly significant: whenever consumption exceeds income, households correct approximately 80.5% of the disequilibrium within the very next quarter, proving that consumer spending is anchored to household earning capacity.


6. Macro Stationarity & Unit Root Workbench

Economic motivation & context

Applying standard regression or ARMA models to non-stationary data leads to spurious statistical inference: \(t\)-statistics diverge, standard errors are underestimated, and projections diverge. Econometricians must verify whether a series is stationary (\(I(0)\)) or integrated (\(I(1)\)). This workbench evaluates two parallel series: Series1 represents a non-stationary macroeconomic price level index, while Series2 represents its stationary first difference (growth rate).

Mathematical formulation

Dickey-Fuller Test Equation:

\[\Delta Y_t = \alpha + \gamma Y_{t-1} + \sum_{j=1}^k \delta_j \Delta Y_{t-j} + \varepsilon_t\]

KPSS Test Decomposition:

\[Y_t = r_t + \varepsilon_t, \quad r_t = r_{t-1} + u_t, \quad u_t \sim \mathcal{N}(0, \sigma_u^2)\]

Excel inputs

  • Start sheet:
    • Active model: macro_stationarity
    • Forecast horizon: 4
    • Frequency: Quarterly
  • Time Series Data sheet:
    • 28 quarterly observations.
    • Series1: Price level index drifting upwards from 101.04 to 152.04.
    • Series2: Quarterly percentage growth rate fluctuating between 0.09% and 2.74%.
  • Specification sheet:
    • maxlag = 4.

Expected outputs & metrics

  • Status: NON_STATIONARY
  • ADF Unit Root Test Evidence:
    • Series1 Level: \(\tau = 0.2089\) (\(p = 0.9728\)). Fails to reject unit root \(\implies\) Non-stationary.
    • Series2 Diff: \(\tau = -5.1731\) (\(p = 0.0000\)). Rejects unit root at 99.9% confidence \(\implies\) Stationary.
  • KPSS Stationarity Test Evidence:
    • Series1 Level: Statistic exceeds critical value (\(p < 0.05\)). Rejects stationarity \(\implies\) Non-stationary.
    • Series2 Diff: Fails to reject stationarity (\(p \ge 0.05\)) \(\implies\) Stationary.
  • Diagnostics Sheet Detail:
    • Series1 Level: stat=0.2089 (p=0.9728, unit root). Series2 Diff: stat=-5.1731 (p=0.0000, stationary).

Economic interpretation

The dual testing methodology resolves the classical stationarity dilemma: 1. Series1 has an ADF \(p\)-value near 1.0 and a rejecting KPSS statistic, confirming the presence of a stochastic trend (unit root). Estimating models directly on Series1 without differencing produces misleading results. 2. Series2 (the differenced series) has an ADF \(p\)-value of 0.0000 and a passing KPSS statistic, confirming that first-order differencing (\(\Delta Y_t\)) successfully renders the series stationary, satisfying all conditions for stationary time series forecasting.