Overview
The SPECTRA procedure performs spectral and cross-spectral analysis of
time series. You can use spectral analysis techniques to look for
periodicities or cyclical patterns in data.
The SPECTRA procedure produces estimates of the spectral and
cross-spectral densities of a multivariate time series.
Estimates of the spectral and cross-spectral densities of a
multivariate time series are produced using a finite Fourier transform
to obtain periodograms and cross-periodograms.
The periodogram ordinates are smoothed by a moving average
to produce estimated spectral and cross-spectral densities.
PROC SPECTRA can also test whether or not the data are white noise.
PROC SPECTRA uses the finite Fourier transform to decompose
data series into a sum of sine and cosine waves of different
amplitudes and wavelengths.
The Fourier transform decomposition of the series xt is
where
- t
- is the time subscript, t = 1,2, ... ,n
- xt
- are the data
- n
- is the number of observations in the time series
- m
- is the number of of frequencies in the Fourier decomposition:
m = [n/2] if n is even;
m = [(n-1)/2] if n is odd
- a0
- is the mean term:
- ak
- are the cosine coefficients
- bk
- are the sine coefficients
- are the Fourier frequencies:
Functions of the Fourier coefficients ak and bk
can be plotted against frequency or against wave length to form
periodograms.
The amplitude periodogram Jk is defined as follows:
-
Jk = [n/2] ( a2k+ b2k )
Several definitions of the term periodogram are used
in the spectral analysis literature.
The following discussion refers to the Jk sequence
as the periodogram.
The periodogram can be interpreted as the contribution of the kth
harmonic to the total sum of squares,
in an analysis of variance sense,
for the decomposition of the process into two-degree-of-freedom
components for each of the m frequencies.
When n is even, is zero,
and thus the last periodogram value is a one-degree-of-freedom component.
The periodogram is a volatile and inconsistent estimator of the spectrum.
The spectral density estimate is produced by smoothing the periodogram.
Smoothing reduces the variance of the estimator but introduces a bias.
The weight function used for the smoothing process, W(),
often called the kernel or spectral window,
is specified with the WEIGHTS statement.
It is related to another weight function, w(), the lag window,
that is used in other methods to taper the correlogram rather than
to smooth the periodogram.
Many specific weighting functions have been suggested in the literature
(Fuller 1976, Jenkins and Watts 1968, Priestly 1981).
Table 17.1 later in this chapter gives the formulas relevant
when the WEIGHTS statement is used.
Letting i represent the imaginary unit ,
the cross-periodogram is defined as follows:
-
Jxyk =
[n/2] ( axk ayk
+ bxk byk )
+ i [n/2] ( axk byk
- bxk ayk )
The cross-spectral density estimate is produced by smoothing the
cross-periodogram in the same way as the periodograms are smoothed
using the spectral window specified by the WEIGHTS statement.
The SPECTRA procedure creates an output SAS data set whose variables
contain values of the periodograms, cross-periodograms, estimates
of spectral densities, and estimates of cross-spectral densities.
The form of the output data set is described
in the section "OUT= Data Set" later in this chapter.
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.