In Eviews there is a sample program on how to do a rolling forecast with coefficient update (rollfcst1.pgm) when you have an equation. I am working with an VECM and since the dynamic forecasting option is only with constant coefficient estimates (I assume) I am not sure how to do the forecast.
Regards
NIels
Dynamic forecasting with coefficient update in a VECmodel
Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt
Re: Dynamic forecasting with coefficient update in a VECmodel
I am trying to create a dynamic forecasting for a VECmodel which also reestimates the model after each forecast. But I have problems with storing the data in the temporary file (receive the message "TMP_EURUSD_FC is not defined in "GENR EURUSD_FC = TMP_EURUSD_FC"). The program is as follows:
' Estimate VEC and forecast (with rolling regression and coefficient update)
' load workfile
load rådata_forecast
' set window size
!window = 265
' get size of workfile
!length = @obsrange
' Sample for estimation
smpl 1981:3 2003:3
' declare series for final results
series eurusd_fc ' point estimates
series eurusd_fc_se ' forecast std.err.
' set step size (1 month)
!step = 1
' move sample !step obs at a time
for !i = 1 to !length!window+1!step step !step
' set sample to estimation period
smpl @first+!i1 @first+!i+!window2
' estimate VEC with 1 cointegration relationship
var vec1.ec(c,1) 1 2 eurusd m1_usdeur ip_usdeur _3m_usdeur @ seas02 seas03 seas04 seas05 seas06 seas07 seas08 seas09 seas10 seas11 seas12
' make model out of estimated VEC
var.makemodel(mod1)
'reset sample to forecast period
smpl @first+!i+!window1 @first+!i+!window2+!step
' solve model to obtain dynamic forecasts and save forecasts in temporary series first
mod1.solve (f=na) tmp_eurusd_fc tmp_eurusd_fc_se
' copy data in current forecast sample
eurusd_fc = tmp_eurusd_fc
eurusd_fc_se = tmp_eurusd_fc_se
next
Regards
Niels
' Estimate VEC and forecast (with rolling regression and coefficient update)
' load workfile
load rådata_forecast
' set window size
!window = 265
' get size of workfile
!length = @obsrange
' Sample for estimation
smpl 1981:3 2003:3
' declare series for final results
series eurusd_fc ' point estimates
series eurusd_fc_se ' forecast std.err.
' set step size (1 month)
!step = 1
' move sample !step obs at a time
for !i = 1 to !length!window+1!step step !step
' set sample to estimation period
smpl @first+!i1 @first+!i+!window2
' estimate VEC with 1 cointegration relationship
var vec1.ec(c,1) 1 2 eurusd m1_usdeur ip_usdeur _3m_usdeur @ seas02 seas03 seas04 seas05 seas06 seas07 seas08 seas09 seas10 seas11 seas12
' make model out of estimated VEC
var.makemodel(mod1)
'reset sample to forecast period
smpl @first+!i+!window1 @first+!i+!window2+!step
' solve model to obtain dynamic forecasts and save forecasts in temporary series first
mod1.solve (f=na) tmp_eurusd_fc tmp_eurusd_fc_se
' copy data in current forecast sample
eurusd_fc = tmp_eurusd_fc
eurusd_fc_se = tmp_eurusd_fc_se
next
Regards
Niels

 Fe ddaethom, fe welon, fe amcangyfrifon
 Posts: 12388
 Joined: Tue Sep 16, 2008 5:38 pm
Re: Dynamic forecasting with coefficient update in a VECmodel
It looks like you're trying to use the model.solve command in the same way you would use an equation.forecast command. Unfortunately the way they work is slightly different.
For an equation.forecast, you need to specify the name of the series you wish to forecast into, and, optionally, the name of a series you wish to save the forecast standard errors into.
With a model.solve you don't specify the names that way. The forecasted values will, by default, by saved into a new series that has the same name as the original series, but with a _0 suffix.
For an equation.forecast, you need to specify the name of the series you wish to forecast into, and, optionally, the name of a series you wish to save the forecast standard errors into.
With a model.solve you don't specify the names that way. The forecasted values will, by default, by saved into a new series that has the same name as the original series, but with a _0 suffix.
Follow us on Twitter @IHSEViews
Re: Dynamic forecasting with coefficient update in a VECmodel
Thanks for your quick answer. I modifed the program and the results are stored in a series. But the problem now is that the forecastserie from the program differs the forecasts obtained manually (by making a model from the VECspecification and then solve the model). When I am running the forecast manually I estimate the VEC w/fixed window, forecast the variable like 3 months ahead, store the forecast output, and then move the sample period 1 period ahead, and repeating the procedure. I enclose the programscript again.
' Estimate VEC and forecast (with rolling regression and coefficient update)
' load workfile
load rådata_forecast
' set window size
!window = 265
' get size of workfile
!length = @obsrange
' Sample for estimation
smpl 1980:1 2002:1
' declare series for final results
series eurusd_fc ' point estimates
' set step size (3 month)
!step = 3
' move sample !step obs at a time
for !i = 1 to !length!window+1!step step !step
' set sample to estimation period
smpl @first+!i1 @first+!i+!window2
' estimate VAR
var vec1.ec(c,1) 1 2 eurusd m1_usdeur ip_usdeur _3m_usdeur @ seas02 seas03 seas04 seas05 seas06 seas07 seas08 seas09 seas10 seas11 seas12
' make model out of estimated VAR
var.makemodel(mod1)
'reset sample to forecast period
smpl @first+!i+!window1 @first+!i+!window2+!step
' solve model to obtain dynamic forecasts and save in forecasts in temporary series first
mod1.solve (f=na) tmp_eurusd_fc
'Save forecast in the serie eurusd_fc
' copy data in current forecast sample
eurusd_fc = eurusd_0
next
' Estimate VEC and forecast (with rolling regression and coefficient update)
' load workfile
load rådata_forecast
' set window size
!window = 265
' get size of workfile
!length = @obsrange
' Sample for estimation
smpl 1980:1 2002:1
' declare series for final results
series eurusd_fc ' point estimates
' set step size (3 month)
!step = 3
' move sample !step obs at a time
for !i = 1 to !length!window+1!step step !step
' set sample to estimation period
smpl @first+!i1 @first+!i+!window2
' estimate VAR
var vec1.ec(c,1) 1 2 eurusd m1_usdeur ip_usdeur _3m_usdeur @ seas02 seas03 seas04 seas05 seas06 seas07 seas08 seas09 seas10 seas11 seas12
' make model out of estimated VAR
var.makemodel(mod1)
'reset sample to forecast period
smpl @first+!i+!window1 @first+!i+!window2+!step
' solve model to obtain dynamic forecasts and save in forecasts in temporary series first
mod1.solve (f=na) tmp_eurusd_fc
'Save forecast in the serie eurusd_fc
' copy data in current forecast sample
eurusd_fc = eurusd_0
next

 Posts: 3
 Joined: Tue Apr 27, 2010 8:45 am
Re: Dynamic forecasting with coefficient update in a VECmodel
I'd love to see the solution as i am facing a similar problem....
anyone?
thx
anyone?
thx
Re: Dynamic forecasting with coefficient update in a VECmodel
I think you only have to delete the following code from your program:
'reset sample to forecast period
smpl @first+!i+!window1 @first+!i+!window2+!step
The VECEstimation works with lags. So you don't use the last data point of the estimation sample. Therefore you don't have to change your sample size for the forecast.
Please tell me wether I am right!
'reset sample to forecast period
smpl @first+!i+!window1 @first+!i+!window2+!step
The VECEstimation works with lags. So you don't use the last data point of the estimation sample. Therefore you don't have to change your sample size for the forecast.
Please tell me wether I am right!
Who is online
Users browsing this forum: No registered users and 7 guests