* * Examples of spectral analysis from pp 167-170 * Note that these examples go through all the steps required for computing an * estimate of the spectral density. These can be done more simply using the * procedure SPECTRUM which combines these steps into a single procedure call. * cal(m) 1947 open data indprod.rat data(format=rats) 1947:1 1989:10 ipmfg6 graph(footer="Federal Reserve Board's IP Index, Not Seasonally Adjusted") # ipmfg6 compute nobs=1989:10-1947:1+1 diff(center) ipmfg6 / demean freq 1 nobs rtoc # demean # 1 fft 1 cmult(scale=1.0/(2*%pi*nobs)) 1 1 ctor # 1 # periodogram graph(nodates,footer="Sample Periodogram for IP Data") # periodogram 2 nobs/2 * * set lgrowth = 100*log(ipmfg6/ipmfg6{1}) clear demean diff(center) lgrowth / demean stats demean compute nobs=1989:10-1947:2+1 stats lgrowth rtoc # demean # 1 fft 1 cmult(scale=1.0/(2*%pi*nobs)) 1 1 window(type=tent,width=25) 1 ctor # 1 # spectrum graph(nodates,footer="Figure 6.5 Estimate of the Spectrum for Monthly Growth Rate of IP") # spectrum 1 nobs/2 * set ygrowth = 100*log(ipmfg6/ipmfg6{12}) clear demean diff(center) ygrowth / demean compute nobs=1989:10-1948:1+1 rtoc # demean # 1 fft 1 cmult(scale=1.0/(2*%pi*nobs)) 1 1 window(type=tent,width=25) 1 ctor # 1 # spectrum graph(nodates,footer="Figure 6.6 Estimate of the Spectrum for Year to Year Growth Rate of IP") # spectrum 1 nobs/2