Splitting up vectors

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

tode
Posts: 7
Joined: Mon Jun 29, 2009 8:07 am

Splitting up vectors

Postby tode » Wed Jul 08, 2009 5:56 am

Dear all,

I have estimated a pooled estimation (32 firms over 53 weeks) in the following manner:

Code: Select all

firmpool.ls y? @perreg 1 @perreg beta?
Now, I have 106 estimated coefficients (for every exogenous one estimate in each period). Following the Fama-MacBeth procedure, I am interesed in the averages of those estimates, whereas I have one coefficient vector by means of the following command:

Code: Select all

firmpool.updatecoef coef(106) gamma = c
My question is now, how to split the gamma vector with 106 rows in 2 vectors (gamma0 and gamma1) with 53 rows each (the first 53 being for the intercepts, the second 53 for the risk premia) in order to transform these 2 vectors in time series using the "mtos"-command and then be able to calculate the averages and so forth.

Additionally, I would like to know, whether anybody knows how to get a vectorization of a diagonal matrix (the coefficient covariance matrix...) to apply the same methodology for this vector then.

Any help is highly appreciated,

many thanks in advance

Tobi

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: Splitting up vectors

Postby EViews Glenn » Wed Jul 08, 2009 9:32 am

This should do the trick

Code: Select all

vector gamma1 = @subextract(c,1,1,53) vector gamma2 = @subextract(c,54,1,106) vector vars = @getmaindiagonal(firmpool.@coefcov)

tode
Posts: 7
Joined: Mon Jun 29, 2009 8:07 am

Re: Splitting up vectors

Postby tode » Wed Jul 08, 2009 11:09 am

Thank you, this was similar to that what I figured out in the meantime. It worked perfectly.

I still have two questions:

1) Did I understand the estimation right, when I said that the 53 estimates for each exogenous are the estimates from the cross-sectional regression in every point t between 1 and 53?

2) Is it possible to conduct inference with the mean of the gamma series in EViews - as Fama-MacBeth propose, or do I have to do it by hand?

Thanks in advance,

Tobi

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: Splitting up vectors

Postby EViews Glenn » Thu Jul 09, 2009 9:39 am

Since you are fully interactive in time, these should give you the equivalent of 53 cross-section regressions.

I'm not familiar with the Fama-McBeth methodology. From my 30 second Google search it sounds like you then want to take the vectors and use them in regression analysis. You can do this by creating a new workfile of length 53, copying the vectors over there, then using mtos to convert to series.

I don't know how the Fama-McBeth corrects for the estimation uncertainty in these coefficient values, so I really don't know what needs to be done in that regard.

tode
Posts: 7
Joined: Mon Jun 29, 2009 8:07 am

Re: Splitting up vectors

Postby tode » Thu Jul 09, 2009 10:56 am

ok, thank you for your effort.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest