[R] Fw: problem with nlsLM function
akshay kulkarni
@k@h@y_e4 @end|ng |rom hotm@||@com
Tue Mar 19 13:26:09 CET 2019
dear members,
also,I can provide HM1,HM2 and HM3 if needed....
________________________________________
From: R-help <r-help-bounces using r-project.org> on behalf of akshay kulkarni <akshay_e4 using hotmail.com>
Sent: Tuesday, March 19, 2019 5:43 PM
To: R help Mailing list
Subject: [R] problem with nlsLM function
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 using 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.
[[alternative HTML version deleted]]
More information about the R-help
mailing list