Time Series Analysis Package
SPECTRA Object
The SPECTRA object performs the spectral analysis of a time series array and outputs the results.
Table 21 summarizes the methods that are associated with the SPECTRA object.
Table 21: Methods of the SPECTRA Object
| Method | Description |
|---|---|
| Initialize | Initialize the SPECTRA object |
| Run | Run the analysis |
| SetKernel | Set the kernel |
| SetOption | Set the specifications |
| SetWeights | Set the weights |
| SetY | Set the input time series |
Figure 13 diagrams the methods of the SPECTRA object.
Figure 13: SPECTRA Data Flow

SPECTRA Synopsis
DECLARE OBJECT obj (SPECTRA);
Method syntax, in order of typical usage:
rc=obj.SetY (YSeries);
rc=obj.SetOption ('Name',Value <,'Name',Value, …> );
rc=obj.SetKernel ('Kernel' <,Value,Value>);
rc=obj.SetWeights (NumericArray);
rc=obj.Run ();
SPECTRA Methods
SPECTRA.Initialize Method
rc=obj.Initialize ();
Initializes a SPECTRA object to an empty state. This method must be called before the time series arrays and other attributes for the SPECTRA object are specified.
Arguments
There are no arguments associated with this method.
SPECTRA.SetKernel Method
rc=obj.SetKernel ('Kernel' <,C,E>);
Sets the kernel options for the SPECTRA object.
Input Arguments
You can specify one of the following input arguments for 'Kernel':
- 'NONE'
uses no kernel.
- 'PARZEN'
uses a Parzen kernel.
- 'BARTLETT'
uses a Bartlett kernel.
- 'TUKEY'
uses a Tukey-Hanning kernel.
- 'TRUNC TRUNCAT'
uses a truncated kernel.
- 'QS QUADR'
uses a quadratic spectral kernel.
If neither WEIGHTS nor a kernel function is specified, the spectral density estimate is identical to the unmodified periodogram.
The C and E arguments are optional. You can specify them as follows:
- C
specifies a positive scale coefficient for the kernel function. The specified value must be within the range 0 to 32,000.
- E
specifies a positive exponent for the kernel function. The specified value must be within the range 0 to 1.
Kernel Option Details
You can further parameterize each of the kernel functions with a kernel scale factor by using the C and E arguments. Table 22 shows the default values of the kernel scale parameters c and e that are associated with each of the kernel functions together with their kernel scale factor values M for a series that has 100 periodogram ordinates. The formula that is used to generate the table entries is , where K is the number of Fourier component frequencies.
Table 22: Default Kernel Scale Factor Parameters
| Default Kernel Scale Factor Parameters |
Kernel c e M Bartlett 1/2 1/3 2.32 Parzen 1 1/5 2.51 Quadratic 1/2 1/5 1.26 Tukey-Hanning 2/3 1/5 1.67 Truncated 1/4 1/5 0.63 |
For example, to apply the truncated kernel by using default scale factor parameters in the frequency domain, you could specify the following:
rc = SetKernel('TRUNCAT');
For more information about the kernel function parameterization, see the section ????.
SPECTRA.SetOption Method
rc=obj.SetOption ('Name',Value <,'Name',Value, …> );
Sets a named option for the SPECTRA object.
Input Arguments
You can specify one of the following for 'Name' and its associated Value:
- 'ADJUSTMEAN'
-
takes a string Value that specifies whether to adjust the series by its mean before performing the spectral analysis. You can specify one of the following Values:
- TRUE | T | YES | Y
adjusts the mean before performing spectral analysis.
- FALSE | F | NO | N
does not adjust the mean before performing spectral analysis.
The default is NO.
- 'DOMAIN'
-
takes a string Value that specifies how to interpret the smoothing function. You can specify one of the following Values:
- FREQUENCY
smooths the periodogram ordinate.
- TIME
applies the kernel as a filter to the time series autocovariance function.
The default is FREQUENCY. For more information about the DOMAIN option, see the section ????.
- 'ALPHA'
specifies the width of a window that is drawn around the spectral density estimate in a spectral density versus frequency plot. Based on approximations proposed by Brockwell and Davis (1991), periodogram ordinates fall within this window with a confidence level of
. The value
must be between 0 and 1; the default is 0.5.
SPECTRA.SetWeights Method
rc=obj.SetWeights (NumericArray);
Sets the relative weights for the SPECTRA object.
Input Arguments
You must specify the following input argument:
- NumericArray
specifies a series of relative weights that are used to compute a spectral density estimate as the moving average smoothing of periodogram ordinates.
If neither WEIGHTS nor a kernel function is specified, the spectral density estimate is identical to the unmodified periodogram.
SPECTRA.SetY Method
rc=obj.SetY (YSeries);
Specifies the time series array (YSeries) for the SPECTRA object.
Input Arguments
You must specify the following input argument:
- YSeries
specifies a numeric array that contains the series for the SPECTRA object.
SPECTRA.Run Method
rc=obj.Run ();
Runs the SPECTRA object to perform the spectral analysis by using the time series array YSeries that has been specified for it. Upon successful completion, various results can be extracted from the SPECTRA object.
Arguments
There are no arguments associated with this method.