-------------------------------------------------------------------------------
log: /Applications/Stata/771ml2.smcl
log type: smcl
opened on: 19 Jan 2004, 11:45:24
.
. 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 1000
obs was 0, now 1000
. g y = 5 + 2*invnorm(uniform())
. summ
Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
y | 1000 5.151726 1.981239 -1.025118 12.30185
.
. ml model lf norm1_lf (mu: y=) (sigma:)
.
. ml check
Test 1: Calling norm1_lf to check if it computes log likelihood and
does not alter coefficient vector...
Passed.
Test 2: Calling norm1_lf again to check if the same log likelihood value
is returned...
Passed.
------------------------------------------------------------------------------
The initial values are not feasible. This may be because the initial values
have been chosen poorly or because there is an error in norm1_lf and it
always returns missing no matter what the parameter values.
Stata is going to use ml search to find a feasible set of initial values.
If norm1_lf is broken, this will not work and you will have to press Break
to make ml search stop.
Searching...
initial: log likelihood = -<inf> (could not be evaluated)
searching for feasible values +
feasible: log likelihood = -51345.658
improving initial values ++.....+..
improve: log likelihood = -3189.7239
rescaling entire vector +.
rescale: log likelihood = -2700.2107
rescaling equations .+.+.
rescaling equations ....
rescale eq: log likelihood = -2133.2971
restarting tests...
------------------------------------------------------------------------------
Test 1: Calling norm1_lf to check if it computes log likelihood and
does not alter coefficient vector...
Passed.
Test 2: Calling norm1_lf again to check if the same log likelihood value
is returned...
Passed.
Test 3: Calling norm1_lf to check if 1st derivatives are computed...
test not relevant for method lf.
Test 4: Calling norm1_lf again to check if the same 1st derivatives are
returned...
test not relevant for method lf.
Test 5: Calling norm1_lf to check if 2nd derivatives are computed...
test not relevant for method lf.
Test 6: Calling norm1_lf again to check if the same 2nd derivatives are
returned...
test not relevant for method lf.
------------------------------------------------------------------------------
Searching for alternate values for the coefficient vector to verify that
norm1_lf returns different results when fed a different coefficient vector:
Searching...
initial: log likelihood = -<inf> (could not be evaluated)
searching for feasible values +
feasible: log likelihood = -3139.7497
improving initial values ++........
improve: log likelihood = -2894.5125
continuing with tests...
------------------------------------------------------------------------------
Test 7: Calling norm1_lf to check log likelihood at the new values...
Passed.
Test 8: Calling norm1_lf requesting 1st derivatives at the new values...
test not relevant for method lf.
Test 9: Calling norm1_lf requesting 2nd derivatives at the new values...
test not relevant for method lf.
------------------------------------------------------------------------------
norm1_lf HAS PASSED ALL TESTS
------------------------------------------------------------------------------
Test 10: Does norm1_lf produce unanticipated output?
This is a minor issue. Stata has been running norm1_lf with all
output suppressed. This time Stata will not suppress the output.
If you see any unanticipated output, you need to place quietly in
front of some of the commands in norm1_lf.
-------------------------------------------------------------- begin execution
---------------------------------------------------------------- end execution
.
. ml maximize
initial: log likelihood = -2894.5125
rescale: log likelihood = -2262.0075
rescale eq: log likelihood = -2262.0075
Iteration 0: log likelihood = -2262.0075
Iteration 1: log likelihood = -2207.4767
Iteration 2: log likelihood = -2102.3896
Iteration 3: log likelihood = -2102.1607
Iteration 4: log likelihood = -2102.1607
Number of obs = 1000
Wald chi2(0) = .
Log likelihood = -2102.1607 Prob > chi2 = .
------------------------------------------------------------------------------
y | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
mu |
_cons | 5.151726 .0626209 82.27 0.000 5.028991 5.27446
-------------+----------------------------------------------------------------
sigma |
_cons | 1.980248 .0442797 44.72 0.000 1.893461 2.067034
------------------------------------------------------------------------------
.
. ereturn list
scalars:
e(rc) = 0
e(ll) = -2102.160687481517
e(rank) = 2
e(k) = 2
e(k_eq) = 2
e(k_dv) = 1
e(ic) = 4
e(N) = 1000
e(df_m) = 0
e(chi2) = .
e(p) = .
macros:
e(cmd) : "ml"
e(chi2type) : "Wald"
e(opt) : "ml"
e(depvar) : "y"
e(user) : "norm1_lf"
e(crittype) : "log likelihood"
e(technique) : "nr"
matrices:
e(b) : 1 x 2
e(V) : 2 x 2
e(ilog) : 1 x 20
functions:
e(sample)
.
. log close
log: /Applications/Stata/771ml2.smcl
log type: smcl
closed on: 19 Jan 2004, 11:47:09
-------------------------------------------------------------------------------