Solved – Spectral Analysis in R – the periodogram

fourier transformfrequencyspectral analysistime series

I am doing a spectral analysis in R using the spec.pgram() function. Suppose I have observations for $y_1$ to $y_n$ which are a time series with annual observations.
From my understanding if I run: per <- spec.pgram(y,taper=0,log="no")
a) per$spec stores the periodogram values for frequencies $1/n, 2/n, \ldots, 1/2$.
b) per$freq appears to give these frequencies.
The frequencies with large per$spec values are the dominant frequencies.

My question is:
(1) why do we use the frequencies $1/n, 2/n, \ldots, 1/2$ instead of using all the frequencies from $1/n$ to $1$. Is this simply because the periodogram is symmetric?
(2) I noticed that if the data I used is a time series with freq= 2 (has two observations per year) then the periodogram in R shows frequencies from $1/n$ to $1$ instead of $1/n$ to $0.5$. Why is this? I am a little confused what R is doing. A detailed explanation would be appreciated (for example this happens when I run spec.pgram for the sunspotz data in the astsa package).

Best Answer

The periodogram function $P(\cdot)$ has the property that $$ P(j/n) = P(1 - j/n) $$ for $j=0,\ldots,n-1$. The frequency $.5$ is a folding frequency. This all can be verified by the definition of a periodogram: $$ P(j/n) = \left(\frac{2}{n} \sum_{t=1}^n x_t \cos(2 \pi t j/n) \right)^2 + \left(\frac{2}{n} \sum_{t=1}^n x_t \sin(2 \pi t j/n )\right)^2. $$

References: http://www.stat.pitt.edu/stoffer/tsa4/

Related Question