# RE: st: nlcom, "Maximum number of iterations exceeded."

 From Valerie Orozco To "statalist@hsphsun2.harvard.edu" Subject RE: st: nlcom, "Maximum number of iterations exceeded." Date Mon, 23 Mar 2009 19:49:21 +0100

```Mauro,

I used to have the same problem of "Maximum number of iterations exceeded." when using “nlcom”.
Thanks to the Stata Technical Support, we understood that, in my case,like Maarten suggests you, it was a problem of small value of an estimated parameter (not far from 0), leading to a problem in the calculation of the derivative. In your example, it seems it is due to a problem with _b[/Umi] (especially when taking its square which makes it smaller!)

We introduced a trick in the program to avoid the problem. The idea is to multiply the small parameter in a first step and then recover it.

For your example, it will be something like that :

nlcom (ME0first : (1e+2)*( _b[/Uci]^2 + _b[/Uxi]^2 + _b[/Umi]^2 + _b[/Uii]^2)), post

nlcom ME0: _b[ME0first]/(1e+2)

Hope this helps you…
Valérie

-------------------------------
Valérie OROZCO
Toulouse School of Economics (INRA-GREMAQ)
21, allée de Brienne
F-31000 Toulouse, France

MF 426
+33 5 61 12 85 91
-------------------------------

________________________________
From

Maarten buis <maartenbuis@yahoo.co.uk<mailto:maartenbuis%40yahoo.co.uk>>

To

stata list <statalist@hsphsun2.harvard.edu<mailto:statalist%40hsphsun2.harvard.edu>>

Subject

RE: st: nlcom, "Maximum number of iterations exceeded."

Date

Sat, 21 Mar 2009 10:06:21 +0000 (GMT)

________________________________

--- Mauro.PISU@oecd.org  wrote:

> Thanks for your reply, but I do not think this is related to

> the problem I have with nlcom.   It is true that most

> probably there is some collinearity issue in the equations I

> am estimating (these are the output and input demand functions

> of a Symmetric Normalised Quadratic Profit Function by Diewert

> and Wales (1987) Econometrica).

> The problem I have has to do with nlcom. Even if I modify my

> equations in different manner I get the same kind of problem.

I have understood your situation to be the following:

You estimate a model with -nlsur-, "but for some standard errors

that are missing for unknown reason." After that, you ignore this

problem and still try to use -nlcom-, and -nlcom- won't converge.

-nlcom- is a postestimation command, it will use whatever model

you estimated before it as its input, in your case -nlsur-. If

there is a problem in your previous command then there will

also be a problem in your -nlcom- command. Missing standard

errors is a clear sign that there is something seriously wrong

with your -nlsur- command. So my comment was that you should

first fix your -nlsur- command before you start using -nlcom-,

and the problem with your -nlsur- command is probably the reason

that -nlcom- won't converge.

The comment about perfect colinearity was just one possible

thing that could cause your problems with -nlsur-.

-- Maarten

-----------------------------------------

Maarten L. Buis

Institut fuer Soziologie

Universitaet Tuebingen

Wilhelmstrasse 36

72074 Tuebingen

Germany

http://home.fsw.vu.nl/m.buis/

-----------------------------------------

-------------------------------
Valérie OROZCO
Toulouse School of Economics (INRA-GREMAQ)
21, allée de Brienne
F-31000 Toulouse, France

MF 426
+33 5 61 12 85 91
-------------------------------

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```