Store Covariance Matrix with actual variable name

For questions regarding programming in the EViews programming language.

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

mbeckr18
Posts: 13
Joined: Mon Oct 28, 2013 10:37 am

Store Covariance Matrix with actual variable name

Postby mbeckr18 » Tue Nov 18, 2014 12:44 pm

Hi,

I am currently trying to write a programm that directly saves the covariance matrices for a number of equations. However, I do not manage to display a covariance matrix that displays the actual variable names (instead the variables are numbered such as r1,r2 etc). Is there any way that I can automatically store the covariance matrix with the actual variable names (the same way it is displayed when you manually go to view and then select the covariance matrics?)

the code I currently use:
for !i=1 to N
matrix x_{!i} = ecm_{!i}.@coefcov
freeze(tabx{!i}) x_{!i}
next
for !i= 1 to N
tabx_{!i}.save(t=csv) H:\CSV\Cov_{!i}.csv
next

I would very much appreciate your help. I am sure it is possible but I really can not figure it out and it would help me a whole lot.

thank you very much in advance.

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

Re: Store Covariance Matrix with actual variable name

Postby EViews Gareth » Tue Nov 18, 2014 1:47 pm

Code: Select all

for !i=1 to N
freeze(tabx{!i}) ecm_{!i}.coefcov
tabx_{!i}.save(t=csv) H:\CSV\Cov_{!i}.csv
next
Follow us on Twitter @IHSEViews

mbeckr18
Posts: 13
Joined: Mon Oct 28, 2013 10:37 am

Re: Store Covariance Matrix with actual variable name

Postby mbeckr18 » Tue Nov 18, 2014 2:14 pm

Great, thank you so much :)


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 41 guests