Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: ivreg2 gmm or cue options and initial values


From   "Schaffer, Mark E" <M.E.Schaffer@hw.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: ivreg2 gmm or cue options and initial values
Date   Mon, 7 May 2007 19:32:56 +0100

Lukas, 

> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu 
> [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of 
> Lukas Mohler
> Sent: 07 May 2007 14:16
> To: statalist@hsphsun2.harvard.edu
> Subject: st: ivreg2 gmm or cue options and initial values
> 
> Dear Statalisters,
> 
> I have a question regarding the ivreg2 command. I'd like to 
> estimate a model with a constant and two endogenous variables 
> which are instrumented by up to 150 instruments (All of them 
> are dummies. If you want to know why I do this,
> see: Broda and Weinstein, Globalization and the Gains from 
> Trade, The Quarterly Journal of Economics, May 2006). So I 
> estimate the following:
> 
> ivreg2 y (x1 x2=z1 z2 z3 z4 ... z150), gmm robust
> 
> This, of course, is not a problem. But now I want to restrict 
> the coefficient of
> x1 to take only positive values (why: see paper mentioned 
> above...). In other words I need to perform a grid search 
> over values from zero to, say, 150 in specified steps. If I 
> understood the help file of ivreg2 correctly, this should be 
> possible with the cue option where I can specify the initial values.

I don't think the -cue- option will do what you want with respect to grid searches.  It simply minimizes the CUE-GMM objective function using Stata's -ml-.  Since -ml- doesn't do a grid seach, the -cue- option won't either.

Stata doesn't readily support inequality constraints.  When using -ml- you have to resort to tricks like estimating the log of a coefficient instead of the coefficient itself.

But maybe someone else has ideas here.

> My first question is: Is it correct that the cue option 
> allows for a grid search between specified values? If not, 
> does anybody know of commands that make that possible or even 
> of another software package?
> 
> Secondly, if I use the following command:
> 
> ivreg2 y (x1 x2=z1 z2 z3 z4 ... z150), cue cueinit(b) 
> cueoptions(???) robust
> 
> I have read the ml help and tried to pass options to the ml 
> routine, but I always get the error message "invalid syntax". 
> How can I correctly pass the options to perform my search?

Not sure why you're getting problems here.  Here are examples of passing different maximization algorithms using the toy auto dataset:

. sysuse auto

. ivreg2 price (mpg=weight trunk), cue robust cueopt(technique(nr))

initial:       neg GMM obj function -J = -.74672932
rescale:       neg GMM obj function -J = -.74672932
Iteration 0:   neg GMM obj function -J = -.74672932  
Iteration 1:   neg GMM obj function -J = -.74522321  
Iteration 2:   neg GMM obj function -J = -.74522317  

CUE estimation
--------------

... etc.

. ivreg2 price (mpg=weight trunk), cue robust cueopt(technique(dfp))

initial:       neg GMM obj function -J = -.74672932
rescale:       neg GMM obj function -J = -.74672932
Iteration 0:   neg GMM obj function -J = -.74672932  
Iteration 1:   neg GMM obj function -J = -.74535713  
Iteration 2:   neg GMM obj function -J = -.74531459  
Iteration 3:   neg GMM obj function -J = -.74531458  

CUE estimation
--------------

... etc.

-technique(nr)- seems to find a smaller minimum and gets there faster.

--Mark


> 
> Thanks.
> 
> Lukas
> 
> 
> ---
> Lukas Mohler
> Abteilung Aussenwirtschaft und Europäische Integration 
> Wirtschaftswissenschaftliches Zentrum Universität Basel 
> Petersgraben 51
> 4003 Basel
> Switzerland
> +41 61 267 07 70
> ---
> 
> 
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
> 

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index