[R] non linear modelling with nls: starting values

Sebastian P. Luque spluque at gmail.com
Mon Sep 18 16:59:50 CEST 2006


Hi,

I'm trying to fit the following model to data using 'nls':


y = alpha_1 * beta_1 * exp(-beta_1 * x) +
    alpha_2 * beta_2 * exp(-beta_2 * x)


and the call I've been using is:


nls(y ~ alpha_1 * beta_1 * exp(-beta_1 * x) +
        alpha_2 * beta_2 * exp(-beta_2 * x),
    start=list(alpha_1=4, alpha_2=2, beta_1=3.5, beta_2=2.5),
    trace=TRUE, control=nls.control(maxiter = 200))


So the model has 4 parameters (alpha_1, alpha_2, beta_1, beta_2), but
providing appropriate starting values is proving difficult.  Although the
data could reasonably be fit with this model, the procedure is exiting
with "singular gradient matrix at initial parameter estimates".  How can
one obtain appropriate starting values, assuming that is really the
problem?  The archives show some suggestions to use 'optim', but that
requires starting values too, so I'm not sure how to proceed.

Searching for self-starting functions, I found that there's one for a
bi-exponential model, which is very similar to the one I'm trying to fit.
Would it be reasonable to create a modified version of this function, so
that it returns a value that can be used for the model above?  I would
greatly appreciate any comments and suggestions.


-- 
Seb



More information about the R-help mailing list