Automatic VAR selection

For questions regarding programming in the EViews programming language.

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

camilogong
Posts: 6
Joined: Tue Jul 24, 2012 6:44 pm

Automatic VAR selection

Postby camilogong » Tue Jul 24, 2012 6:49 pm

I am running the following program to select the lag order in a VAR. However, I get an illegal lag specification when I run it. Does anyone know why this is?

var var_{%k}
var_{%k}.ls 1 4 d_oil d_fao_d d_{%k}_cpif d_{%k}_fx @ dum1 dum2 dum3
var_{%k}.laglen(4,vname=vec_{%k})
scalar j=vec_{%k}(4)
var_{%k}.ls 1 j d_oil d_fao_d d_{%k}_cpif d_{%k}_fx @ dum1 dum2 dum3
var_{%k}.svar(rtype=patsr, namea=mata, nameb=matb, f0=n, nostop)
freeze(ir_{%k}) var_{%k}.impulse(24,m,imp=unit, se=a) d_{%k}_cpif @ d_fao_d

Rgds

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

Automatic VAR selection

Postby EViews Gareth » Tue Jul 24, 2012 7:09 pm

Which line causes the error?

camilogong
Posts: 6
Joined: Tue Jul 24, 2012 6:44 pm

Re: Automatic VAR selection

Postby camilogong » Tue Jul 24, 2012 7:11 pm

var_{%k}.ls 1 j d_oil d_fao_d d_{%k}_cpif d_{%k}_fx @ dum1 dum2 dum3


Aparently the command does not recognize the scalar j as a number. That is muy guess.

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

Re: Automatic VAR selection

Postby EViews Gareth » Tue Jul 24, 2012 10:20 pm

Try:

Code: Select all

var_{%k}.ls 1 {j} d_oil d_fao_d d_{%k}_cpif d_{%k}_fx @ dum1 dum2 dum3

camilogong
Posts: 6
Joined: Tue Jul 24, 2012 6:44 pm

Re: Automatic VAR selection

Postby camilogong » Wed Jul 25, 2012 6:39 am

Thanks, that solves the problem.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests