Copying matrices with row and column labels

For questions regarding programming in the EViews programming language.

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

ErikG
Posts: 78
Joined: Wed Jan 23, 2013 1:18 am

Copying matrices with row and column labels

Postby ErikG » Tue Jan 20, 2015 4:35 am

Hi,

I would like to copy a few matrices with row and column labels assigned with .setcollabels and .setrowlabels into another workfile. When I do this the labels are lost. How do I copy the matrices with the labels included?

Regards,
/Erik
Eviews 8.1 Jan 12 2015 build

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

Re: Copying matrices with row and column labels

Postby EViews Gareth » Tue Jan 20, 2015 9:38 am

Looks like you can't.

I'll try and make sure we get it in for EV9.
Follow us on Twitter @IHSEViews

ErikG
Posts: 78
Joined: Wed Jan 23, 2013 1:18 am

Re: Copying matrices with row and column labels

Postby ErikG » Tue May 26, 2015 12:55 am

Hi,
It appears you didn't manage to get this functionality into Eviews 9. It would be great if you could. It would also be supergreat if you could enable some functionality to access the information in the labels, like the following example:

For some matrix mX:


%rLabels = "A B"
mX.setrowlabels %rLabels

!Aindex = mX.rowlabelIndex("A")

EViews Jason
EViews Developer
Posts: 870
Joined: Tue Sep 16, 2008 3:50 pm

Re: Copying matrices with row and column labels

Postby EViews Jason » Tue May 26, 2015 11:30 am

There is a problem when setting the labels the original matrix, the labels are not updated in the window. If you close the matrix and reopen it you will see the new labels. We will get this fixed.

However the original issue of copying the labels does work in 9. Please verify your copy of 9 is up to date.

We will add the requested feature to our list of things to investigate.

ErikG
Posts: 78
Joined: Wed Jan 23, 2013 1:18 am

Re: Copying matrices with row and column labels

Postby ErikG » Tue May 26, 2015 10:44 pm

OK, excellent. But my Eviews version is up to date (Eviews 9, May 20 build) and the labels still don't follow along when I copy matrices between workfiles:

Code: Select all

WfCreate C:\temp\test.wf1 u 1 Matrix(2,2) mX = 1 mX.setrowlabels A B WfSave C:\temp\test.wf1 WfCreate C:\temp\testcopy.wf1 u 1 copy C:\temp\test.wf1::Untitled\mX show mX
In the display window mX has row labels R1 and R2 when I run this program.

/Erik.

EViews Jason
EViews Developer
Posts: 870
Joined: Tue Sep 16, 2008 3:50 pm

Re: Copying matrices with row and column labels

Postby EViews Jason » Wed May 27, 2015 12:59 pm

I see. Apparently copying via the user interface works but not command.

We will get if fixed.

ErikG
Posts: 78
Joined: Wed Jan 23, 2013 1:18 am

Re: Copying matrices with row and column labels

Postby ErikG » Mon Nov 16, 2015 2:26 am

Hi,

Is there, or will you sometime in the future, add functionality in Eviews so that the matrix row and column labels can be accessed?

along the lines of:
' MX is some labeled matrix
!Index1 = mx.rowlabelindex("GDP")

Regards,
Erik

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

Re: Copying matrices with row and column labels

Postby EViews Gareth » Mon Nov 16, 2015 9:24 am

We'll add it in the future.
Follow us on Twitter @IHSEViews

ErikG
Posts: 78
Joined: Wed Jan 23, 2013 1:18 am

Re: Copying matrices with row and column labels

Postby ErikG » Tue Dec 27, 2022 1:25 am

Thanks for adding the functionality of accessing rows and columns by their labels, very useful.

I've noticed a minor issue when copying matrices with row/column labels between workfiles: the labels are only copied when the source workfile is open. Compare the results below with and without the WfClose command:

Code: Select all

WfCreate(page=source) C:\temp\temp1.wf1 u 1 Matrix(3,3) mX = 3 mX.setrowlabels a b c mX.setcollabels Anne Bob Ceasar WfSave C:\temp\temp1.wf1 WfClose WfCreate(page=NewPage) C:\temp\temp2.wf1 u 1 Copy C:\temp\temp1.wf1::source\mX Show mX

EViews Jason
EViews Developer
Posts: 870
Joined: Tue Sep 16, 2008 3:50 pm

Re: Copying matrices with row and column labels

Postby EViews Jason » Fri Dec 30, 2022 9:44 am

We will get it fixed in the next patch


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests