[R] fitting an exp model

arivald rzepus.m at gmail.com
Thu Jan 19 18:38:03 CET 2012


Hello there, 

I am trying to fit an exponential model using nls to some data. 

#data 
t <- c(0,15,30,60,90,120,240,360,480)
var <- c(0.36,9.72,15.50,23.50,31.44,40.66,59.81,73.11,81.65)
df <- data.frame(t, var)

# model      
# var ~ a+b*(1-exp(-k*t))

# I'm looking for values of     a,b and k

#  formula 
#  mod <- nls(formula = var ~ a+b *(1-exp((-k)*t)), start=list(a=0, b=10,
k=0), trace=T)

# It fails and I get the following error - 
Error in nlsModel(formula, mf, start, wts) : 
  singular gradient matrix at initial parameter estimates 

I was trying different methods and looking for some solutions but nothing is
working...

Any suggestions how I can fix this? I appreciated any help 
Thanks in advance. 


--
View this message in context: http://r.789695.n4.nabble.com/fitting-an-exp-model-tp4310752p4310752.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list