-------------------------------------------------------------------------------
log: /Users/baum/doc/Courses 2005-2006/EC77101/771ml4.smcl
log type: smcl
opened on: 20 Mar 2006, 14:35:51
.
. adotype norm1_lf
~/ado/personal/norm1_lf.ado:
program norm1_lf
version 8.2
args lnf mu sigma
quietly replace `lnf' = ln(normden($ML_y1,`mu',`sigma'))
end
.
. set seed 20060320
. 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))*invnormal(uniform())
. 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 .0025314 .2973639 -1.219074 1.369022
y | 1000 5.002031 .4706544 3.001393 6.47493
.
. ml model lf norm1_lf (mu: y = x x2) (gamma:x)
.
. * ml check
.
. ml maximize
initial: log likelihood = -<inf> (could not be evaluated)
feasible: log likelihood = -41204.943
rescale: log likelihood = -2343.5254
rescale eq: log likelihood = -1531.6185
Iteration 0: log likelihood = -1531.6185 (not concave)
Iteration 1: log likelihood = -1074.3211 (not concave)
Iteration 2: log likelihood = -671.12941 (not concave)
Iteration 3: log likelihood = -494.33866 (not concave)
Iteration 4: log likelihood = -434.98511 (not concave)
Iteration 5: log likelihood = -393.0319
Iteration 6: log likelihood = -238.88231
Iteration 7: log likelihood = -206.65804
Iteration 8: log likelihood = -205.19308
Iteration 9: log likelihood = -205.19222
Iteration 10: log likelihood = -205.19222
Number of obs = 1000
Wald chi2(2) = 1541.45
Log likelihood = -205.19222 Prob > chi2 = 0.0000
------------------------------------------------------------------------------
y | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
mu |
x | 1.965804 .1310857 15.00 0.000 1.708881 2.222728
x2 | -2.966769 .1260598 -23.53 0.000 -3.213842 -2.719696
_cons | 5.008553 .0286887 174.58 0.000 4.952324 5.064781
-------------+----------------------------------------------------------------
gamma |
x | -.0140751 .0154107 -0.91 0.361 -.0442795 .0161293
_cons | .3041546 .0103278 29.45 0.000 .2839125 .3243967
------------------------------------------------------------------------------
.
. log close
log: /Users/baum/doc/Courses 2005-2006/EC77101/771ml4.smcl
log type: smcl
closed on: 20 Mar 2006, 14:35:55
-------------------------------------------------------------------------------