Re: R-beta: nonlinear fitting

Jim Lindsey (jlindsey@luc.ac.be)
Thu, 12 Mar 1998 19:45:15 +0100 (MET)


From: Jim Lindsey <jlindsey@luc.ac.be>
Message-Id: <9803121845.AA17133@alpha.luc.ac.be>
Subject: Re: R-beta: nonlinear fitting
To: wsimpson@uwinnipeg.ca (Bill Simpson)
Date: Thu, 12 Mar 1998 19:45:15 +0100 (MET)
In-Reply-To: <Pine.OSF.3.95.980312120136.3505C-100000@io.uwinnipeg.ca> from "Bill Simpson" at Mar 12, 98 12:03:32 pm


> 
> Hi Jim,
> 
> Thanks very much for your help.
> 
> I did what you said:
> > x
> [1] 1 2 3 4 5 6
> > y
> [1] 0.5000000 0.3979262 0.3551846 0.3305826 0.3142192 0.3023836
> > fn <- function(p) (y-p[1]*x^p[2]+p[3])^2

sorry that should have been:
fn <- function(p) sum((y-p[1]*x^p[2]+p[3])^2)
It's sum of squares of course! Jim
> >  nlm(fn,p=c(0.3,-0.6,0.2))
> Error: invalid function value in optimizer
> 
> As you can see it didn't work.  What went wrong?
> 
> Thanks very much for any help.
> 
> Best wishes,
> Bill
> 
> 

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._