Page 1 of 1

Automatic VAR selection

Posted: Tue Jul 24, 2012 6:49 pm
by camilogong
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

Automatic VAR selection

Posted: Tue Jul 24, 2012 7:09 pm
by EViews Gareth
Which line causes the error?

Re: Automatic VAR selection

Posted: Tue Jul 24, 2012 7:11 pm
by camilogong
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.

Re: Automatic VAR selection

Posted: Tue Jul 24, 2012 10:20 pm
by EViews Gareth
Try:

Code: Select all

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

Re: Automatic VAR selection

Posted: Wed Jul 25, 2012 6:39 am
by camilogong
Thanks, that solves the problem.