Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: where next after nl?

From   "Keith Dear" <>
To   <>
Subject   st: where next after nl?
Date   Mon, 17 Jan 2011 17:40:51 +1100

I've been trying to fit nonlinear models using -nl-, and finding that it
often fails to find a good solution. There are four (sometimes up to 8)
nonlinear parameters, plus a somewhat arbitrary linear model (I can
simplify the linear part by analysing subsets of the data and ignoring
effects I know are there). I have done what I can to encourage nl to
work by (for example) using the log scale for parameters I know to be
positive. Sometimes it works, often not: by "works", I mean that the
fitted model passes through the data; the "not" cases are obviously
wrong, nothing subtle about it. And it's unstable: small changes to the
linear part can make all the difference.

In desperation, thinking maybe I've just written a lousy model, I turned
to Excel, and found that "solver" finds good solutions quickly and with
no drama (they look right, and have smaller RSS than nl found). So, now
I am inclined to ditch nl (and perhaps think more kindly of MS!).

My question is, does others' experience suggest that I am likely to have
more joy with ml than nl, or should I just go elsewhere such as R's nls?
(or, god forbid, should I try to do it all in Excel?). Other options?

(winXP, 11/MP2)

Dr Keith Dear
Senior Fellow
National Centre for Epidemiology and Population Health
ANU College of Medicine, Biology and Environment
Building 62, cnr Mills and Eggleston Roads
Australian National University
Canberra ACT 0200 Australia
CRICOS provider #00120C
T: 02 6125 4865
F: 02 6125 0740
M: 0424 450 396

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index