Re: least square error for a regression [message #41037] |
Wed, 15 September 2004 20:50  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
"yaj" <tgupta2000@hotmail.com> writes:
> Hello,
> I am fitting a function of the form
> ASin(wt + theta) + constant to a set of points. Instead of a readymade
> fitting routine from IDL (to avoid any potential problems with small numbers
> later), I use the three linear equations to minimize the least square error,
> then use an IDL function to solve the matrix equation. Could someone suggest
> a simple way to calculate the least squares error and goodness of fit using
> some higher level IDL functions ?
Pardon me for asking, but which "small numbers" problems are you
hoping to avoid? If you are able to linearize your problem yourself,
as you seem to have done, then I believe that a routine like CURVEFIT
or MPFIT should do just fine at estimating the parameters and
returning the uncertainties. And these routines have the added
benefit of tested by years of use.
Happy fitting,
Craig
http://cow.physics.wisc.edu/~craigm/idl/idl.html
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|