[R] NLS or better: NLM

Zsombor Cseres-Gergely z.cseres-gergely at ucl.ac.uk
Mon Nov 13 00:48:38 CET 2000


I have to correct my previous post (or have I already did it?): I used NLM,
not NLS.

On Thu, Nov 09, 2000 at 09:18:45PM -0600, Douglas Bates wrote:
> Are you taking advantage of the fact that four of your five parameters
> are conditionally linear?  You can use 

No. I used my fingers before my brain.

> You would write the model as
> 
>  nls(y ~ x4^b4*cbind(1, x1, x2, x3), data = mydata, start = c(b4 = 0),
>      alg = "plinear", trace = TRUE)

This works fine.

> Do you really expect 0 to be a sensible value for this parameter?  If
> so, have you already fit the linear regression model
>   y ~ 1 + x1 + x2 + x3
> and found it to be adequate?  Why then do you think that x4 determines
> the response in this fashion is your best guess at the value of b4 is
> the value that makes x4 of no consequence.

Probably wrongly, but exatly for this reason. x1, x2 and x3 are number of
adu1t males, females and children in the household, y is energy intake, and x4
is log(income)/head. Plotting the data indicated difference, so I choose 0 to
see if there is one.

> > it converges very quickly, and to the wrong solution.
> Please explain this further.  An independent evaluation of the

> Not that I am aware of.  However, R is an open source system and you
> are welcome to contribute a superior nonlinear least squares
> implementation at any time.

Well, I did not wanted to blame the minimizer engine (nor R!). I just observed
these things and behaved like a consumer of software bloathed with AI-like
features, not like a craftsman with a precision tool. I hope R will teach me
to be more the latter.

But one question still remains for me. OK, I should have noticed and exploited
the structure of the problem. But what if I do not? Should the other way give
so different results?

Thanks,
Zsombor

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list