*========================================================================== * * C:\PROJECT\ERM\GDPPOP\DIAGNOST.PRG * * RATS code that performs some diagnostics to see if an ARMA model is * misspecified. * *========================================================================== * cal 1947 1 4 compute t0 = 1947:1 ;* quarter of first observation compute tf = 1997:4 ;* quarter of last observation compute nstep = 16 ;* number of quarters to compute impulse responses all tf+nstep * * READ INPUT FILE AND COMPUTE PER CAPITA SERIES * open data gdppop.por data(format=portable) / gdp pop p16 * set gdp = gdp * 1000000000 ;* real GDP set gdpall = gdp / (pop * 1000000) ;* GDP / total population set gdp16 = gdp / (p16 * 1000000) ;* GDP / civilian noninstitutional pop * * LOG TRANSFORMATIONS * set lgdpall = log(gdpall) set lgdp16 = log(gdp16) * * TIME TRENDS * set trend = t set trend2 = (t ** 2) * * TIME DETREND ALL SERIES * linreg gdpall # constant trend trend2 prj fit set dgdpall = gdpall - fit * linreg gdp16 # constant trend trend2 prj fit set dgdp16 = gdp16 - fit * linreg lgdpall # constant trend trend2 prj fit set dlgdpall = lgdpall - fit * linreg lgdp16 # constant trend trend2 prj fit set dlgdp16 = lgdp16 - fit * * LOGGED 16+ PER CAPITA SERIES * compute nar = 2 compute nma = 1 boxjenk(ar=nar,diffs=0,ma=nma,constant,iterations=50) dlgdp16 / eps correlate(qstats,number=nstep,dfc=nar+nma) eps