Static N-Step Ahead Forecast

For technical questions regarding estimation of single equations, systems, VARs, Factor analysis and State Space Models in EViews. General econometric questions and advice should go in the Econometric Discussions forum.

Moderators: EViews Gareth, EViews Moderator

errorterm
Posts: 8
Joined: Thu Apr 19, 2012 1:52 am

Static N-Step Ahead Forecast

Postby errorterm » Thu Apr 19, 2012 2:14 am

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.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Static N-Step Ahead Forecast

Postby EViews Gareth » Thu Apr 19, 2012 7:39 am

There is nothing built in that will do it :(

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: Static N-Step Ahead Forecast

Postby EViews Glenn » Thu Apr 19, 2012 9:20 am

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.

errorterm
Posts: 8
Joined: Thu Apr 19, 2012 1:52 am

Re: Static N-Step Ahead Forecast

Postby errorterm » Sun Apr 22, 2012 7:17 pm

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?

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: Static N-Step Ahead Forecast

Postby EViews Glenn » Mon Apr 23, 2012 11:48 am

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

errorterm
Posts: 8
Joined: Thu Apr 19, 2012 1:52 am

Re: Static N-Step Ahead Forecast

Postby errorterm » Mon Apr 30, 2012 12:06 am

EViews Glenn, thanks for this. Is there a way to extend this code for my 4-equation model?

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: Static N-Step Ahead Forecast

Postby EViews Glenn » Mon Apr 30, 2012 9:41 am

What 4 equation model?

errorterm
Posts: 8
Joined: Thu Apr 19, 2012 1:52 am

Re: Static N-Step Ahead Forecast

Postby errorterm » Tue May 01, 2012 8:48 pm

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

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: Static N-Step Ahead Forecast

Postby EViews Glenn » Wed May 02, 2012 9:27 am

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.

thanhtien501
Posts: 1
Joined: Fri May 11, 2012 12:26 am

Re: Static N-Step Ahead Forecast

Postby thanhtien501 » Fri May 11, 2012 12:32 am

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

errorterm
Posts: 8
Joined: Thu Apr 19, 2012 1:52 am

Re: Static N-Step Ahead Forecast

Postby errorterm » Thu Aug 23, 2012 12:09 pm

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?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Static N-Step Ahead Forecast

Postby EViews Gareth » Thu Aug 23, 2012 12:16 pm

Code: Select all

series tmp_y = y

errorterm
Posts: 8
Joined: Thu Apr 19, 2012 1:52 am

Re: Static N-Step Ahead Forecast

Postby errorterm » Thu Aug 23, 2012 1:13 pm

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


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 2 guests