1. Introduction to Time Series Analysis
Time series analysis comprises methods for analyzing time-ordered data to extract meaningful statistics and identify characteristics of the data. A time series is a sequence of observations recorded at successive points in time, typically at uniform intervals.
Formally, a time series is a realization of a stochastic process {Yt: t ∈ T} where T is the index set representing time. Time series analysis aims to:
- Description: Characterize properties of the series
- Explanation: Use variation in one series to explain variation in another
- Prediction: Forecast future values
- Control: Understand and manipulate the generating process
2. Time Series Components
The classical decomposition model represents a time series as a combination of systematic components:
Tt = Trend (long-term movement)
St = Seasonal (regular periodic fluctuations)
Ct = Cyclical (irregular periodic fluctuations)
It = Irregular/Random (unpredictable fluctuations)
Trend Component
The trend represents the long-term progression of the series. It can be linear, polynomial, exponential, or follow other functional forms. Trend can be extracted using moving averages, regression, or filtering methods.
Seasonal Component
Seasonality refers to regular, predictable patterns that repeat over fixed periods (daily, weekly, monthly, quarterly, annually). The seasonal period s is the number of observations per cycle.
3. Stationarity
Stationarity is a fundamental concept in time series analysis. A stationary process has statistical properties that do not change over time.
Strict Stationarity
A process is strictly stationary if the joint distribution of (Yt1, ..., Ytk) is identical to that of (Yt1+h, ..., Ytk+h) for all t, k, and h.
Weak (Covariance) Stationarity
A process is weakly stationary if:
- E[Yt] = μ (constant mean)
- Var(Yt) = σ2 < ∞ (constant, finite variance)
- Cov(Yt, Yt+h) = γ(h) (autocovariance depends only on lag h)
Testing for Stationarity
- Augmented Dickey-Fuller (ADF) test: Tests for unit root (non-stationarity)
- KPSS test: Tests null hypothesis of stationarity
- Phillips-Perron test: Non-parametric unit root test
Differencing to Achieve Stationarity
Non-stationary series can often be made stationary through differencing:
d-th difference: ∇dYt = (1 - B)dYt
4. Time Series Decomposition
Classical Decomposition
The classical method uses moving averages to estimate trend, then extracts seasonal indices:
- Estimate trend using centered moving average of order s
- De-trend: Compute Yt - Tt (additive) or Yt/Tt (multiplicative)
- Average de-trended values by season to get seasonal indices
- Normalize seasonal indices
- Remainder = Original - Trend - Seasonal
STL Decomposition
Seasonal and Trend decomposition using Loess (STL) is a robust method that:
- Uses locally weighted regression (loess) for smoothing
- Handles any type of seasonality
- Is robust to outliers
- Allows seasonal component to change over time
5. Exponential Smoothing Methods
Simple Exponential Smoothing (SES)
For series with no trend or seasonality:
Holt's Linear Method
Extends SES to capture linear trend:
Trend: bt = β(lt - lt-1) + (1 - β)bt-1
Forecast: Ft+h = lt + hbt
Holt-Winters Method
Extends Holt's method to include seasonality:
Trend: bt = β(lt - lt-1) + (1 - β)bt-1
Seasonal: st = γ(Yt - lt) + (1 - γ)st-m
Forecast: Ft+h = lt + hbt + st+h-m
7. Autoregressive (AR) Models
An AR(p) model expresses the current value as a linear combination of p past values plus white noise:
AR(1) Properties
- Stationary if |φ1| < 1
- Mean: E[Yt] = c / (1 - φ1)
- ACF: ρ(h) = φ1h (exponential decay)
- PACF: cuts off after lag 1
Partial Autocorrelation Function (PACF)
The PACF measures the correlation between Yt and Yt-h after removing the linear effect of intermediate lags. For AR(p), the PACF cuts off after lag p.
8. Moving Average (MA) Models
An MA(q) model expresses the current value as a linear combination of current and past white noise terms:
MA(1) Properties
- Always stationary (finite combination of white noise)
- ACF: ρ(1) = θ1/(1 + θ12), ρ(h) = 0 for h > 1
- ACF cuts off after lag q
- PACF: exponential or sinusoidal decay
9. ARIMA Models
ARIMA (AutoRegressive Integrated Moving Average) combines AR and MA components with differencing to handle non-stationary data.
p = order of AR component
d = degree of differencing
q = order of MA component
φ(B) = 1 - φ1B - ... - φpBp
θ(B) = 1 + θ1B + ... + θqBq
Box-Jenkins Methodology
- Identification: Use ACF, PACF, and stationarity tests to determine p, d, q
- Estimation: Estimate parameters using maximum likelihood
- Diagnostic Checking: Verify residuals are white noise
- Forecasting: Generate predictions with confidence intervals
| Model | ACF Pattern | PACF Pattern |
|---|---|---|
| AR(p) | Exponential/sinusoidal decay | Cuts off after lag p |
| MA(q) | Cuts off after lag q | Exponential/sinusoidal decay |
| ARMA(p,q) | Decay after lag q | Decay after lag p |
10. Seasonal ARIMA (SARIMA)
SARIMA extends ARIMA to handle seasonality by including seasonal AR, MA, and differencing terms:
(p,d,q) = non-seasonal orders
(P,D,Q) = seasonal orders
m = seasonal period
Φ, Θ = seasonal AR and MA polynomials
Example: Monthly Sales Data
For monthly data with annual seasonality (m=12), a SARIMA(1,1,1)(1,1,1)12 model might be appropriate if:
- First differencing removes trend
- Seasonal differencing removes annual pattern
- ACF/PACF show significant spikes at lags 1 and 12
11. Model Diagnostics
Residual Analysis
A well-specified model should have residuals that are:
- Uncorrelated: ACF of residuals within confidence bounds
- Zero mean: Mean of residuals approximately zero
- Constant variance: No heteroscedasticity
- Normally distributed: (for valid prediction intervals)
Ljung-Box Test
Information Criteria
For model selection:
- AIC: -2log(L) + 2k (penalizes complexity less)
- BIC: -2log(L) + k·log(n) (stronger penalty, prefers simpler models)
12. Forecasting
Point Forecasts
The minimum mean squared error forecast is the conditional expectation:
Prediction Intervals
For Gaussian models, the (1-α) prediction interval is:
Forecast Accuracy Measures
- MAE: Mean Absolute Error = (1/n)∑|et|
- RMSE: Root Mean Squared Error = √((1/n)∑et2)
- MAPE: Mean Absolute Percentage Error = (100/n)∑|et/Yt|
- MASE: Mean Absolute Scaled Error (scale-independent)
References and Further Reading
- Box, G.E.P., Jenkins, G.M., Reinsel, G.C., & Ljung, G.M. (2015). Time Series Analysis: Forecasting and Control, 5th Edition. Wiley.
- Hyndman, R.J. & Athanasopoulos, G. (2021). Forecasting: Principles and Practice, 3rd Edition. OTexts.
- Hamilton, J.D. (1994). Time Series Analysis. Princeton University Press.
- Brockwell, P.J. & Davis, R.A. (2016). Introduction to Time Series and Forecasting, 3rd Edition. Springer.
- Shumway, R.H. & Stoffer, D.S. (2017). Time Series Analysis and Its Applications, 4th Edition. Springer.