>> Home >> Products >> Features >> Spectral density

## Parametric spectral density estimation

A stationary process can be decomposed into random components that occur at different frequencies. The spectral density of a stationary process describes the relative importance of these random components.

Stata's psdensity estimates the spectral density of a stationary process using the parameters of a previously estimated parametric model.

Consider the changes in the number of manufacturing employees in the United States:

. webuse manemp2
(FRED data: Number of manufacturing employees in U.S.)


The horizontal line corresponds to the mean. There appear to be more runs above the mean, and more runs below the mean, than we would expect from a series without autocorrelation. These runs suggest positive autocorrelation.

Fitting these data to a first-order autoregressive process confirms our suspicions:

. arima D.manemp, ar(1) nolog

ARIMA regression

Sample:  1950m2 - 2011m2                        Number of obs      =       733
Wald chi2(1)       =    645.44
Log likelihood = -870.5939                      Prob > chi2        =    0.0000

OPG
D.manemp        Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]

manemp
_cons    -.0198164   .0661281    -0.30   0.764     -.149425    .1097923

ARMA
ar
L1.      .517689    .020377    25.41   0.000     .4777509    .5576271

/sigma     .7933988   .0080698    98.32   0.000     .7775824    .8092153

Note: The test of the variance against zero is one sided, and the two-sided
confidence interval is truncated at zero.


The statistically significant estimate of 0.518 for the autoregressive coefficient indicates that there is an important amount of positive autocorrelation in this series.

Next we can use psdensity to estimate the spectral density of the process implied by the estimated parameters.

. psdensity density omega

. twoway line density omega

The above graph is typical of a spectral density of an AR(1) process with a positive coefficient. The curve is highest at frequency 0, and it tapers off toward zero or a positive asymptote. This estimated spectral density tells us that the low-frequency random components are the most important random components of an AR(1) process with a positive autoregressive coefficient.

Explore more time-series features in Stata.