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?
Using for loops with GMM
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
Re: Using for loops with GMM
I do not think your problem has anything to do with the code. However, I understand your sample period is January 1993 - December 2008. The code you have written creates an expanding window rather than a rolling one. If you actually wanted to create a rolling window of span 60, then you had to change the beginning of the sample accordingly.
Near singular matrix is generally an issue of estimation process. It means that EViews is not able to take the inverse of a matrix (i.e. its determinant is zero). EViews begins the estimation with using the values stored in "c" coefficient vector in the workfile. And these values equal to zero at the beginning. After each estimation, final results are also stored in that vector and subsequent estimation attempt will take these values as input. It is also important that whether you receive the error message immediately after beginning the estimation or some time later. Since your equation appears to be of nonlinear form, the problem may either be caused by starting values or statistical properties of data itself.
All in all, you should provide more information on your problem or simply share your EViews worfile..
Near singular matrix is generally an issue of estimation process. It means that EViews is not able to take the inverse of a matrix (i.e. its determinant is zero). EViews begins the estimation with using the values stored in "c" coefficient vector in the workfile. And these values equal to zero at the beginning. After each estimation, final results are also stored in that vector and subsequent estimation attempt will take these values as input. It is also important that whether you receive the error message immediately after beginning the estimation or some time later. Since your equation appears to be of nonlinear form, the problem may either be caused by starting values or statistical properties of data itself.
All in all, you should provide more information on your problem or simply share your EViews worfile..
Re: Using for loops with GMM
Hi
I would like to know how to estimate Rolling Window GMM. (keeping the window size fixed). It would be nice if anyone directs me to the link estimating rolling window GMM on the Eviews forum or write it down.
Thanks a lot.
I would like to know how to estimate Rolling Window GMM. (keeping the window size fixed). It would be nice if anyone directs me to the link estimating rolling window GMM on the Eviews forum or write it down.
Thanks a lot.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13586
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Using for loops with GMM
There are lots of examples of doing rolling regression on the forum (you can do a search). Changing that to perform GMM rather than least squares is trivial.
Who is online
Users browsing this forum: No registered users and 2 guests
