Page 1 of 1

Dimension a series[vec[real]]

Posted: Thu Oct 29, 2009 9:55 am
by jonasdovern
How do I dimension the vectors in a series of vectors?

I did the following:

Code: Select all

decl series[vec[real]] test
Now, I would like to make all "entries" of test be 8-dimensional vectors. Something like

Code: Select all

dim test(2006:1)(8)
does not work apparently. Does anybody have a solution? Regards, Jonas

Re: Dimension a series[vec[real]]

Posted: Thu Oct 29, 2009 12:37 pm
by moderator
The series needs to be defined over some range of observations before you can dimension the array stored at a particular entry.

The best way to do this is usually to use the GSET instruction. Depending on what you want to achieve, you can probably take care of dimensioning all the arrays with the GSET as well. Here's a simple example that dimensions the vectors to have 10 elements, and initializes them to zero:

gset test = %zeros(10,1)

Regards,
Tom Maycock