Use a group of variables in a VAR system

For questions regarding programming in the EViews programming language.

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

Gloria
Posts: 9
Joined: Sat Dec 01, 2012 1:20 am

Use a group of variables in a VAR system

Postby Gloria » Thu Jan 10, 2013 6:50 am

Hi Gareth,

I would like to solve a VAR of 3 variables but instead of entering the 3 variable names in the command line I would like to create a group and run it for the group of variables, so that if I change any variable then I just need to change it in the group. I have tried as follows but it is not working.
Thanks,
Gloria

FOR %i series1 series2 series3
GROUP VARM1
VARM1.add {%i}
NEXT
FOR !j=1 to VARM1.@count 'counter for the variables in the group
%inamem1 = VARM1.@seriesname(!j)
FOR !i=1 to 200
SMPL %startestim %endestim_m
VAR VAR01_!i
VAR01_!i.ls 1 6 {%inamem1}_!i
NEXT
NEXT


FOR %i deu_expsit1 d_deuorder deu_prod_t1
GROUP VARM1
VARM1.add {%i}
NEXT
FOR !j=1 to VARM1.@count 'counter for the variables in the group
%inamem1 = VARM1.@seriesname(!j)

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

Re: Use a group of variables in a VAR system

Postby EViews Gareth » Thu Jan 10, 2013 9:14 am

I'm not sure why your code is not working (I haven't tried running it), but it is certainly possible to estimate a VAR using a group:

Code: Select all

create u 100 series y=nrnd series x=nrnd series z=nrnd group vars x y z var var01.ls 1 2 vars

Gloria
Posts: 9
Joined: Sat Dec 01, 2012 1:20 am

Re: Use a group of variables in a VAR system

Postby Gloria » Fri Jan 11, 2013 12:58 am

Thanks for your help Gareth, it was easier as I was doing.
Best,
Gloria

Gloria
Posts: 9
Joined: Sat Dec 01, 2012 1:20 am

Re: Use a group of variables in a VAR system

Postby Gloria » Fri Jan 11, 2013 2:31 am

Hi again Gareth,

However, now I am trying to run a BVAR for a group of variables and it does not work (it is perfectly running for a standard EViews VAR), is this option not possible for a BVAR? Thanks, Gloria

FOR !i=1 to @dtoo(%finsoft)-@dtoo(%startoos_m)+1
GROUP VARM1_!i
FOR !j=1 to VARM1.@count 'counter for the variables in the group
%inamem1 = VARM1.@seriesname(!j)
VARM1_!i.ADD {%inamem1}_!i
NEXT

SMPL %startestim %endestim_m
BVAR(m=VAR1_!i, prior=!prior) !maxlag VARM1_!i
NEXT

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

Re: Use a group of variables in a VAR system

Postby EViews Gareth » Fri Jan 11, 2013 7:45 am

Probably not for the Add-in, no.

Should work on the in-built BVAR estimation in EViews 8, though.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest