mastermat and coefmat error message
Posted: Sun Oct 23, 2016 5:02 pm
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
{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