Re: [R] Error in nlsModel

2018-10-08 Thread William Dunlap via R-help
Weibull<-function(tet1, tet2,x){ 1-exp(-exp(tet1+tet2*log10(x))) } range(effectdata_without_controls$conc) # 0.000135696 0.000247044 range(effectdata_without_controls$effect) # [1] -7.010672 100.240287 nls(effect ~ Weibull(tet1, tet2, conc)) Your Weibull function has a range of

Re: [R] Error in nlsModel

2018-10-08 Thread ProfJCNash
I'm not the author of nlsModel, so would prefer not to tinker with it. But "singular gradient" is a VERY common problem with nls() that is used by nlsModel as I understand it. The issue is actually a singular Jacobian matrix resulting from a rather weak approximation of the derivatives (a simple f

Re: [R] Error in nlsModel

2018-10-08 Thread PIKAL Petr
Hi I do not want to dig too deep into your code so only 2 comments. 1.Try to plot your defined functions with starting parameters and with defined concentration something like plot(conc, Weibull(1,1, conc)) 2.Try to use conc with different units, something like conc1 <- conc*1000 Cheers Pet