I have daily observations on stock returns and have the following written the following code. the step size is 250 so I want to get annual betas using five years daily data and am rolling one year(250 days) forward. When I run the code, it is giving me the error:
{COEFMAT2 is not defined in matplace(mastermat, coefmat2, 3,1)}
Please help me with this?
for !i=1 to 3
!window = 1250
!step = 250
!length = @obsrange
equation eq1
!nrolls = @round((!length-!window)/!step)
matrix(6,!nrolls) mastermat
matrix(2,!nrolls) coefmat!i
!j=0
for !j = 1 to !length-!window+1-!step step !step
smpl @first+!j @first+!j+!window-1
equation eq1.ls(options) r!i c mrp
colplace(coefmat!i,eq1.@coefs,!j)
matplace(mastermat, coefmat1, 1,1)
matplace(mastermat, coefmat2, 3,1)
matplace(mastermat, coefmat3, 5,1)
next
next
mastermat and coefmat error message
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: mastermat and coefmat error message
Don't have three lines using matplace. Have one line placing coefmat!i. You probably need it outside your inner loop.
Re: mastermat and coefmat error message
Thanks Gareth. It does calculate the coefficients for the three stocks but if I don't give the row and column address, it only displays the coefficients for the 3rd stock only and shows 0.000 for all the coefficients of stock 1 and stock 2. Is there another short way around it as otherwise I have to write matplace(mastermat, coefmat!i, r,c) for 1200 stocks?
Who is online
Users browsing this forum: No registered users and 2 guests
