Pre-Whitening Example of Two Time Series
Pre-whitening is a technique used in time series analysis to remove autocorrelation structures, making cross-correlation analysis between two series more meaningful. Below is a concrete numerical example demonstrating how to prewhiten one time series, apply the same filter to another series, and then compute cross-correlation on the resulting residuals.
Step-by-Step Numerical Example
- Generate Two Autocorrelated Time Series:
Suppose we have two time series x_t and y_t of length 10. We assume:
x_t = 0.8 * x_{t-1} + e_t
y_t = 0.8 * y_{t-1} + 0.5 * x_t + f_t
Here, e_t and f_t are white noise terms. After simulating, we might get:
x = [0, 0.5, 1.4, 0.92, 1.036, -0.1712, 0.06304, 0.750432, 0.1003456, 0.08027648] y = [0, 0.05, 1.04, 0.792, 1.0516, 0.75568, -0.364, 0.284016, -0.0226272, 0.02203648]
- Fit an AR(1) Model to x_t and Determine the Filter:
From the form of x_t, we know it's approximately AR(1) with φ = 0.8.
In practice, you’d estimate φ from the data, but we assume we know it here.
The prewhitening filter for AR(1) with φ=0.8 is:
W(L) = 1 - 0.8L
- Prewhiten x_t:
Apply the filter to remove the autocorrelation from x_t:
e_x(t) = x(t) - 0.8 * x(t-1)
This gives a residual series e_x that is closer to white noise.
- Apply the Same Filter to y_t:
We use the same filter on y_t to ensure we’re looking at comparable residuals:
E_y(t) = y(t) - 0.8 * y(t-1)
This produces a whitened version of y_t called E_y.
- Compute Cross-Correlation on the Residuals:
Now we have two filtered residual series e_x and E_y. Their cross-correlation
is more meaningful because it is not dominated by autocorrelations present in the original data.
Why Pre-Whitening Helps
- Removes Autocorrelation: By rendering the series closer to white noise, the cross-correlation reflects true co-movements rather than lagged self-influence.
- Improves Interpretability: It’s easier to detect genuine lead/lag relationships between series when each is stripped of its own persistence.
In practice, you would:
- Estimate the AR model for
x_t, get φ. - Prewhiten
x_tto gete_x(t). - Apply the same filter to
y_tto getE_y(t). - Compute cross-correlation between
e_xandE_y.
This approach is common in signal processing and econometrics when analyzing relationships between nonstationary or autocorrelated time series.