[R] problem with nls....

Ivan Krylov kry|ov@r00t @end|ng |rom gm@||@com
Thu Mar 21 16:36:20 CET 2019


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

-- 
Best regards,
Ivan



More information about the R-help mailing list