The SPECTRA Procedure

OUT= Data Set

The OUT= data set contains ${\frac{n}{2}+1}$ observations, if n is even, or ${\frac{n+1}{2}}$ observations, if n is odd, where n is the number of observations in the time series or the span of data being analyzed if missing values are present in the data. See the section Missing Values for details.

The variables in the new data set are named according to the following conventions. Each variable to be analyzed is associated with an index. The first variable listed in the VAR statement is indexed as 01, the second variable as 02, and so on. Output variables are named by combining indexes with prefixes. The prefix always identifies the nature of the new variable, and the indices identify the original variables from which the statistics were obtained.

Variables that contain spectral analysis results have names that consist of a prefix, an underscore, and the index of the variable analyzed. For example, the variable S_01 contains spectral density estimates for the first variable in the VAR statement. Variables that contain cross-spectral analysis results have names that consist of a prefix, an underscore, the index of the first variable, another underscore, and the index of the second variable. For example, the variable A_01_02 contains the amplitude of the cross-spectral density estimate for the first and second variables in the VAR statement.

Table 26.3 shows the formulas and naming conventions used for the variables in the OUT= data set. Let X be variable number nn in the VAR statement list and let Y be variable number mm in the VAR statement list. Table 26.3 shows the output variables that contain the results of the spectral and cross-spectral analysis of X and Y.

In Table 26.3 the following notation is used. Let ${W_{j}}$ be the vector of ${2p+1}$ smoothing weights given by the WEIGHTS statement, normalized to sum to ${\frac{1}{4{\pi }}}$. Note that the weights are either explicitly provided using the constant specification or are implicitly determined by the kernel specification in the WEIGHTS statement.

The subscript of ${W_{j}}$ runs from ${W_{-p}}$ to ${W_{p}}$, so that ${W_{0}}$ is the middle weight in the list. Let ${{\omega }_{k}=\frac{2{\pi }k}{n}}$, where ${k=0, 1, {\ldots }, \mr {floor}( \frac{n}{2} )}$.

Table 26.3: Variables Created by PROC SPECTRA




frequency in radians from 0 to ${\pi }$


(Note: Cycles per observation is $\frac{\mr {FREQ}}{2{\pi }}$.)


period or wavelength: $\frac{2{\pi }}{\mr {FREQ}}$


(Note: PERIOD is missing for FREQ=0.)


cosine transform of X: ${ a^{x}_{k}=\frac{2}{n} \sum _{t=1}^{n}{X_{t} \mr {cos} ({\omega }_{k}(t-1))}}$


sine transform of X: ${ b^{x}_{k}=\frac{2}{n} \sum _{t=1}^{n}{X_{t} \mr {sin} ({\omega }_{k}(t-1))}}$


periodogram of X: ${ J^{x}_{k}=\frac{n}{2} \lbrack (a^{x}_{k})^{2} + ( b^{x}_{k})^{2}}\rbrack $


spectral density estimate of X: ${ F^{x}_{k}=\sum _{j=-p}^{p}{W_{j} J^{x}_{k+j}}}$


(except across endpoints)

RP_nn _mm

real part of cross-periodogram X and Y: ${\mr {real}( J^{xy}_{k})=\frac{n}{2} ( a^{x}_{k} a^{y}_{k} + b^{x}_{k} b^{y}_{k})}$

IP_nn _mm

imaginary part of cross-periodogram of X and Y:


${\mr {imag}( J^{xy}_{k})=\frac{n}{2} ( a^{x}_{k} b^{y}_{k} - b^{x}_{k} a^{y}_{k})}$

CS_nn _mm

cospectrum estimate (real part of cross-spectrum) of X and Y:


${ C^{xy}_{k}=\sum _{j=-p}^{p}{W_{j}\mr {real}( J^{xy}_{k+j})}}$(except across endpoints)

QS_nn _mm

quadrature spectrum estimate (imaginary part of cross-spectrum) of X and Y:


${ Q^{xy}_{k}=\sum _{j=-p}^{p}{W_{j} \mr {imag}( J^{xy}_{k+j})}}$(except across endpoints)

A_nn _mm

amplitude (modulus) of cross-spectrum of X and Y: ${ A^{xy}_{k}=\sqrt { {(C^{xy}_{k})}^{2} + {(Q^{xy}_{k})}^{2}} }$

K_nn _mm

coherency squared of X and Y: ${ K^{xy}_{k}= {(A^{xy}_{k})}^{2} / ( F^{x}_{k} F^{y}_{k})}$

PH_nn _mm

phase spectrum in radians of X and Y: ${ {\Phi }^{xy}_{k}=\arctan ( Q^{xy}_{k} / C^{xy}_{k} )}$