Skip to content
Prev 278926 / 398502 Next

nls help

It's a scaling problem:

If you do this:

datum <- datum[order(datum$X),]

with(datum, plot(Y~X))
with(datum, lines(X, 3400*exp(-1867*X)))

you'll see that your initial guess is just so far gone that the nls()
optimizer can't handle it.

If you try a more reasonable initial guess it works fine:

fit <- nls(Y ~ a*exp(-k * X), datum, start=c(a=3400, k=1.867))

Michael
On Wed, Nov 30, 2011 at 12:14 PM, chuck.01 <CharlieTheBrown77 at gmail.com> wrote: