[S] fitting question

Scott Dewey (msd@rrdjazz.nist.gov)
Fri, 23 Oct 1998 05:03:51 -0400


Greetings,

I'm an experimental physicist who is using S-Plus (4.5 on W98
machine). No doubt my statistical sophistication pales in comparison
with 99% of the readers of this group. In my work I'm usually faced
with y values, x values, errors (or sigmas) on y, and a nonlinear
function with unknown parameters that is supposed to describe the
relationship between y and x. There's A LOT OF discussion of fitting
in the S-Plus documentation and 3rd party books, but none of it speaks
exactly to me. From what I've read, I'm inclined to try the
following:

nls( y/sy ~ f(x,a,b,c)/sy , data = x )

Can you experts tell me if this is the way to perform a weighted
nonlinear fit using S-Plus?

I've been reading up on the deriv() function which seems to be a neat
way to generate the information needed by nls. It returns an
"expression" while nls takes a "formula". I presume there is a simple
way to turn an expression into a formula. I haven't found a full
example yet that shows how this works. I understand the "gradient"
attribute concept.

Thanks in advance,
Scott Dewey

National Institute of Standards and Technology
Bld. 235, Rm. A159, Gaithersburg, MD 20899
Ph: (301) 975-4843 Fx: (301) 926-1604
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news