[R] using lsoda() and nls() together

Dieter Menne dieter.menne at menne-biomed.de
Wed May 27 09:46:56 CEST 2009




bbouling wrote:
> 
> Thanks to Dieter Menne and Spencer Graves I started to get my way through
> lsoda()
> Now I need to use it in with nls() to assess parameters
> 
> I have a go with a basic example
> 
> dy/dt = K1*conc
> 
> I try to assess the value of K1 from a simulated data set with a K1 close
> to
> 2. Here is (I think) the best code that I've done so far even though it
> crashes
> when I call nls()
> 
> 

Not sure, but I believe you have taken the advice to produce reproducible
code too seriously and got trapped by the bold warning in nls:

Warning
Do not use nls on artificial "zero-residual" data.

The nls function uses a relative-offset convergence criterion that compares
the numerical imprecision at the current parameter estimates to the residual
sum-of-squares. This performs well on data of the form
...

Creating some noise in your data might help

Dieter



-- 
View this message in context: http://www.nabble.com/using-lsoda%28%29-and-nls%28%29-together-tp23727813p23737666.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list