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.

Dimension a series[vec[real]]

Postby jonasdovern » Thu Oct 29, 2009 9:55 am

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

Re: Dimension a series[vec[real]]

Postby moderator » Thu Oct 29, 2009 12:37 pm

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
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