Using for loops with GMM
Posted: Thu Dec 18, 2008 5:36 am
I am trying to estimate some equations by GMM recursively and with a rolling window. In particular, I am trying to estimate the following:
for !j = 1 to 131
smpl 1993:1 1993:1+!j+60
equation recursive.gmm(b=v,deriv=aa) I=(1-C(4)-C(5))*(C(1)+C(2)*X+C(3)*Y)+C(4)*I(-1)+C(5)*I(-2) @ X(-1 TO -3) Y(-1 TO -3) C I(-1 TO -2)
next !j
But it tells me I have a near singular matrix. Is there an obvious error in this code? If I am not using the loop I can easily estimate the equation over the shorter sample (i.e. if estimate the equation for the sample when !j = 1) but when I use the loop I get the error message. Can you tell me how I can get round this bug please?
for !j = 1 to 131
smpl 1993:1 1993:1+!j+60
equation recursive.gmm(b=v,deriv=aa) I=(1-C(4)-C(5))*(C(1)+C(2)*X+C(3)*Y)+C(4)*I(-1)+C(5)*I(-2) @ X(-1 TO -3) Y(-1 TO -3) C I(-1 TO -2)
next !j
But it tells me I have a near singular matrix. Is there an obvious error in this code? If I am not using the loop I can easily estimate the equation over the shorter sample (i.e. if estimate the equation for the sample when !j = 1) but when I use the loop I get the error message. Can you tell me how I can get round this bug please?