Re: C for Polynomial Fit



On Fri, 28 Dec 2007 21:35:47 -0600, the renowned Gary Pace
<xxx@xxxxxxx> wrote:

Howdy :

Does anybody know where I can find code for a C function to fit an
(N-1)th order polynomial to N (x,y) data points. Actually I need to fit
a 5th order polynomial to 11 x,y points.

Thanks folks,
Gary

Since you have fewer terms in the polynomial than data points, you
will need to define what is an optimum fit. One popular (but certainly
not the only) criterion is to minimize the sum of the error squared at
each data point. It's easy to compute (derivative == 0 at minima).

http://mathworld.wolfram.com/LeastSquaresFittingPolynomial.html

In real applications you may actually wish to minimize the maximum
abs. value of error at all data points.


Best regards,
Spehro Pefhany
--
"it's the network..." "The Journey is the reward"
speff@xxxxxxxxxxxx Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog Info for designers: http://www.speff.com
.



Relevant Pages

  • Re: Update Query; But keep rest of field...
    ... UPDATE tblItem SET tblItem.itemMfgItemNumber = "Fit ABS" ... The goal is to find all items that START with "Fitting ABS" and change them ... Fitting PVC Sch40 1" 90 ELL SxS ...
    (microsoft.public.access.queries)
  • Re: Round LCDs
    ... This has to fit existing round gauge ... Spehro Pefhany ... Embedded software/hardware/analog Info for designers: http://www.speff.com ...
    (sci.electronics.design)
  • Re: Round LCDs
    ... This has to fit existing round gauge ... Spehro Pefhany ... Embedded software/hardware/analog Info for designers: http://www.speff.com ...
    (sci.electronics.design)
  • Re: JSH: Step by step through the factoring algorithm
    ... Otherwise D would fit as a ... positive but since that is not immediately clear I will restore the abs ... that was in James' original text. ...
    (sci.math)
  • Re: Who wants to by my universal code ?
    ... >> Okay, 'splain, pls. Doesn't fit with any base. ... That'll teach me to do base-13 arithmetic before the caffeine kicks ... Best regards, ... Spehro Pefhany ...
    (sci.electronics.design)