Bookmark and Share

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


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

st: Concavity issues using -gmm- estimating parameters from a normal distribution


From   Keith Kapetan <[email protected]>
To   [email protected]
Subject   st: Concavity issues using -gmm- estimating parameters from a normal distribution
Date   Fri, 20 Aug 2010 11:05:21 -0500

Hi all,

I am using stata 11.1 to estimate some parameters and the mean and
standard deviation of a normal distribution using the -gmm- command.

I have data in the form of 1's and 0's with 1's occurring if it falls
left of a cutoff from some normal distribution.  I am trying to
determine the mean and standard deviation of this distribution and
also estimate the parameters that determine the cutoffs.

Here is some sample code illustrating what I am trying to do:

set obs 10000
gen random=20+10*rnormal()

gen X_1_NO=0
gen X_2_NO=0
gen X_1_MAYBE=0
gen X_2_MAYBE=0
gen X_1_YES=0
gen X_2_YES=0

replace X_1_NO = 1 if random<25
replace X_2_NO = 1 if random<35
replace X_1_MAYBE = 1 if random<15
replace X_2_MAYBE = 1 if random<20
replace X_1_YES = 1 if random<5
replace X_2_YES = 1 if random<10

gmm (X_1_NO-normal((25-{mean})/{
SD}))(X_2_NO-normal((35-{mean})/{SD}))(X_1_MAYBE-normal((15-{mean})/{SD}))(X_2_MAYBE-normal((20-{mean})/{SD}))(X_1_YES-normal((5-{mean})/{SD}))(X_2_YES-normal((10-{mean})/{SD})),
from(mean 5 SD 5) winitial(identity) onestep


gmm (X_1_NO-normal((1*{P}-{NO}-20)/10))(X_2_NO-normal((2*{P}-{NO}-20)/10))(X_1_MAYBE-normal((1*{P}-{MAYBE}-20)/10))(X_2_MAYBE-normal((2*{P}-{MAYBE}-20)/10))(X_1_YES-normal((1*{P}-{YES}-20)/10))(X_2_YES-normal((2*{P}-{YES}-20)/10)),
from(NO -20 MAYBE -5 YES 0 P .5) winitial(identity) onestep

gmm (X_1_NO-normal((1*{P}-{NO}-{mean})/{SD}))(X_2_NO-normal((2*{P}-{NO}-{mean})/{SD}))(X_1_MAYBE-normal((1*{P}-{MAYBE}-{mean})/{SD}))(X_2_MAYBE-normal((2*{P}-{MAYBE}-{mean})/{SD}))(X_1_YES-normal((1*{P}-{YES}-{mean})/{SD}))(X_2_YES-normal((2*{P}-{YES}-{mean})/{SD})),
from(NO -10 MAYBE -5 YES 0 P .5 mean 5 SD 5) winitial(identity)
onestep


The first gmm output correctly returns the mean and standard deviation
of 20 and 10 respectively.

The second gmm output correctly estimates the parameters P, NO, MAYBE, and YES.

The last gmm output is what I am trying to do, which combines the
first and second commands.  It does not converge and returns the error
"(not concave)" on every iteration.  Is there a way to estimate P, NO,
MAYBE, YES, mean, and SD using -gmm-?

Keith

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


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