Saving Coefficients from an estimated VAR (eviews 7)

For questions regarding programming in the EViews programming language.

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

mike_d
Posts: 17
Joined: Thu Feb 09, 2012 7:52 am

Saving Coefficients from an estimated VAR (eviews 7)

Postby mike_d » Wed Feb 22, 2012 5:13 pm

Hi, I am running a few VAR and VEC models. I am trying to store the VAR estimated coefficients in a table defined earlier in the program. Tables are defined one at a time, however to save space the following loop gives the idea (probably could have just used to the loop but did not think of it when originally writing the code) ,

for !i = 1 to 3
table(741,25) var!i_coeff
next !i

When trying to store the estimated coefficients I get an error message saying that '.b' is used for vec not var. When I refer to the manuals it seems like .b(i,j) refers to the ith equation and jth regressor of a var. Any suggestions or guidance would be greatly appreciated, I have posted the peice of code I am using for estimating and saving the first 3 VAR coefficients.



if cdsv = 1 then
var var_est1_1.ls 1 1 s3 s9
freeze(roots_var_1_1) var_est1_1.arroots

for !z = 1 to 2
for !x = 1 to 6
var1_coeff(1,1) = var_est_1_1.b(!z,!x)
next !x
next !z

var var_est2_1.ls 1 1 s3 s11
freeze(roots_var_2_1) var_est2_1.arroots

for !z = 1 to 2
for !x = 1 to 6
var2_coeff(1,1) = var_est2_1.b(!z,!x)
next !x
next !z

var var_est3_1.ls 1 1 s3 s13
freeze(roots_var_3_1) var_est3_1.arroots

for !z = 1 to 2
for !x = 1 to 6
var3_coeff(1,1) = var_est3_1.b(!z,!x)
next !x
next !z

endif

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

Re: Saving Coefficients from an estimated VAR (eviews 7)

Postby EViews Gareth » Wed Feb 22, 2012 5:29 pm

As the error message indicates, the .B matrix is for VECs only. You want the .C matrix.

mike_d
Posts: 17
Joined: Thu Feb 09, 2012 7:52 am

Re: Saving Coefficients from an estimated VAR (eviews 7)

Postby mike_d » Wed Feb 22, 2012 5:52 pm

Sorry, I read it probably 5 times I do not know how I misread it repeatedly, must be too tired for this. Thanks for pointing that out though.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests