[Rd] nonlinear fitting documentation error (PR#9749)

From: <bkerin_at_fastmail.fm>
Date: Fri, 22 Jun 2007 21:42:57 +0200 (CEST)


Full_Name: Britton Kerin
Version: docs on web
OS: linux
Submission from: (NULL) (216.67.49.115)

This section from the introduction to R confused me (reason below):

   11.7.1 Least squares

   One way to fit a nonlinear model is by minimizing the sum of the squared errors

   (SSE) or residuals. This method makes sense if the observed errors could have

   plausibly arisen from a normal distribution.

   Here is an example from Bates & Watts (1988), page 51. The data are:

> x <- c(0.02, 0.02, 0.06, 0.06, 0.11, 0.11, 0.22, 0.22, 0.56, 0.56,

              1.10, 1.10)

> y <- c(76, 47, 97, 107, 123, 139, 159, 152, 191, 201, 207, 200)

   The model to be fitted is:

> fn <- function(p) sum((y - (p[1] * x)/(p[2] + x))^2)

   In order to do the fit we need initial estimates of the parameters. One way to

   find sensible starting values is to plot the data, guess some parameter values,

   and superimpose the model curve using those values.

The problem is that fn is not the model to be fitted. The model is y = p1*x/(p2 + x). The function fn is the function to be minimized. So I think the sendtence 'The model to be fitted is:' should be changed to 'The function to be minimized is:" or something like that.



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sat 23 Jun 2007 - 13:09:30 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 24 Jun 2007 - 14:35:18 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.