16.2 The periodogram

Definition 16.2.1. Given data \(x_1, \dots , x_n\), the periodogram at the Fourier frequencies \(\omega _j = 2\pi j/n\), \(j = 1, \dots , \lfloor n/2\rfloor \), is \[ I(\omega _j) = \frac {1}{2\pi n}\Bigl |\sum _{t=1}^nx_te^{-i\omega _jt}\Bigr |^2 . \]

Theorem 16.2.2.

(i)
For \(1 \le j < n/2\), \(I(\omega _j) = \dfrac {n}{8\pi }(a_j^2 + b_j^2)\), where \[ a_j = \frac 2n\sum _{t=1}^nx_t\cos (\omega _jt) , \qquad b_j = \frac 2n\sum _{t=1}^nx_t\sin (\omega _jt) \] are the least-squares coefficients of \(\cos (\omega _jt)\) and \(\sin (\omega _jt)\) in a regression of \(x_t\) on these harmonics.
(ii)
For \(j \ne 0\), \(I(\omega _j) = \dfrac 1{2\pi }\displaystyle \sum _{|k|<n}c_ke^{-i\omega _jk}\), the sample analogue of the spectral density, with \(c_k\) the sample autocovariances.

Proof. (i) \(\sum _tx_te^{-i\omega _jt} = \sum _tx_t\cos (\omega _jt) - i\sum _tx_t\sin (\omega _jt) = \frac n2(a_j - ib_j)\), whose squared modulus is \(\frac {n^2}4(a_j^2 + b_j^2)\); divide by \(2\pi n\). The harmonics at the Fourier frequencies are orthogonal over \(t = 1, \dots , n\), and for \(0 < j < n/2\), \[ \textstyle \sum _t\cos ^2(\omega _jt) = \sum _t\sin ^2(\omega _jt) = n/2 , \] so by the orthogonal-regression formula (each coefficient is \(\sum x_t\times \text {column}/\sum \text {column}^2\)) the least-squares coefficients are \(a_j\) and \(b_j\).

(ii) For \(j \ne 0\), \(\sum _te^{-i\omega _jt} = 0\) (a geometric sum over whole turns), so \(x_t\) may be replaced by \(x_t - \bar x\). Then \(\bigl |\sum _t(x_t - \bar x)e^{-i\omega _jt}\bigr |^2 = \sum _s\sum _t(x_s - \bar x)(x_t - \bar x)e^{-i\omega _j(t-s)}\), and grouping the pairs by \(k = t - s\) gives \(\sum _kn\,c_ke^{-i\omega _jk}\). □

Part (ii) is why the periodogram is the natural estimate of the spectral density. Part (i) gives it a concrete meaning: \(I(\omega _j)\) measures how much of the series is explained by a sinusoid of frequency \(\omega _j\). Indeed the sums of squares of the harmonics add up to the total, \(\sum _t(x_t - \bar x)^2 = \frac n2\sum _{j<n/2}(a_j^2 + b_j^2)\) (plus a term for \(j = n/2\) when \(n\) is even), so the periodogram is an analysis of variance by frequency.

Example 16.2.3. Compute the periodogram of the twelve observations \[ -1, \ -3, \ -1, \ 1, \ -1, \ -3, \ 1, \ 3, \ 1, \ -1, \ 1, \ 3 , \] and find which cycle dominates.

Solution. Here \(n = 12\), \(\bar x = 0\) and \(\sum x_t^2 = 44\). The Fourier frequencies are \(\omega _j = 2\pi j/12\), periods \(12/j\), for \(j = 1, \dots , 6\). At \(j = 3\) (period \(4\)), \(\cos (\pi t/2)\) runs \(0, -1, 0, 1, \dots \) and \(\sin (\pi t/2)\) runs \(1, 0, -1, 0, \dots \), so \begin {align*} a_3 &= \tfrac 2{12}\bigl [(-1)(-3) + (1)(1) + (-1)(-3) + (1)(3) + (-1)(-1) + (1)(3)\bigr ] \\ &= \tfrac {14}6 = 2.333 , \\ b_3 &= \tfrac 2{12}\bigl [(1)(-1) + (-1)(-1) + (1)(-1) + (-1)(1) + (1)(1) + (-1)(1)\bigr ] \\ &= -\tfrac 26 = -0.333 , \end {align*}

and \(I(\omega _3) = \frac {12}{8\pi }(5.444 + 0.111) = 2.653\). The same computation at the other frequencies gives:

\(j\) period \(a_j\) \(b_j\) \(I(\omega _j)\) \(\frac n2(a_j^2 + b_j^2)\)
1 12 0.333 \(-1.244\) 0.792 9.95
2 6 0 0 0 0
3 4 2.333 \(-0.333\) 2.653 33.33
4 3 0 0 0 0
5 2.4 0.333 \(-0.089\) 0.057 0.71
6 2 0 – 0 0

The sums of squares in the last column add to \(9.95 + 33.33 + 0.71 = 44.0 = \sum x_t^2\), as they should. The cycle of period \(4\) accounts for \(33.33/44 = 76\%\) of the variation, with most of the rest in a slow movement of period \(12\). The data look like quarterly observations with a strong seasonal pattern.

Remark. The periodogram is the natural estimate of the spectral density, and it is a bad one. It is asymptotically unbiased, but its variance does not fall as \(n\) grows: at each frequency \(I(\omega _j)\) is approximately \(f(\omega _j)\chi ^2_2/2\), whose variance is \(f(\omega _j)^2\) however long the series. Lengthening the record adds more frequencies rather than improving any one of them.

The cure is smoothing: averaging the periodogram over a window of neighbouring frequencies. Averaging \(m\) approximately independent ordinates cuts the variance by a factor \(m\) at the cost of blurring detail across the window, which is the usual bias–variance trade, and is chosen by how sharp the features of interest are expected to be.

Note. This is worth stating plainly, because it is counter-intuitive: an estimator can be consistent for the whole function in an integrated sense while being inconsistent at every single point. The periodogram is the standard example, and it is why raw periodograms look so ragged.

Questions on this section

Stuck on something here? Ask below and it stays attached to this topic.