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.
Martin
Posts: 5
Joined: Thu Oct 18, 2007 11:26 pm

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

Unread post by Martin »

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. :)
moderator
Site Admin
Posts: 269
Joined: Thu Oct 19, 2006 4:33 pm

Unread post by moderator »

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)
Post Reply