Hi,
I am using nls to fit a non linear function to some data but R keeps giving
me "singular gradient matrix at initial parameter estimates" errors.
For testing purposes I am doing this:
### R code ###
x <- 0:140
y <- 200 / (1 + exp(17 - x)/2) * exp(-0.02*x) # creating 'perfect' samples
with fitting model
yeps <- y + rnorm(length(y), sd = 2) # adding noise
# results in above error
fit = nls(yeps ~ p1 / (1 + exp(p2 - x) / p3) * exp(p4 * x))
###
>From what I've found in this list I think that my model is over-parameterized.
How can I work around that?
Thanks,
Felix
[[alternative HTML version deleted]]