Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Nonlinear GMM estimation

From   "McLaughlin, David" <>
To   <>
Subject   st: Nonlinear GMM estimation
Date   Wed, 10 Nov 2010 21:30:29 -0500

Hi Everyone,

I have been trying to Stata 11.1 to instrument for x1 in the following
nonlinear equation using the gmm moment evaluator program: 


I created a moment evaluator program and called it with gmm (below):

program gmm_dsm
	version 11
	syntax varlist if, at(name)
	quietly {
		tempvar mu nu
		gen double `mu' =0 
       replace `mu' = `at'[1,1]*(1-exp(`at'[1,5]*x1))+
       + `at'[1,3]*(1-exp(`at'[1,5]*l2_x1))+
`at'[1,4]*(1-exp(`at'[1,5]*l3_x1))+ *`at'[1,6]*x2
		replace `varlist' = y - `mu'

gmm gmm_dsm if, nequations(1) parameters(b0 b1 b2 b3 gamma0 alpha)
instruments(x1 l1_x1 l2_x1 l3_x1  _instrument  x2, noconstant)
vce(cluster id) onestep from(b0 -.00056 b1 -.0028 b2 -.00087 b3 -.004
gamma -83 alpha .05)


When I run call the program, it begins to run and then I receive the
following error:

"could not calculate numerical derivatives -- flat or discontinuous
region encountered
could not calculate numerical derivatives -- flat or discontinuous
region encountered


1.) Can you use the moment evaluator function of gmm in Stata 11 to
estimate an equation that is nonlinear in the parameters?
2.) Is there a way to replicate the nonlinear results produced by nl()
using gm() for this equation considering I have more parameters than
"instruments" (covariates)?

Thanks in advance for any help you provide,


*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index