Static N-Step Ahead Forecast
Moderators: EViews Gareth, EViews Moderator
Static N-Step Ahead Forecast
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
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
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
I found this post through Google:
Is this right code for what I'm trying to do?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!
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: Static N-Step Ahead Forecast
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.
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
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
What 4 equation model?
Re: Static N-Step Ahead Forecast
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
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
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
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
Sorry I can't quite figure out how to create a temporary series for each of the variables in the solution.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.
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
Code: Select all
series tmp_y = y
Re: Static N-Step Ahead Forecast
Gareth,
Can you verify whether the following lines will generate the 6-step ahead solutions for the model?
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
Who is online
Users browsing this forum: No registered users and 2 guests
