Hello there,

I am using nls the first time for a non-linear regression with a logistic growth function:
startparam <- c(alpha=3e+07,beta=4000,gamma=2)
fit <- nls(dataset$V2~(( alpha / ( 1 + exp( beta - gamma * dataset$V1 ) ) ) ),data=dataset,start=startparam)

Everything works fine and i get good results. Now I would like to improve the results using my DUMMY Variable (dataset$V6) the runs half of the time 0 and then 1. This is my new nls:
startparam <- c(alpha=3e+07,beta=4000,gamma=2,delta=1000000)
fit <- nls(dataset$V2~(( alpha / ( 1 + exp( beta - gamma * dataset$V1 ) ) ) + (dataset$V6*dataset$V1*delta) ),data=dataset,start=startparam)

I get "Singular Gradient Matrice". May anyone give me the right nls function for this problem??

Regards

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to