[R] Confidence intervals for predicted values in nls

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Jun 3 23:22:14 CEST 2004

On Thu, 3 Jun 2004, Cristina Silva wrote:

> I have tried to estimate the confidence intervals for predicted values of a
> nonlinear model fitted with nls. The function predict gives the predicted
> values and the lower and upper limits of the prediction, when the class of
> the object is lm or glm. When the object is derived from nls, the function
> predict (or predict.nls) gives only the predicted values. The se.fit and
> interval aguments are just ignored.

Thre are no such arguments either to the generic function nls() nor its 
"nls" method.  Please do read the documentation!

> Could anybody tell me how to estimate the confidence intervals for the
> predicted values (not the model parameters), using an object of class nls?

First you need to understand how to do this in theory: thereafter it is a 
programming task.  Hint: to find a confidence region for the parameters is 
not at all easy, as the examples in MASS (the book) and elsewhere show, 
and there is no guarantee that the confidence region for the prediction 
will be a single interval.

Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

More information about the R-help mailing list