[R] problem with nls....

akshay kulkarni @k@h@y_e4 @end|ng |rom hotm@||@com
Fri Mar 22 13:40:15 CET 2019


dear Martin,
                         I've not yet tried robust regression; I want to get to the root of the problem. I've replied to Ivan requesting how to get the Gradient,Hessian and the Jacobian of the objective function in an nls call. My question to you is, does robust regression takes an entirely different algorithm other than Gauss Newton? Will that help in my case? My point is ,I've two calls to nls, the variables only slightly different, but one converging but the other one not...If GN fails, what is the guarantee that the other succeeds(also, there is no problem with the residuals, they are approximately, normally distributed..so whether its robust regression or not, I am beset with same problem..!)

very many thanks for your time and effort...
yours sincerely,
AKSHAY M KULKARNI

________________________________
From: R-help <r-help-bounces using r-project.org> on behalf of Martin Maechler <maechler using stat.math.ethz.ch>
Sent: Friday, March 22, 2019 2:49 PM
To: Ivan Krylov
Cc: r-help using r-project.org
Subject: Re: [R] problem with nls....

>>>>> Ivan Krylov
>>>>>     on Thu, 21 Mar 2019 18:36:20 +0300 writes:

    > One of the assumptions made by least squares method is that the
    > residuals are independent and normally distributed with same parameters
    > (or, in case of weighted regression, the standard deviation of the
    > residual is known for every point). If this is the case, the parameters
    > that minimize the sum of squared residuals are the maximum likelihood
    > estimation of the true parameter values.

    > The problem is, your data doesn't seem to adhere well to your formula.
    > Have you tried plotting your HF1 - ((m/HF6) + 1) against HF6 (i.e. the
    > residuals themselves)? With large residual values (outliers?), the loss
    > function (i.e. sum of squared residuals) is disturbed and doesn't
    > reflect the values you would expect to get otherwise. Try computing
    > sum((HF1 - ((m/HF6) + 1))^2) for different values of m and see if
    > changing m makes any difference.

    > Try looking up "robust regression" (e.g. minimize sum of absolute
    > residuals instead of squared residuals; a unique solution is not
    > guaranteed, but it's be less disturbed by outliers).

Very good point, Ivan (as your previous ones on this thread -
thank you! it's great to have a couple of smart and patient
R-helpers such as you !!).

CRAN package robustbase
     https://cran.r-project.org/package=robustbase

has function nlrob()  to do non-linear
regression *robustly*, even using several methods, the default
one using robustly re-weighted nls().  I'm the maintainer of the
package and have been the "moderator" of the current nlrob()
function, but as you can read on it's help page, I'm not the
author of that function and its submethods:
https://www.rdocumentation.org/packages/robustbase/versions/0.93-4/topics/nlrob

Martin Maechler
ETH Zurich

    > --
    > Best regards,
    > Ivan

    > ______________________________________________
    > 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.

______________________________________________
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