------------------------------------------------------------------------------- log: /Applications/Stata/771ml3.smcl log type: smcl opened on: 19 Jan 2004, 11:48:43
. . 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
. . clear
. set obs 10 obs was 0, now 10
. g x = _n
. g y = 5 + 2*x + invnorm(uniform())
. summ
Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- x | 10 5.5 3.02765 1 10 y | 10 16.11174 6.241701 6.274896 25.23691
. . ml model lf norm1_lf (mu: y=x) (sigma:)
. . * ml check . . ml maximize
initial: log likelihood = -<inf> (could not be evaluated) feasible: log likelihood = -830.41092 rescale: log likelihood = -35.836055 rescale eq: log likelihood = -34.72431 Iteration 0: log likelihood = -34.72431 (not concave) Iteration 1: log likelihood = -32.088671 (not concave) Iteration 2: log likelihood = -26.543809 (not concave) Iteration 3: log likelihood = -23.623079 (not concave) Iteration 4: log likelihood = -21.241022 (not concave) Iteration 5: log likelihood = -19.125678 (not concave) Iteration 6: log likelihood = -17.391959 Iteration 7: log likelihood = -14.705621 (backed up) Iteration 8: log likelihood = -14.232856 Iteration 9: log likelihood = -14.213123 Iteration 10: log likelihood = -14.213118 Iteration 11: log likelihood = -14.213118
Number of obs = 10 Wald chi2(1) = 338.97 Log likelihood = -14.213118 Prob > chi2 = 0.0000
------------------------------------------------------------------------------ y | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- mu | x | 2.031813 .110358 18.41 0.000 1.815516 2.248111 _cons | 4.936771 .6847532 7.21 0.000 3.594679 6.278863 -------------+---------------------------------------------------------------- sigma | _cons | 1.002376 .2241381 4.47 0.000 .5630735 1.441679 ------------------------------------------------------------------------------
. . . log close log: /Applications/Stata/771ml3.smcl log type: smcl closed on: 19 Jan 2004, 11:48:50 -------------------------------------------------------------------------------