Re: [R] nls: example code throws error

2013-04-26 Thread Duncan Murdoch
On 13-04-26 10:14 AM, Ben Bolker wrote: Keith Jewell campden.co.uk> writes: Others have pointed out that the error is probably from an unclean environment. Completely OT, but "an unclean environment" sounds sort of scary to me. Like it contains zombies or something. Isn't that accurate

Re: [R] nls: example code throws error

2013-04-26 Thread Ben Bolker
Keith Jewell campden.co.uk> writes: > Others have pointed out that the error is probably from an unclean > environment. > Completely OT, but "an unclean environment" sounds sort of scary to me. Like it contains zombies or something. I don't know a better, short way to express the idea though

Re: [R] nls: example code throws error

2013-04-26 Thread Keith Jewell
On 26/04/2013 00:16, Steven LeBlanc wrote: > Greets, > > I'm trying to learn to use nls and was running the example code for an exponential model: > > > > Perhaps also, a pointer to a comprehensive and correct document that details model formulae syntax if someone has one? > > Thanks& Best

Re: [R] nls: example code throws error

2013-04-26 Thread Duncan Mackay
Hi Try x <- -(1:100)/10 set.seed(1) y <- 100 + 10 * exp(x / 2) + rnorm(x)/10 short cut to starting values lm(log(y) ~-log(x+10)) Call: lm(formula = log(y) ~ -log(x + 10)) Coefficients: (Intercept) 4.624 nlmod <- nls(y ~ A + B * exp(C * x), start=list(A=90, B=5,C=0.1)) Formula: y ~ A +

Re: [R] nls: example code throws error

2013-04-25 Thread Gabor Grothendieck
On Thu, Apr 25, 2013 at 7:16 PM, Steven LeBlanc wrote: > Greets, > > I'm trying to learn to use nls and was running the example code for an > exponential model: > >> x <- -(1:100)/10 >> y <- 100 + 10 * exp(x / 2) + rnorm(x)/10 >> nlmod <- nls(y ~ Const + A * exp(B * x)) > Error in B * x : non-nu

[R] nls: example code throws error

2013-04-25 Thread Steven LeBlanc
Greets, I'm trying to learn to use nls and was running the example code for an exponential model: > x <- -(1:100)/10 > y <- 100 + 10 * exp(x / 2) + rnorm(x)/10 > nlmod <- nls(y ~ Const + A * exp(B * x)) Error in B * x : non-numeric argument to binary operator In addition: Warning message: In nl