Skip to content
Prev 383844 / 398502 Next

Fitting Richards' curve

The Richards' curve is analytic, so nlsr::nlxb() should work better than nls() for getting derivatives --
the dreaded "singular gradient" error will likely stop nls(). Also likely, since even a 3-parameter
logistic can suffer from it (my long-standing Hobbs weed infestation problem below), is
that the Jacobian will be near-singular. And badly scaled. Nonlinear fitting problems essentially
have different scale in different portions of the parameter space.

You may also want to "fix" or mask one or more parameters to reduce the dimensionality of the problem,
and nlsr::nlxb() can do that.

The Hobbs problem has the following 12 data values for time points 1:12

# Data for Hobbs problem
ydat  <-  c(5.308, 7.24, 9.638, 12.866, 17.069, 23.192, 31.443,
          38.558, 50.156, 62.948, 75.995, 91.972) # for testing
tdat  <-  seq_along(ydat) # for testing

An unscaled model is

eunsc  <-   y ~ b1/(1+b2*exp(-b3*tt))

This problem looks simple, but has given lots of software grief over nearly 5 decades. In 1974 an
extensive search had all commonly available software failing, which led to the code that evolved
into nlsr, though there are plenty of cases where really awful code will luckily find a good
solution. The issue is getting a solution and knowing it is reasonable. I suspect a Richards'
model will be more difficult unless the OP has a lot of data and maybe some external information
to fix or constrain some parameters.

JN
On 2020-05-13 5:41 a.m., Peter Dalgaard wrote: