Page 1 of 1

Static N-Step Ahead Forecast

Posted: Thu Apr 19, 2012 2:14 am
by errorterm
I need to compute for the n-step ahead static forecasts from a one equation and a multiple equation model. I know that Static calculates a sequence of one-step ahead forecasts from the models. Is there a command that would calculate a sequence of n-step ahead forecasts. I need to do this for 2 to 12 steps ahead? I've just started using EViews and would appreciate if there is some code that I could see for this.

Re: Static N-Step Ahead Forecast

Posted: Thu Apr 19, 2012 7:39 am
by EViews Gareth
There is nothing built in that will do it :(

Re: Static N-Step Ahead Forecast

Posted: Thu Apr 19, 2012 9:20 am
by EViews Glenn
What you'd have to do is to write a loop with a set of dynamic forecasts over the n-period interval, and save the appropriate value into a holding series.

Re: Static N-Step Ahead Forecast

Posted: Sun Apr 22, 2012 7:17 pm
by errorterm
I found this post through Google:
I’ve managed to put together a code but I’m not sure if the outcome is a dynamic 6 step ahead out of sample forecast. It looks more like 1 step forecast with a rolling window of 6. First, eq1 was estimated for in-sample period (until 2005:02) and afterwards:

' Sample forecast
smpl 2005:02 2008:10
'get size
!length = @obssmpl
'define series
series yhat
series yhat_se
' move sample 6 steps ahead (6month forecast)
for !i = 1 to !length step 6
smpl 2005:02+!i 2005:02+6+!i
' make forecasts
eq1.forecast(f=na) tmp_yhat tmp_se
' copy data in current forecast sample
yhat = tmp_yhat
yhat_se = tmp_se
next

Can somebody provide me some indications as I really need to come up with these results.
Thanks!
Is this right code for what I'm trying to do?

Re: Static N-Step Ahead Forecast

Posted: Mon Apr 23, 2012 11:48 am
by EViews Glenn
Roughly the right idea but in I think that they need to set the sample so that they save just the terminal value of the 7-period forecast...This example overwrites the first 6 periods of the 7-period ahead dynamic forecast (in the copy step) which I suspect isn't the desired behavior.

You'll also have to take care so that the sample that you are forecasting is the one that you want. In this case, they are doing forecasts over the workfile range.

Code: Select all

' make forecasts smpl 2005:02+!i 2005:02+6+!i eq1.forecast(f=na) tmp_yhat tmp_se ' copy data in current forecast sample smpl 2005:02+6+!i 2005:02+6+!i yhat = tmp_yhat yhat_se = tmp_se next

Re: Static N-Step Ahead Forecast

Posted: Mon Apr 30, 2012 12:06 am
by errorterm
EViews Glenn, thanks for this. Is there a way to extend this code for my 4-equation model?

Re: Static N-Step Ahead Forecast

Posted: Mon Apr 30, 2012 9:41 am
by EViews Glenn
What 4 equation model?

Re: Static N-Step Ahead Forecast

Posted: Tue May 01, 2012 8:48 pm
by errorterm
Suppose I have a simultaneous equation model with gdp, inflation, unemployment, interest rate as dependent variables. Since the code for the n-step ahead forecast is only for a single equation, is there a way to modify the code for a simultaneous equation system? Could I just run code below? I think I need to copy the solution for a particular sample but I can't figure out how to do it.

Code: Select all

' Sample forecast smpl 1991:01 2011:12 'get size !length = @obssmpl ' move sample 6 steps ahead (6month forecast) for !i = 1 to !length step 6 smpl 1991:02+!i 2011:02+6+!i ' solve model model.solve next

Re: Static N-Step Ahead Forecast

Posted: Wed May 02, 2012 9:27 am
by EViews Glenn
The model solutions will go into a set of variables associated with your solution scenario. Just copy from all of them in the same way that you copied from the single series.

Re: Static N-Step Ahead Forecast

Posted: Fri May 11, 2012 12:32 am
by thanhtien501
Dear ,
I meet same problem. I have a list of data
[21655 21169 19257 19384 20379 19878 20439 21552 21603 20232 21112 21616 21417 21108 19315 20402 20706 19653 20214 20064 ]
( this is just a part of it)

Based on the ACF and PACF , I consider the estimation funtion ARIMA(1,0,10), Righ now i want to forecast for next 5 numbers in this array. I find just know how to forecast for next 1 number in this array by using eviews,

Would you mind helping me? I do appreciate your help

Re: Static N-Step Ahead Forecast

Posted: Thu Aug 23, 2012 12:09 pm
by errorterm
The model solutions will go into a set of variables associated with your solution scenario. Just copy from all of them in the same way that you copied from the single series.
Sorry I can't quite figure out how to create a temporary series for each of the variables in the solution.

For example, if the model solves for p, y, and m, how can I generate a tmp_p, tmp_y, and tmp_m series so that I could copy the solutions for the sample I want?

Re: Static N-Step Ahead Forecast

Posted: Thu Aug 23, 2012 12:16 pm
by EViews Gareth

Code: Select all

series tmp_y = y

Re: Static N-Step Ahead Forecast

Posted: Thu Aug 23, 2012 1:13 pm
by errorterm
Gareth,

Can you verify whether the following lines will generate the 6-step ahead solutions for the model?

Code: Select all

' move sample 6 steps ahead (6month forecast) for !i = 1 to !length step 6 smpl 2005:02+!i 2005:02+6+!i ' solve model model.solve "Scenario 1" series tmp_y=y series tmp_p=p series tmp_m=m ' copy data in current forecast sample smpl 2005:02+6+!i 2005:02+6+!i y_1 = tmp_y p_1 = tmp_p m_1 = tmp_m next