-----------------------------------------------------------------------------------------
       log:  /Users/baum/doc/Courses 2008-2009/EC771 S2009/771ml4.smcl
  log type:  smcl
 opened on:  28 Mar 2009, 11:08:54


. . adotype norm1_lf ~/Library/Application Support/Stata/ado/personal/norm1_lf.ado:

program norm1_lf version 10.1 args lnf mu sigma quietly replace `lnf' = ln(normalden($ML_y1,`mu',`sigma')) end

. . set seed 20090328

. clear

. set obs 1000 obs was 0, now 1000

. g double x = _n/_N

. g double x2 = x^2

. summ x, meanonly

. g double z = (x - r(mean)) * rnormal()

. g double y = 5 + 2*x + - 3*x2 + z

. . summ

Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- x | 1000 .5005 .2888194 .001 1 x2 | 1000 .3338335 .2985711 1.00e-06 1 z | 1000 -.0038903 .2804079 -1.17843 1.467669 y | 1000 4.995609 .4630591 3.032495 6.608469

. . ml model lf norm1_lf (mu: y = x x2) (gamma:x2)

. . * ml check . . ml maximize

initial: log likelihood = -<inf> (could not be evaluated) feasible: log likelihood = -41075.215 rescale: log likelihood = -2342.9031 rescale eq: log likelihood = -1521.6621 Iteration 0: log likelihood = -1521.6621 (not concave) Iteration 1: log likelihood = -1266.6143 (not concave) Iteration 2: log likelihood = -1021.9066 (not concave) Iteration 3: log likelihood = -798.10473 (not concave) Iteration 4: log likelihood = -584.65947 (not concave) Iteration 5: log likelihood = -491.06004 (not concave) Iteration 6: log likelihood = -409.60067 (not concave) Iteration 7: log likelihood = -342.12113 Iteration 8: log likelihood = -199.91605 Iteration 9: log likelihood = -150.99519 Iteration 10: log likelihood = -141.2943 Iteration 11: log likelihood = -141.22432 Iteration 12: log likelihood = -141.22429 Iteration 13: log likelihood = -141.22429

Number of obs = 1000 Wald chi2(2) = 1579.78 Log likelihood = -141.22429 Prob > chi2 = 0.0000

------------------------------------------------------------------------------ y | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- mu | x | 1.85895 .1206016 15.41 0.000 1.622576 2.095325 x2 | -2.89124 .1191107 -24.27 0.000 -3.124693 -2.657787 _cons | 5.0304 .0253971 198.07 0.000 4.980623 5.080178 -------------+---------------------------------------------------------------- gamma | x2 | .046994 .0156557 3.00 0.003 .0163093 .0776786 _cons | .263331 .0077165 34.13 0.000 .248207 .278455 ------------------------------------------------------------------------------

. . log close log: /Users/baum/doc/Courses 2008-2009/EC771 S2009/771ml4.smcl log type: smcl closed on: 28 Mar 2009, 11:08:54 -----------------------------------------------------------------------------------------