Estimating out of sample RMSE for VECM model using loops

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

JonathanSvoboda
Posts: 3
Joined: Wed Dec 19, 2018 7:30 pm

Estimating out of sample RMSE for VECM model using loops

Postby JonathanSvoboda » Thu Dec 20, 2018 12:34 am

Hello, I am relatively new to eviews and using a loop command suggested by my professor to do out of sample forecasts. It was working well until I used a vecm model and I ran into a problem

Code: Select all

smpl @all
series rollyhat4      
series rollse4      '
for !i=1 to 11 step 1
   smpl 1997m01+(!i-1) 2015M09+(!i-1)
   equation vecmeq{!i}. ??
   smpl 2015M09+!i 2015M09+!i
   vecmeq{!i}.fit tmp_yhat4 tmp_se4
   rollyhat4 = tmp_yhat4
   rollse4 = tmp_se4
next
smpl 2015m10 2018m09
genr rmse_var_ofs=@sqrt(@mean((dur-rollyhat4)^2))
genr mae_var_ofs=@mean(@abs(dur-rollyhat4))


I am not sure what to put where the ?? are. For my arma and error correction models, I was able to use the LS command to estimate the equation for each {!i} but I don't know how to do this for vecm. I tried putting in the model estimation code, var vecm1.ec(c,2) but it said there were no valid observations in my vecmeq. Is there a way to represent the vecm estimate as an equation? Thanks for your help.

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

Re: Estimating out of sample RMSE for VECM model using loops

Postby EViews Gareth » Thu Dec 20, 2018 3:09 am

Follow us on Twitter @IHSEViews

JonathanSvoboda
Posts: 3
Joined: Wed Dec 19, 2018 7:30 pm

Re: Estimating out of sample RMSE for VECM model using loops

Postby JonathanSvoboda » Thu Dec 20, 2018 3:38 am

I appreciate the info but unless I am missing something, it does not contain the solution to my problem.

my vecm model input is

Code: Select all

var vecm1.ec(c,2) 1 2 log(tsx) pr ur inf log(gdp) @ crisis terror

The problem is that this is does not gives specific values for an equation. So when I run

Code: Select all

equation vecmeq{!i}.var vecm1.ec(c,2) 1 2 log(tsx) pr ur inf log(gdp) @ crisis terror
my vecmeq is blank for each i.

Should I change my code for doing rolling window out of sample forecasts for vecm?

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

Re: Estimating out of sample RMSE for VECM model using loops

Postby EViews Gareth » Thu Dec 20, 2018 1:39 pm

I am confused - do you want to estimate a VEC or an equation? If it is a VEC, why are you using equation?
Follow us on Twitter @IHSEViews

JonathanSvoboda
Posts: 3
Joined: Wed Dec 19, 2018 7:30 pm

Re: Estimating out of sample RMSE for VECM model using loops

Postby JonathanSvoboda » Thu Dec 20, 2018 2:58 pm

It was the code our prof told us to use, at this point I am pretty sure he just made a mistake. Sorry for the trouble


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 22 guests