-------------------------------------------------------------------------------
log: /Users/baum/doc/Courses 2005-2006/EC77101/771ml2.smcl
log type: smcl
opened on: 20 Mar 2006, 14:33:40
.
. 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
. set seed 20060320
. g double y = 5 + 2*invnormal(uniform())
. summ
Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
y | 1000 5.043871 2.022937 -1.187671 10.62669
.
. 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 = -49695.686
improving initial values +++....+..
improve: log likelihood = -2781.4223
rescaling entire vector +.
rescale: log likelihood = -2375.8374
rescaling equations ....
rescale eq: log likelihood = -2375.8374
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 = -3265.0017
improving initial values ......+...
improve: log likelihood = -2633.6456
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 = -2633.6456
rescale: log likelihood = -2633.6456
rescale eq: log likelihood = -2180.1008
Iteration 0: log likelihood = -2180.1008
Iteration 1: log likelihood = -2124.5124
Iteration 2: log likelihood = -2122.9893
Iteration 3: log likelihood = -2122.9885
Iteration 4: log likelihood = -2122.9885
Number of obs = 1000
Wald chi2(0) = .
Log likelihood = -2122.9885 Prob > chi2 = .
------------------------------------------------------------------------------
y | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
mu |
_cons | 5.043871 .0639389 78.89 0.000 4.918554 5.169189
-------------+----------------------------------------------------------------
sigma |
_cons | 2.021925 .0452116 44.72 0.000 1.933312 2.110538
------------------------------------------------------------------------------
.
. ereturn list
scalars:
e(rc) = 0
e(ll) = -2122.988479288756
e(converged) = 1
e(rank) = 2
e(k) = 2
e(k_eq) = 2
e(k_dv) = 1
e(ic) = 4
e(N) = 1000
e(k_eq_model) = 1
e(df_m) = 0
e(chi2) = .
e(p) = .
macros:
e(cmd) : "ml"
e(predict) : "ml_p"
e(chi2type) : "Wald"
e(opt) : "ml"
e(depvar) : "y"
e(ml_method) : "lf"
e(user) : "norm1_lf"
e(crittype) : "log likelihood"
e(technique) : "nr"
e(properties) : "b V"
matrices:
e(b) : 1 x 2
e(V) : 2 x 2
e(gradient) : 1 x 2
e(ilog) : 1 x 20
e(ml_hn) : 1 x 2
e(ml_tn) : 1 x 2
functions:
e(sample)
.
. log close
log: /Users/baum/doc/Courses 2005-2006/EC77101/771ml2.smcl
log type: smcl
closed on: 20 Mar 2006, 14:35:33
-------------------------------------------------------------------------------