Re: R-beta: ms, nls, etc?

Douglas Bates (
11 Mar 1998 16:41:46 -0600

To: Bill Simpson <>
Subject: Re: R-beta: ms, nls, etc?
From: Douglas Bates <>
Date: 11 Mar 1998 16:41:46 -0600
In-Reply-To: Bill Simpson's message of Wed, 11 Mar 1998 16:25:53 -0600 (CST)

Bill Simpson <> writes:

> I tried to ?ms, ?nls and apparently these aren't implemented on R yet.
> However I seem to remember postings on this list having to do with fitting
> nonlinear models (no I don't mean GLM type fits, I have a REAL nonlinear 
> model: y=ax^b + c). So please tell me if it is possible to fit nonlinear
> models in R (by least squares or ML).

There is the nlm function in R for general unconstrained optimization.
Its syntax is different from that of ms in S so you have to do a bit
of work to map from one to the other.  In some ways the scoping rules
of R make it much easier to do nonlinear optimization than in S.

As for nls I would like to re-think the approach to nonlinear least
squares in S-like languages and come up with a version that could be
used either in R or in S.  That's on the "To Do" list but that list is 
pretty long so don't hold your breath.

If some enterprising person wanted to work on it I would be delighted
to offer sage advice.  I always wanted to be a sage and now that my
hair is all gray ...

Douglas Bates                  
Statistics Department                    608/262-2598
University of Wisconsin - Madison
r-help mailing list -- Read
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: