Quantcast
Channel: The Stata Blog - Latest Comments
Viewing all articles
Browse latest Browse all 1129

Re: Understanding the generalized method of moments (GMM): A simple example

$
0
0

Hi David,

Thanks for your reply. I checked the simulation once again and found that the error is caused by the gmm based on the variance moment condition. As asked for by the code it stopped iterating after the 200th iteration but instead of prompting the scalar e(converged), it gave me the error message:

Iteration 200: GMM criterion Q(b) = .10992747 (backed up)
convergence not achieved
r(430);

Clearly, a naive but I guess not the best solution is the use of capture with the gmm estimation command. This did the job:

capture quietly gmm ( (y-{d=`d_a'})^2 - 2*{d}) , instruments( ) ///
winitial(unadjusted) onestep conv_maxiter(200)
if _rc==430 {
local d_v = .
}
else {
if e(converged)==1 {
local d_v = _b[d:_cons]
}
else {
local d_v = .
}
}

So I would say, problem solved for the moment. Although it still suprises me why the error message appeared. But is not as important to take up your precious time.

Best,
Roberto

Btw: I am using Stata 13 (I should have said.).


Viewing all articles
Browse latest Browse all 1129

Trending Articles