L44 Numerical Examples and Further
Revisiting Non-parametric Estimation¶
- Smoothing the Periodogram
- To reduce variance and obtain a consistent estimator
- Average the periodogram by averaging across frequencies
- Kernel Smoothing
- Apply weighted moving average using (kernel function \(W\))
- \(\hat{S}(\omega) = \sum_{k=-K}^{K} W(k)I(\omega+k \Delta \omega)\), its a moving average before and after \(\omega\)
- Common Kernels
- Barlett kernel: Triangular weights
- Dianiell kernel: Simple moving average
- Parzen kernel: Smoother weights for gradual tapering
- Averaging over bands
- Divide frequency range into bands (baskets) and average periodogram within each band
- Welch's method
- Divide TS into overlapping segments
- Apply a windowing function (e.g. Hamming, Hann) to each segment to reduce edge effects
- Compute periodogram for each segment.
- Average them \(\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 specification |
| Periodogram | Simple, high resolution | Noisy, inconsistent |
| Smoothed Periodogram | Reduces noise, improves consistency | May lose frequency resolution |
| Welch's Method | Robust to noise, reduces variance | Reduced frequency resolution due to segmentation |
Practical Consideration in Estimation¶
- Choice of windowing/kernel
- Good window = reduce spectral leakage, & maintain frequency resolution
- Popular choices
- Rectangular: High res, but leakage
- Hamming/Hann: Reduce leakage with moderate resolution loss
- Choice of bandwidth
- Smoothing bandwidth (trade-off between variance and resolution)
- should not be very wide or narrow
- Wide → less variance, more smoothing
- Narrow → more variance, higher resolution
- Handling non-stationary
- For such situations, use time -frequency methods
- Wavelet Transform
- Short-Time Fourier Transform (STFT)
- For such situations, use time -frequency methods
- Sampling Rage
- Sampling frequency \(f_{s}\) satisfies Nyquist criterion:
- If \(f_{s} > 2 f_{\max}\) then we are good to go (maximum frequency \(f_{\max}\))
- Sampling frequency \(f_{s}\) satisfies Nyquist criterion:
Practical Application of Estimation¶
- Climate Science: study seasonal and annual cycles
- Finance: hidden cycles in stock returns
- Speech processing: analyze voice signals
- Vibration analysis: mechanical system to identify faults
Example¶
- Where \(f_{1}=0.1 Hz\) (low frequency)
- \(f_{2} =0.3 Hz\) (high frequency)
- \(\epsilon_{t}\) is random noise with 0 mean
Task
- Compute Periodogram and then,
- Identify the dominant frequencies \(f_{1}, f_{2}\)
Steps in computation¶
Generate the time series… let sampling rate be \(\Delta t = 1\) and total time series length \(T = 20\). \(t = 0,1,2,\dots,19\)
The TS is,
- Compute the DFTs
- The power at each frequency is
- Frequencies of interest.
- For \(T=20\) are \(f_{k} = \dfrac{k}{T}\)
- Corresponding to \(f_{k} =[0,0.05,0.1,0.15,\dots,0.5] Hz\)
- Compute the periodogram \(I(f_{k})\) for each \(f_{k}\)
Manual Computation¶
- Computing periodogram for \(f_{1}=0.1 Hz\) and \(f_{2}=0.3Hz\)
- At \(f_{1}\), \(Y(0.1) = \sum_{t=0}^{19}Y_{t}e^{ -i\times 2\pi \times 0.1t }\)
- At \(f_{2}\), \(Y(0.3) = \sum_{t=0}^{19}Y_{t}e^{ -i\times 2\pi \times 0.3t }\)
- Power spectrum: \(I(0.1) = \dfrac{1}{20}|Y(0.1)|^{2}\), \(I(0.3) = \dfrac{1}{20}|Y(0.3)|^{2}\)
Cross Spectrum¶
- Let there be two stationary TS with mean 0
- Ask two questions
- Are periodicities related to each other?
- If so, what's the phase relationship between them?
Let \(\gamma_{k}^{xy} = Cov(x_{t},y_{t-k})\) be the cross covariance
$$
f_{xy}(\omega) = \sum_{k=-\infty}^{\infty} e^{ -ik\omega } \gamma_{k}^{xy}
$$
- Compute the spectrum of a sum, \(z_{t} = z_{t} + y_{t}\)
Thus,
and if \(x_{t}\) and \(y_{t}\) are uncorrelated
Practical Examples of Cross Spectrum¶
- Identifying leading and lagging relationships between GDP growth and stock market returns
- Portfolio diversification
- Forex and commodities (hedging strategies)