How to transform a matrix into a vector[series] variable

Use this forum to post questions about syntax problems or general programming issues. Questions on implementing a particular aspect of econometrics should go in "Econometrics Issues" below.

How to transform a matrix into a vector[series] variable

Postby Martin » Sat Oct 27, 2007 11:12 pm

Hi,
I have a matrix [rectangular matrix], A. I want to treat each column as a series, and transform A into a vec[ser] variable C. I encounter a problem that can be represented by the following code:

dec rec A(3,2)
comp A=||1,2|3,4|5,6||
dec vec[series] C
do i=1,2
do j=1,3
gset C(i) j j = A(j,i)
end do j
end do i

## P3. Instruction GSET Requires Parameter series
The Error Occurred At Location 0079 of loop/block
Line 2 of loop/block

Apprecitate for any comment. :)
Martin
 
Posts: 5
Joined: Thu Oct 18, 2007 11:26 pm

Postby moderator » Mon Oct 29, 2007 5:00 pm

GSET is used to set SERIES of ARRAYS, not ARRAYS of SERIES. You just use SET for the latter. Your code should work if you

a) Remember to dimension the array C:

dec vec[series] C(2)

b) replace the GSET with SET:

set C(i) j j = A(j,i)
moderator
Site Admin
 
Posts: 306
Joined: Thu Oct 19, 2006 4:33 pm


Return to Help With Programming

Who is online

Users browsing this forum: No registered users and 1 guest