[R] nls.lm

Peter Dalgaard pdalgd at gmail.com
Wed Oct 19 13:38:00 CEST 2016


This would seem to apply to the add-on package minpack.lm. That package has a maintainer...

Offhand, I would expect that this is a sanity check that, broadly speaking, prevents you from trying to solve a system of equations with more unknowns than equations. This is not a sufficient condition: Increasing the number of equations by adding trivial equations like 0=0 may kill the sanity check, but it doesn't make the system any more solvable.

-pd

> On 19 Oct 2016, at 13:21 , Mike meyer <1101011 at gmx.net> wrote:
> 
> 
> Greetings,
> 
> 
> 
> The description of nls.lm specifies that in minimizing a sum of squares of residuals
> the number of residuals must be no less than the dimension of the independent variable
> ("par").
> In fact the algorithm does not work otherwise (termination code 0).
> But this condition is senseless, since it can be vacuously satisfied by adding zero residuals
> without altering the minimization problem.
> Nor, to the best of my knowledge does the number of residuals play a role in the Levenberg-Marquardt
> algorithm.
> 
> So why does the R-implementation need this condition?
> 
> 
> 
> I am also not clear how the Jacobian should be formatted. I am assuming that it contains the gradients
> 
> of the residuals in the same order as the residuals occur in the function fn -- but this is not working for me.
> 
> ______________________________________________
> R-help at 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.



More information about the R-help mailing list