From ripley at stats.ox.ac.uk  Wed Oct 11 11:42:31 2006
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Wed, 11 Oct 2006 10:42:31 +0100 (BST)
Subject: [Rd] nls function does not use subset argument (PR#9290)
In-Reply-To: <20061011092903.BB944407EA@slim.kubism.ku.dk>
References: <20061011092903.BB944407EA@slim.kubism.ku.dk>
Message-ID: <Pine.LNX.4.64.0610111038420.6508@gannet.stats.ox.ac.uk>

This is not the place to ask a question: do read the FAQ.

?nls shows that nls does have a 'subset' argument, and it does work.
Compare

> ?nls
> x <- 1:10
> y <- 2*x + 3                            # perfect fit
> yeps <- y + rnorm(length(y), sd = 0.01) # added noise
> nls(yeps ~ a + b*x, start = list(a = 0.12345, b = 0.54321),
+     trace = TRUE)
1360.779 :  0.12345 0.54321
0.000778241 :  3.002946 1.999563
0.000778241 :  3.002946 1.999563
Nonlinear regression model
   model:  yeps ~ a + b * x
    data:  parent.frame()
        a        b
3.002946 1.999563
  residual sum-of-squares: 0.000778241
> nls(yeps ~ a + b*x, start = list(a = 0.12345, b = 0.54321),
+     trace = TRUE, subset=1:9)
1056.760 :  0.12345 0.54321
0.0007055261 :  3.000838 2.000138
0.0007055261 :  3.000838 2.000138
Nonlinear regression model
   model:  yeps ~ a + b * x
    data:  parent.frame()
        a        b
3.000838 2.000138
  residual sum-of-squares: 0.0007055261

I find your comments baffling: please provide a reproducible example of 
your claims.


On Wed, 11 Oct 2006, tadakado at gmail.com wrote:

> Full_Name: Tadashi Kadowaki
> Version: 2.4.0
> OS: Redhat Linux 9
> Submission from: (NULL) (58.12.166.67)
>
>
> Doesn't nls function support subset?  It seems not to work.
> And, there are no information in the online help.
> Has it sunk into oblivion?
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
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




[Rd] nls function does not use subset argument (PR#9290)
Prof Brian Ripley