Numerical Examples & Further¶
Revisiting Non-parametric Estimation: Smoothing the Periodogram¶
As previously noted, the raw periodogram is an inconsistent estimator because its variance does not decrease as the sample size \(T\) increases. To obtain a consistent estimator, we must "smooth" the periodogram by averaging across frequencies.
1. Kernel Smoothing¶
This method applies a weighted moving average to the periodogram using a kernel function \(W\).
$\(\hat{S}(\omega) = \sum_{k=-K}^{K} W(k)I(\omega+k \Delta \omega)\)$
Essentially, it is a moving average that considers frequencies before and after \(\omega\).
* Common Kernels:
* Bartlett kernel: Uses triangular weights.
* Daniell kernel: A simple, unweighted moving average.
* Parzen kernel: Uses smoother weights for a more gradual tapering at the edges.
2. Averaging over Bands¶
In this approach, we divide the entire frequency range into specific "bands" (or baskets) and average all periodogram values within each band.
3. Welch's Method¶
Welch's method improves the estimate by following these steps:
1. Divide the Time Series (TS) into overlapping segments.
2. Apply a windowing function (e.g., Hamming or Hann) to each segment to reduce edge effects.
3. Compute the periodogram for each segment individually.
4. Average the segment periodograms: \(\hat{S}(\omega) = \dfrac{1}{N}\sum_{k=1}^{N}I_{k}(\omega)\).
Comparison of Estimation Techniques¶
| Method | Advantages | Disadvantages |
|---|---|---|
| Parametric | Smooth, interpretable; efficient for stationary models. | Requires correct model specification. |
| Periodogram | Simple to compute; provides high frequency resolution. | Noisy and inconsistent (variance stays high). |
| Smoothed Periodogram | Reduces noise; improves statistical consistency. | May lose fine frequency resolution (blurring). |
| Welch's Method | Robust to noise; significantly reduces variance. | Reduced frequency resolution due to segmentation. |
Practical Considerations in Estimation¶
- Choice of Windowing/Kernel: A "good" window reduces spectral leakage while maintaining as much frequency resolution as possible.
- Rectangular: High resolution, but suffers from significant leakage.
- Hamming/Hann: Greatly reduces leakage with only a moderate loss in resolution.
- Choice of Bandwidth: This is the ultimate trade-off between variance and resolution.
- Wide Bandwidth: Lower variance (more stable) but more smoothing (less detail).
- Narrow Bandwidth: Higher resolution but higher variance (noisier).
- Handling Non-stationarity: If a series is non-stationary, use time-frequency methods like:
- Wavelet Transform
- Short-Time Fourier Transform (STFT)
- Sampling Rate: The sampling frequency \(f_{s}\) must satisfy the Nyquist criterion: \(f_{s} > 2 f_{\max}\). If this is met, we are "good to go" and can avoid aliasing.
Numerical Example: Identifying Dominant Frequencies¶
Consider the following generated time series:
$\(Y_{t} = \sin(2\pi f_{1}t) + 0.5 \sin(2\pi f_{2}t) + \epsilon_{t}\)$
* \(f_{1} = 0.1 \text{ Hz}\) (Low frequency)
* \(f_{2} = 0.3 \text{ Hz}\) (High frequency)
* \(\epsilon_{t}\) = Random noise with 0 mean.
Task
Compute the Periodogram and identify the dominant frequencies \(f_{1}\) and \(f_{2}\).
Steps in Computation¶
- Generate Series: Let \(\Delta t = 1\) and \(T = 20\). Thus, \(t = 0, 1, \dots, 19\).
- Compute DFTs:
$\(Y(\omega_{k}) = \sum_{t=0}^{T-1} Y_{t}e^{ -i\omega_{k}t }, \quad \omega_{k} = \dfrac{2\pi k}{T}\)$ - Compute Power:
$\(I(\omega_{k}) = \dfrac{1}{T}|Y(\omega_{k})|^{2}\)$ - Frequency Analysis: For \(T=20\), the frequencies of interest are \(f_{k} = \dfrac{k}{T}\), which gives the range \([0, 0.05, 0.1, \dots, 0.5] \text{ Hz}\).
Manual Computation (Conceptual):
At \(f_{1} = 0.1 \text{ Hz}\) and \(f_{2} = 0.3 \text{ Hz}\), the periodogram \(I(f)\) will show distinct peaks. These peaks confirm that \(0.1\) and \(0.3\) are the dominant periodic components of the series.
Cross Spectrum¶
When we have two stationary time series with mean 0, the Cross Spectrum allows us to ask:
1. Are the periodicities of the two series related?
2. If they are, what is the phase relationship (lead/lag) between them?
Let \(\gamma_{k}^{xy} = Cov(x_{t}, y_{t-k})\) be the cross covariance. The cross spectrum is:
$\(f_{xy}(\omega) = \sum_{k=-\infty}^{\infty} e^{ -ik\omega } \gamma_{k}^{xy}\)$
Spectrum of a Sum (\(z_{t} = x_{t} + y_{t}\)):
The spectrum of the combined series is given by:
$\(f_{z}(\omega) = f_{x}(\omega) + f_{xy}(\omega) + f_{yx}(\omega) + f_{y}(\omega)\)$
If \(x_{t}\) and \(y_{t}\) are uncorrelated, this simplifies to:
$\(f_{z}(\omega) = f_{x}(\omega) + f_{y}(\omega)\)$
Practical Examples¶
- Macroeconomics: Identifying leading and lagging relationships between GDP growth and stock market returns.
- Finance: Using cross-spectral analysis for portfolio diversification.
- Commodities: Understanding relationships between Forex and commodity prices for better hedging strategies.