* * VAR example from pages 265-281, chapter 10, section 9. * open data house.dat cal(m) 1968:1 data(format=prn,org=columns) 1968:1 1996:6 * * This graph will be somewhat different from the one in the text because it * graphs both series on the same scale, which probably makes more sense since * they are, in fact, measured on the same scale (millions of housing units), and * are just showing different phases of the same process. To get the two graphed * with different scales, use the option OVERLAY=LINE. * graph(footer="Figure 10.2. U.S. Housing Starts and Completions, 1968:01-1996:06",key=upright) 2 # starts # completions * @bjident(number=24,report,qstats) starts 1968:1 1991:12 @bjident(number=24,report,qstats) completions 1968:1 1991:12 * * The procedure CrossCorr creates a 2x2 matrix of graphs, with the * autocorrelations on the diagonal and the cross correlations in the two orders * in the top right and lower left. The graph shown in figure 10.5 will be in the * top right (labeled "STARTS leading COMPLETIONS") since what 10.5 is showing is * the correlation between completions at t and starts at t-i which is earlier * (and thus leading) completions. * @crosscorr(number=24) starts completions 1968:1 1991:12 * @varlagselect(lags=36,crit=aic,model=varmodel) # starts completions * * Work with the favored system. This is re-estimated over the full interval, * since varlagselect needs to run the regressions over a common range. * system(model=varmodel) variables starts completions lags 1 to 4 det constant end(system) * estimate(ftests) * 1991:12 @varirf(model=varmodel,steps=36,byvariable,errors) * * Create the dummy series for the forecast period shading * set forezone = t>=1992:1 * * The single FORECAST instruction does all the forecasts. The starting period for * the forecasts is assumed to be 1992:1 because the estimation range ended at * 1991:4. The TO option is one of two ways to indicate how many forecasts you * want. It sets the final period. You can also use the STEPS option if you want a * specific number of forecasts periods. The forecasts go into the vector of * series "forecasts" where forecasts(1) are the forecasts of the first of the * variables in the system definition (that is, "starts") and forecasts(2) are * those for "completions" * forecast(model=varmodel,results=forecasts,to=1996:6) * graph(footer="Figure 10.13 Housing Starts: History and Forecast",shading=forezone) 2 # starts * 1991:12 # forecasts(1) 1992:1 * graph(footer="Figure 10.14 Housing Starts: History, Forecast and Realization",shading=forezone) 2 # starts * 1996:12 # forecasts(1) 1992:1 * graph(footer="Figure 10.15 Housing Completions: History and Forecast",shading=forezone) 2 # completions * 1991:12 # forecasts(2) 1992:1 * graph(footer="Figure 10.16 Housing Starts: History, Forecast and Realization",shading=forezone) 2 # completions * 1996:12 # forecasts(2) 1992:1 *