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]

Re: st: GMM estimation.

From   Usman Gilani <>
Subject   Re: st: GMM estimation.
Date   Fri, 04 Jan 2013 21:06:52 +0000

Dear members,
Finally I managed to run the model. the problem was that I was giving the wrong initial values for parameters. 
Now this is what I'm getting but I'm worried it's going to be around 3 hours now  and  it stuck at step 2 iteration 3. 

but the Stata showing that the program is running. 

my question is should I wait or stop the process and check the model again?

. gmm (r1-({a0=0.5}*{a1=0.42}*w1*DP+(1-{a0}*DP)*lr1+{a0}*{a2=0.16}*DP*w2+{a0}*{a3= -0.013}*DP*w
> 3+{a0}*{a4= -0.026}*DP*y1+{a0}*{a5= 0.081}*DP*y2+{a0}*{a6= -0.660}*DP*y3)), xtinstruments(w1 
> w2 w3 y1 y2 y3 DP, lags(1/2)) winitial(xt L)
warning: 478 missing values returned for equation 1 at initial values

Step 1
Iteration 0:   GMM criterion Q(b) =  .15918243  
Iteration 1:   GMM criterion Q(b) =   .0002628  
Iteration 2:   GMM criterion Q(b) =  .00018952  
Iteration 3:   GMM criterion Q(b) =  .00018952  

Step 2
Iteration 0:   GMM criterion Q(b) =  .06458347  
Iteration 1:   GMM criterion Q(b) =  .04372914  
Iteration 2:   GMM criterion Q(b) =  .04367703  
Iteration 3:   GMM criterion Q(b) =  .04367703  

On 3 Jan 2013, at 19:36, Nick Cox <> wrote:

> I will just address Usman Gilani's comments on my original #1 and #3:
> 1. Al's re-parameterisation is not one-to-one. It would be pointless
> if it were, at most a change of symbolism or notation. If you want to
> insist on your parameterisation, you can't do what he suggests, but
> estimation is going to be way more difficult.
> 3. I can't help here on literature -- as I signalled, this is not my
> field -- but you should note that your code is not postulating the
> same error structure as your equations.
> Nick
> On Thu, Jan 3, 2013 at 7:22 PM, Usman Gilani <> wrote:
>> Thanks everyone,
>> @JVVerkuilen yeah it's quite challenging for me as i'm new to econometrics and Stata. I'm already following your advice. and I'll update statalisters  as soon as i manage to run this model.
>> @Nick, thanks for your reply.
>> 1. Well i'm not ignoring Al advice, I just didn't get how he did the reparametrization of the model. if i follow his model that has 7 parameters {A0..A6} where {A0} = {a0}*{a1} etc. then how i can tell Stata that parameter {A0} is a product of two parameters i.e. {a0}*{a1}.
>> 2. I'm following JVerkuilen method of running the simple model.
>> 3. the error term  DP*{a0}*e_(it). i get after substituting eq.(2) and eq.(3) in eq(1).  and this is quite new to me that the error term is consisting of variable and a parameter. I have seen some models in which error term is depending on parameter but could't find this case ( in which error term is depending on variable and a parameter).
>> If you have seen any research paper with this kind of model please let me know.
>> 4. I'm quiet new to econometrics this thing is holding me understanding the model. So I'm studying hard to understand the theory behind it.
>> regards,
>> Gilani.
>> On 3 Jan 2013, at 18:36, JVerkuilen (Gmail) <> wrote:
>>> On Thu, Jan 3, 2013 at 6:30 AM, Usman Gilani <> wrote:
>>>> my question, is that the correct way to input the equation ? because STATA
>>>> giving me the error message "could not calculate numerical derivatives --
>>>> flat or discontinuous region encountered"
>>>> please suggests me how can I perform this estimation
>>> As I said previously, this model is so complex it's next to impossible
>>> to diagnose what's going wrong. You have so many failure points
>>> there's no telling where it's breaking. Just a guess but I suspect
>>> that it's unidentified, but tracking that down will not be easy. It
>>> could also be that you are giving it bad starting values and it's
>>> diverging.
>>> Simplify dramatically and build up. Find an example of the kind of
>>> model you want to run that has only one or two variables in it using
>>> data that you know work. Never mind that it's not the model you want
>>> to run. Gain experience with specifying it in -gmm- syntax and seeing
>>> situations of what a working model looks like and then translate that
>>> over to a one or two variable subset of your data. Then build up to
>>> the model you want to run. If it crashes on only one or two variables
>>> then it's not identified. If it starts diverging or performing badly
>>> as you add variables, chances are good that you have an empirical
>>> identification issue (i.e., insufficient data). You can explore this
>>> by using simulated datasets.
>>> If you look at how Stata estimates a model such as -xtmelogit- it does
>>> exactly this strategy to generate good starting values.
>>> Yes, this seems like a pain in the zxx, but it's the only thing that
>>> works. These kinds of nonlinear models are simply not easy to work
>>> with and require a lot from the user.
> *
> *   For searches and help try:
> *
> *
> *

*   For searches and help try:

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