Dimension a series[vec[real]]

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.
jonasdovern
Posts: 97
Joined: Sat Apr 11, 2009 10:30 am

Dimension a series[vec[real]]

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

Re: Dimension a series[vec[real]]

Unread post 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
Post Reply