Re: [R] nls.lm

2016-10-23 Thread Mike meyer
forts. I look forward to the results. Best regards, Michael unaffiliatd > Gesendet: Freitag, 21. Oktober 2016 um 09:39 Uhr > Von: "Berend Hasselman" > An: "Mike meyer" <1101...@gmx.net> > Cc: ProfJCNash , "r-help@r-project.org" > > Betr

Re: [R] nls.lm

2016-10-21 Thread ProfJCNash
Berend's point is well-taken. It's a lot of work to re-jig a code, especially one more than 30 years old. On the other hand, nlmrt is all-R, and it does more or less work on underdetermined systems as I illustrated in a small script. The changes needed to treat the problem as Mike suggests are

Re: [R] nls.lm

2016-10-21 Thread Berend Hasselman
> On 21 Oct 2016, at 06:00, Mike meyer <1101...@gmx.net> wrote: > > Let's take a different view of the problem. > Given f=(f_1,...,f_m):R^n -> R^m we want to minimize ||f(x)||. > > What distinguishes this from a general minimization problem is that you know > the structure of the > objective fu

Re: [R] nls.lm

2016-10-20 Thread Mike meyer
Cc: "r-help@r-project.org" , "Berend Hasselman" > > Betreff: Re: [R] nls.lm > > From a statistician's point of view, "nonsense" may be OK, but there are > other applications of R where > (partial or non-unique) solutions may be needed. > &

Re: [R] nls.lm

2016-10-20 Thread ProfJCNash
>From a statistician's point of view, "nonsense" may be OK, but there are other >applications of R where (partial or non-unique) solutions may be needed. Yesterday I raised the question of how nonlinear least squares could be adapted to underdetermined problems. Many folk are unaware of such pos

Re: [R] nls.lm

2016-10-20 Thread S Ellison
> How do you reply to a specific post on this board instead of the thread? You can reply to the individual, as I just did. But I strongly suggest that you don't. You would be much better advised to discontinue debate and follow the essential advice given by nls.lm, which - no matter whether cou

Re: [R] nls.lm

2016-10-19 Thread David Winsemius
> On Oct 19, 2016, at 12:16 PM, Mike meyer <1101...@gmx.net> wrote: > > How do you reply to a specific post on this board instead of the thread? > I am too incompetent to find this out myself. Most of us use a mail-client that supports 'reply-to-all'. And the Posting Guide asks you to include s

[R] nls.lm

2016-10-19 Thread Mike meyer
How do you reply to a specific post on this board instead of the thread? I am too incompetent to find this out myself. Thanks, Michael unaffiliated __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listin

Re: [R] nls.lm

2016-10-19 Thread Berend Hasselman
> On 19 Oct 2016, at 19:12, Mike meyer <1101...@gmx.net> wrote: > >> From my reading of the above cited document I get the impression that the >> algorithm > (algorithm 3.16, p27) can easily be adapted to handle the case m In this case the Jacobian Jf(x) is mxn and the matrix A(x)=Jf(x)'Jf(x) is

[R] nls.lm

2016-10-19 Thread Mike meyer
And finally, to put to rest the notion that the number of residuals is in any way significant for the solution of the least squares problem I submit to you the function f(x,y)=(x²+y²)² of 2 variables but only one residual f_1(x,y)=x²+y² which nonetheless has a unique minimum at the point (0,0).

Re: [R] nls.lm

2016-10-19 Thread peter dalgaard
> On 19 Oct 2016, at 17:47 , Mike meyer <1101...@gmx.net> wrote: > Jf(x)'Jf(x) nonsingular, for all x, is a reasonable condition, m>=n is not. If Jf(x) has more columns than rows, then Jf(x)'Jf(x) is certainly singular. The reverse is not true, but what's wrong with a simple pre-check? What yo

[R] nls.lm

2016-10-19 Thread Mike meyer
>From my reading of the above cited document I get the impression that the >algorithm (algorithm 3.16, p27) can easily be adapted to handle the case m 0 and so the system becomes ill conditioned. Why can we not get around this as follows: as soon as mu is below some threshold we solve instead the

Re: [R] nls.lm

2016-10-19 Thread ProfJCNash
I sometimes find it useful to use nonlinear least squares for fitting an approximation i.e., zero residual model. That could be underdetermined. Does adding the set of residuals that is the parameters force a minimum length solution? If the equations are inconsistent, then the residuals apart fr

[R] nls.lm

2016-10-19 Thread Mike meyer
Make that f(x,u)=||x||². __ 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-c

[R] nls.lm

2016-10-19 Thread Mike meyer
@SE: yes, not every system of equations with more variables than equations is solvable, we need an additional condition e.g. full rank of the coefficient matrix. Uniqueness of the solution was not required. @BH: Yes this is the document, it is a nice presentation. I did not read the first page b

Re: [R] nls.lm

2016-10-19 Thread Berend Hasselman
> On 19 Oct 2016, at 14:09, Mike meyer <1101...@gmx.net> wrote: > > @pd: you know that a System of equations with more variables than equations > is always solvable > and if a unique solution is desired one of mimimal norm can be used. > Not true. Take the system with 3 variables and 2 equati

Re: [R] nls.lm

2016-10-19 Thread S Ellison
> Mike meyer > @pd: you know that a System of equations with more variables than equations > is always solvable > and if a unique solution is desired one of mimimal norm can be used. Here's an example of what you _said_: x + y + z = 2 3x - y +4z = 4 Find a unique single-valued solution for al

Re: [R] nls.lm

2016-10-19 Thread Berend Hasselman
> On 19 Oct 2016, at 14:09, Mike meyer <1101...@gmx.net> wrote: > > @pd: you know that a System of equations with more variables than equations > is always solvable > and if a unique solution is desired one of mimimal norm can be used. > You won't get a minimum norm solution by using a least

Re: [R] nls.lm

2016-10-19 Thread ProfJCNash
Peter is right that the conditions may be embedded in the underlying code. (Ask Kate!) My nlmrt package is all in R, so the conditions are visible. I'm currently in process of rejigging this using some work Duncan Murdoch helped with a while ago (I've had some other things get in the way), so I

[R] nls.lm

2016-10-19 Thread Mike meyer
@pd: you know that a System of equations with more variables than equations is always solvable and if a unique solution is desired one of mimimal norm can be used. According to "Methods for nonlinear least squares problems" by Madsen, Nielsen and Tingleff the LM-algorithm solves Systems of the f

Re: [R] nls.lm

2016-10-19 Thread Peter Dalgaard
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:

[R] nls.lm

2016-10-19 Thread Mike meyer
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 sensel

Re: [R] nls.lm & AIC

2010-02-16 Thread Katharine Mullen
I will consider putting methods for AIC and logLik into the next version of minpack.lm (contributions welcome). For now, the following should work for logLik, where 'object' is the return value of nls.lm. logLik.nls.lm <- function(object, REML = FALSE, ...) { res <- object$fvec N <- lengt

[R] nls.lm & AIC

2010-02-16 Thread Baudron, Alan Ronan
Hi there, I'm a PhD student investigating growth patterns in fish. I've been using the minpack.lm package to fit extended von Bertalanffy growth models that include explanatory covariates (temperature and density). I found the nls.lm comand a powerful tool to fit models with a lot of parameters