* * Example 20.3 from pp 628-630 * open data tablef20-2[1].txt calendar(q) 1950 data(format=prn,org=columns) 1950:1 1983:4 qtr y m1 p * set lrgnp = log(y/p) set ygrow = 100*(lrgnp-lrgnp{1}) * * The mean is extracted from the data before computing the periodogram or * spectrum. Figure 20.2 shows the growth rate with mean extracted. * diff(center) ygrow / yc graph(footer="Figure 20.2 Growth of US Real GNP") # yc * * The periodogram and spectral estimates are produced using the SPECTRUM * procedure. This, by default, does a log scale graph. NOLOGSCALE is used to * produce a linear scale graph as shown. To get the periodogram, use the option * PERIODOGRAM from this. This procedure also has a HEADER and FOOTER options to * label the graph. * @spectrum(periodogram,nologscale,footer="Figure 20.3 Sample Periodogram") yc * * Similarly, the log of real gnp has its mean extracted. * diff(center) lrgnp / gc graph(footer="Figure 20.4 Quarterly Data on Real GNP") # gc * * The procedure uses the smoothed periodogram method for computing consistent * estimates of the spectral density. This isn't described in the text. Smoothed * periodogram estimators take moving averages of the periodogram ordinates. This * exploits the assumed smoothness of the underlying spectral density. * @spectrum(width=13,nologscale,footer="Figure 20.5 Spectrum for Real GNP") gc