Message-ID: <SL2P216MB00917C5389DFC4F8C2192EC0C8400@SL2P216MB0091.KORP216.PROD.OUTLOOK.COM>
Date: 2019-03-19T12:13:20Z
From: akshay kulkarni
Subject: 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]]