nls() is a Model T Ford trying to drive on the Interstate. The code is quite old and uses approximations that work well when the user provides a reasonable problem, but in cases where there are mixed large and small numbers like yours could get into trouble.
Duncan Murdoch and I prepared the nlsr package to address some of the weaknesses (in particular we try to use analytic derivatives). The output of nlsr also gives the singular values of the Jacobian, though I suspect many R users will have to do some work to interpret those. You haven't provided a reproducible example. That's almost always the way to get definitive answers. Otherwise we're guessing as to the issue. JN On 2019-03-06 7:48 a.m., akshay kulkarni wrote: > dear members, > with reference to the attached message: > > I think I have found out the problem: > YLf13 has the structure: > YLf13 <- a*exp(-1000*LM1); LM1 is another vector. > > most of the YLf13 vector is getting populated with zeros, I think, because of > the very low value of exp(-1000*LM1). Is there any method in R wherein I can > work with these very low values? > > Or is the problem not related to the structure of YLf13? > > very many thanks for your time and effort... > yours sincerely, > AKSHAY M KULKARNI > > > ________________________________________ > From: R-help <r-help-boun...@r-project.org> on behalf of akshay kulkarni > <akshay...@hotmail.com> > Sent: Wednesday, March 6, 2019 6:02 PM > To: R help Mailing list > Subject: [R] inconsistency in nls output.... > > dear members, > I have the following nls output: > > Formula: YLf13 ~ (d + e * ((XL)^(1/3)) + f * log(LM3 + 18.81)) > > Parameters: > Estimate Std. Error t value Pr(>|t|) > d 5.892e-09 8.644e-10 6.817 2.06e-11 *** > e -6.585e-09 5.518e-10 -11.934 < 2e-16 *** > f 1.850e-10 2.295e-10 0.806 0.42 > --- > Signif. codes: 0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1 > > Residual standard error: 9.57e-10 on 677 degrees of freedom > > Number of iterations to convergence: 2 > Achieved convergence tolerance: 3.973e-08 > > ------ > Residual sum of squares: 6.2e-16 > > ------ > t-based confidence interval: > 2.5% 97.5% > d 4.195378e-09 7.589714e-09 > e -7.668142e-09 -5.501342e-09 > f -2.655647e-10 6.354852e-10 > > ------ > Correlation matrix: > d e f > d 1.0000000 -6.202339e-01 -7.832539e-01 > e -0.6202339 1.000000e+00 -2.127301e-05 > f -0.7832539 -2.127301e-05 1.000000e+00 > > > if I let XL = 1.1070513 and LM3 = 0.3919 , and consider the coeffs as given > above, the right hand side of the above equation is negative. > But YLf13 is always positive! How is this possible? Am I interpreting the > result of the nls output properly? Should I interpret the coeffs > differently? I have done hours of thinking over the above problem but > couldn't find any results... > > I cannot provide the full values of YLf13, XL and LM3 due to IPR > issues....please cooperate......however, if the only way to solve the problem > is to give these values, I would indeed give them..... > > Also forgive me if there is a minor mistake in my calculations... or a > typo.... > > 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. > ______________________________________________ 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.