[R] Fitting a asymmetric logistic peak curve

Marc marc.moragues at gmail.com
Fri Sep 25 18:33:02 CEST 2009



UseRs,

I am working on the analysis of green area growth in winter wheat and the 
effects of the amount of water on it. I am trying to fit a asymmetric 
logistic peak curve to my data as described by Royo et al., Europ. J Agronomy 
20 (2004) 419. I want to calculate the maximum green area, maximum growth 
rate and senescence for each cultivar in each treatment.

I started by calculating the means of all cultivars in all treatments in each 
sampling date and fit this data to the curve using the "nls" function in the 
stats package. I am new to non-linear regression and I am getting the error 
described below. After doing some search, it seems that the problem is the 
start values of the coefficients and some suggestions were done by 
linearizing the data in order to have better starting values. I have no idea 
how to do this with my data. 

Any help in solving this problem will be appreciated.

Marc.

> sessionInfo()
R version 2.9.2 (2009-08-24) 
i486-pc-linux-gnu 

locale:
LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=C;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] chron_2.3-30

> x
   ndays         y
1     99 0.4047951
2    112 0.5894659
3    125 0.6570246
4    133 0.7065050
5    139 0.6634155
6    148 0.7051833
7    162 0.6794740
8    169 0.6399054
9    175 0.4850703
10   182 0.2961120

> model3 <- nls(x ~ a + 
(b/e)*{(1+exp(ndays+d*log(e)-f)/d)^-((e+1)/e)}*{(exp(ndays+d*log(e)-f)/d)^-(e+1)/e}*(e+1)^{(e+1)/e},
+               data = x,start = list(a = -1, b = 0.5, f=-0.4, d=0.6, e=2)
+               )
Error in nlsModel(formula, mf, start, wts) : 
  singular gradient matrix at initial parameter estimates




More information about the R-help mailing list