Overview
The SPECTRA procedure performs spectral and crossspectral 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
crossspectral densities of a multivariate time series.
Estimates of the spectral and crossspectral densities of a
multivariate time series are produced using a finite Fourier transform
to obtain periodograms and crossperiodograms.
The periodogram ordinates are smoothed by a moving average
to produce estimated spectral and crossspectral 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 x_{t} is
where
 t
 is the time subscript, t = 1,2, ... ,n
 x_{t}
 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 = [(n1)/2] if n is odd
 a_{0}
 is the mean term:
 a_{k}
 are the cosine coefficients
 b_{k}
 are the sine coefficients
 are the Fourier frequencies:
Functions of the Fourier coefficients a_{k} and b_{k}
can be plotted against frequency or against wave length to form
periodograms.
The amplitude periodogram J_{k} is defined as follows:

J_{k} = [n/2] ( a^{2}_{k}+ b^{2}_{k} )
Several definitions of the term periodogram are used
in the spectral analysis literature.
The following discussion refers to the J_{k} 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 twodegreeoffreedom
components for each of the m frequencies.
When n is even, is zero,
and thus the last periodogram value is a onedegreeoffreedom 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 crossperiodogram is defined as follows:

J^{xy}_{k} =
[n/2] ( a^{x}_{k} a^{y}_{k}
+ b^{x}_{k} b^{y}_{k} )
+ i [n/2] ( a^{x}_{k} b^{y}_{k}
 b^{x}_{k} a^{y}_{k} )
The crossspectral density estimate is produced by smoothing the
crossperiodogram 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, crossperiodograms, estimates
of spectral densities, and estimates of crossspectral 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.