Today we will be finally creating our long awaited GDP forecast. In order to create this forecast we have to combine both the forecast from our deterministic trend model and the forecast from our de-trended GDP model.
Our model for the trend is:
trendyx= 892.656210 + -30.365580*x + 0.335586*x2
and the vector length we will make out to the 278th observation:
and our model for the cyclical de-trended series is from an AR(10) process:
So lets say we want to predict GDP 21 periods into the future. Type in the following for the cyclical forecast:
Now when we produce our forecast we can’t just add trendyx + GDP.pred$pred because the vector lengths won’t match. To see this use the length() function:
In order to fix this problem we are going to remove the first 258 observations from trendyx so that we only have 21 left:
Now we can plot away without any technical difficulties:
> plot(GDP,type=”l”,xlim=c(40,75),ylim=c(5000,18500),main=”GDP Predictions”)
This code results in the following plot:
The blue line represents our point forecast and the red lines represent our 95% Confidence Level interval forecast. I feel like the plot could be significantly cooler and therefore at its current appearance receives a 2 out of 10 for style. It’s bland, the x-axis doesn’t have dates and there’s not even any background color. If this plot had a name it would be doodoo. A war must be fought against the army of lame plots. Epic battles will proceed. Plots will be lost. Only one victor will stand.