dear members, I am getting the "singular gradient error" when I use nls for a function of two variables: > formulaDH5 HM1 ~ (a + (b * ((HM2 + 0.3)^(1/2)))) + (A * sin(w * HM3 + a) + C)
HM1 is the response variable, and HM2 and HM3 are predictors. The problem is I get the same error even when I use nlsLM(in the minpack.lm package): > nonlin_modDH5 <- nlsLM(formulaDH5, start = list(a = 0.43143, b = 2,A = 0.09,w > = 0.8,a = 0.01,C = 0.94)) Error in nlsModel(formula, mf, start, wts) : singular gradient matrix at initial parameter estimates > nonlin_modDH5 <- nlsLM(formulaDH5, start = list(a = 1, b = 2,A = 0.09,w = > 0.8,a = 0.01,C = 0.94)) Error in nlsModel(formula, mf, start, wts) : singular gradient matrix at initial parameter estimates > nonlin_modDH5 <- nlsLM(formulaDH5, start = list(a = 1, b = 2,A = 0.09,w = > 0.8,a = 0.01,C = 2)) Error in nlsModel(formula, mf, start, wts) : singular gradient matrix at initial parameter estimates I came to know that nlsLM converges when nls throws a singular gradient error. What is happening above? Can the problem get solved if I use nls.lm function(in the minpack.lm package) instead? very many thanks for your time and effort.... yours sincerely, AKSHAY M KULKARNI [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.