Time Series Analysis: Foundations, ARIMA, GARCH Volatility, and Machine Learning Validation
Time series analysis is the discipline of extracting meaningful statistics and predictive signals from chronologically ordered data. Unlike cross-sectional data, time series observations violate the foundational statistical assumption of independent and identically distributed () samples: observations close together in time are inherently correlated.
Whether predicting macroeconomic indicators, quantitative financial returns, or cloud infrastructure demand, mastering time series demands a systematic approach across three layers:
- →Data Preparation & Foundations (Stationarity, Autocorrelation, and Decomposition)
- →Classical Modeling (ARIMA, Diagnostics, and Information Criteria)
- →Advanced Volatility & Machine Learning (GARCH Modeling and Chronological Validation)
Part 1: Data Preparation & Foundations
1. Why must a time series be stationary before modeling?
The Core Reason: Most classical statistical and econometric forecasting models (such as AR, MA, and ARIMA) assume that the underlying generative process is invariant over time.
A time series is defined as strictly stationary if the joint distribution of is identical to for all time shifts . In practice, we evaluate weak (covariance) stationarity, which requires three conditions:
- →Constant Mean:
- →Constant, Finite Variance:
- →Lag-Dependent Autocovariance: , depending solely on the lag , not on the absolute time .
What happens if data is non-stationary? If a time series contains a trend or drifting variance, historical sample averages are completely unrepresentative of future expectations. Ordinary least squares (OLS) regression between two independent non-stationary series frequently yields high values and statistically significant -statistics purely due to shared temporal drift—a dangerous trap known as spurious regression.
How to achieve stationarity:
- →Differencing: removes linear polynomial trends.
- →Logarithmic Transformation: stabilizes exponential variance growth.
- →Log Returns: simultaneously stabilizes both trend and variance for financial asset prices.
- →Formal Testing: Check stationarity using the Augmented Dickey-Fuller (ADF) test (: Unit root present, non-stationary) and the KPSS test (: Trend stationary).
2. What is the difference between ACF and PACF plots, and how do you use them?
The Autocorrelation Function (ACF) and Partial Autocorrelation Function (PACF) are the foundational diagnostic plots used to identify the orders of autoregressive and moving average processes.
- →
ACF (Autocorrelation Function): Measures the linear correlation between and its lagged value , including both direct and indirect linear dependencies across all intervening time steps: Example: The correlation between Day 1 and Day 4 includes the direct effect of Day 1 on Day 4, plus the indirect effect of Day 1 impacting Day 2, which impacts Day 3, which in turn impacts Day 4.
- →Model Identification: The ACF cuts off sharply after lag for a pure Moving Average process .
- →
PACF (Partial Autocorrelation Function): Measures the correlation between and after removing the mutual linear influence of all intervening lags : It isolates the pure, direct relationship between observations separated by exactly periods.
- →Model Identification: The PACF cuts off sharply after lag for a pure Autoregressive process .
Quick Diagnostic Summary Table:
| Model | ACF Behavior | PACF Behavior |
|---|---|---|
| Tails off gradually (exponential decay or damped sine wave) | Cuts off abruptly after lag | |
| Cuts off abruptly after lag | Tails off gradually (exponential decay or damped sine wave) | |
| Tails off gradually after lag | Tails off gradually after lag |
3. How do you handle seasonality vs. trend?
Real-world series contain structural patterns that obscure underlying random processes:
- →Trend (): Long-term upward or downward movement in the series over extended horizons.
- →Seasonality (): Periodic fluctuations that repeat at fixed, known calendar intervals (e.g., retail spikes every December, electricity surges during summer afternoons).
- →Residual / Noise (): The stationary, unpredictable stochastic component left after isolating trend and seasonality.
Decomposition Architectures:
- →Additive Decomposition: Use when: The amplitude of seasonal swings remains constant regardless of the overall level of the series.
- →Multiplicative Decomposition: Use when: The magnitude of the seasonal variation scales proportionally with the trend (e.g., airline passenger counts growing 15% every summer as total base traffic doubles).
Modern decomposition methods like STL (Seasonal and Trend decomposition using Loess) offer robust handling of non-linear trends and evolving seasonal patterns over time.
Part 2: Classical Modeling (ARIMA & Friends)
1. What do the parameters in an model mean?
The Autoregressive Integrated Moving Average model, denoted , is the workhorse of linear time series forecasting:
Where is the lag operator () and is white noise error.
- → (Autoregressive Order): The number of lagged observations of the dependent variable included in the regression equation. An model regresses current values on its own immediate past values:
- → (Degree of Differencing): The number of times the raw series must be differenced to eliminate stochastic trends and achieve covariance stationarity. If , the model operates on first differences ; if , it operates on second differences .
- → (Moving Average Order): The size of the moving window applied to historical forecast shocks. An model expresses the current observation as a linear combination of the current shock and the past random error terms:
2. How do AIC and BIC help in time series model selection?
When selecting parameters , there is an inherent trade-off between maximizing fit and avoiding overparameterization. Estimating too many coefficients causes overfitting, capturing in-sample noise rather than generalizable signals.
Both the Akaike Information Criterion (AIC) and Bayesian Information Criterion (BIC) balance goodness of fit against complexity:
Where:
- → is the maximized likelihood of the fitted model.
- → is the number of estimated parameters ().
- → is the total number of observations.
How to use AIC and BIC:
- →Candidate models are ranked; the model with the lowest score is optimal.
- →Penalty Comparison: For any sample size , . Consequently, BIC penalizes model complexity substantially more severely than AIC.
- →Rule of Thumb:
- →Use AIC when the primary objective is out-of-sample predictive performance.
- →Use BIC when the goal is consistent structural identification of the true underlying parsimonious model.
Part 3: Advanced Volatility & Machine Learning
1. When should you use a GARCH model instead of an ARIMA model?
Standard ARIMA models assume homoskedasticity: the error variance is assumed to be constant across all time periods:
In quantitative financial assets (equities, foreign exchange, commodities), this assumption fails dramatically due to volatility clustering:
"Large changes tend to be followed by large changes, of either sign, and small changes tend to be followed by small changes." — Benoit Mandelbrot
- →Use ARIMA when: Modeling and forecasting the conditional mean (predicting price trajectories or inventory levels).
- →Use GARCH when: The conditional mean is close to zero or unpredictable, but the conditional variance changes dynamically over time.
The Specification:
Let return residuals be , where . The conditional variance evolves as:
Where:
- → is the baseline variance.
- → (ARCH term): Measures the immediate reaction to market shocks.
- → (GARCH term): Measures volatility persistence.
- →Stability requirement: . If , volatility shocks persist for long horizons (Integrated GARCH).
GARCH models are essential for Value-at-Risk (VaR) calculations, option pricing volatility surfaces, and dynamic risk management.
2. Why can't you use standard K-Fold Cross-Validation for time series?
In classical cross-sectional machine learning, data points are assumed to be independent. Standard -fold cross-validation randomly shuffles observations into subsets, training on folds and validating on the remaining fold.
Why this breaks time series:
- →Temporal Leakage (Lookahead Bias): Random partitioning places future observations in the training set while evaluating on past observations. The model learns patterns informed by future information, generating artificially optimistic validation scores that collapse in production.
- →Autocorrelation Disruption: Randomly dropping observations breaks the autocorrelation structure and creates artificial discontinuities in lag structures.
The Correct Method: Time Series Split (Rolling Forecast Origin)
To validate time series models without leakage, use Forward-Chaining (Walk-Forward Validation):
Fold 1: [ Train: t_1 ... t_k ] -> [ Test: t_{k+1} ]
Fold 2: [ Train: t_1 ... t_{k+1} ] -> [ Test: t_{k+2} ]
Fold 3: [ Train: t_1 ... t_{k+2} ] -> [ Test: t_{k+3} ]
Fold 4: [ Train: t_1 ... t_{k+3} ] -> [ Test: t_{k+4} ]
- →Expanding Window: The training set grows chronologically, incorporating each new validated point into historical context.
- →Rolling Window: If the data generating process exhibits regime shifts, maintain a fixed training window length while sliding forward.
Practitioner Summary
- →Never fit ARIMA on non-stationary data: Apply differencing or log-returns; verify with ADF and KPSS tests.
- →Inspect ACF/PACF systematically: Identify MA cutoffs in ACF and AR cutoffs in PACF.
- →Balance fit with parsimony: Use AIC/BIC grids to prevent overparameterization.
- →Separate mean from volatility: Use ARIMA for conditional mean; use GARCH for clustering conditional variance.
- →Respect chronology in ML: Always employ temporal walk-forward splits to prevent lookahead bias.
Institutional Proof
Dive deeper into Time Series Analysis
See the complete formal proof, animated visual derivations, and the full architectural breakdown in the library.
Enter the Library →The Journal
Subscribe for bi-weekly deep dives into abstract mathematics and statistical inference.