|
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: weird error in -nlcom-
Hi - In Stata 10 (Windows), after runnning a -ml- program (of my own), I
tried to use -nlcom- .
Depending on what values I give it (see below) it either works, or gives
a peculiar error messgae " maximum number of iterations exceeded".
First of all, -nlcom- is supposed to use the delta method, which doesn't
involve iterating anything - so what's going on?
Even more mystifying is that if I slightly change the inputs, it works
or doesn't work (see below)
. run flare_norm t1 t2 868 366 1900 2100
Initial Values: t0 = 2100, sig = 868 K = 366
Number of obs =
365
Wald chi2(0) =
.
Log likelihood = -1151.2251 Prob > chi2 =
.
------------------------------------------------------------------------
------
| Coef. Std. Err. z P>|z| [95% Conf.
Interval]
-------------+----------------------------------------------------------
------
lnK |
_cons | 5.9161 .0525831 112.51 0.000 5.813039
6.019161
-------------+----------------------------------------------------------
------
lnsig |
_cons | 6.703776 .0463619 144.60 0.000 6.612908
6.794644
-------------+----------------------------------------------------------
------
t0 |
_cons | 1857.695 45.25929 41.05 0.000 1768.988
1946.402
------------------------------------------------------------------------
------
which is fine. Now I try some -nlcom- statements (see below)
. nlcom exp([lnK]_cons)*(norm( (2039-[t0]_cons)/exp([lnsig]_cons)) -
norm( (1679-[t0]_cons)/exp([lnsig]
> _cons)))/5
_nl_1: exp([lnK]_cons)*(norm(
(2039-[t0]_cons)/exp([lnsig]_cons)) - norm( (1679-[t0]_cons)/exp(
> [lnsig]_cons)))/5
------------------------------------------------------------------------
------
| Coef. Std. Err. z P>|z| [95% Conf.
Interval]
-------------+----------------------------------------------------------
------
_nl_1 | 12.96116 .8592571 15.08 0.000 11.27704
14.64527
------------------------------------------------------------------------
------
This one works. Now if I change "2039" to "2038" and "1679" to "1678",
it crashes:
. nlcom exp([lnK]_cons)*(norm( (2038-[t0]_cons)/exp([lnsig]_cons)) -
norm( (1678-[t0]_cons)/exp([lnsig]
> _cons)))/5
_nl_1: exp([lnK]_cons)*(norm(
(2038-[t0]_cons)/exp([lnsig]_cons)) - norm( (1678-[t0]_cons)/exp(
> [lnsig]_cons)))/5
Maximum number of iterations exceeded.
r(498);
Any ideas what's happening? By the way, the same sort of thing was
occuring in Stata 9.
Al Feiveson
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/