Re: C for Polynomial Fit
- From: Spehro Pefhany <speffSNIP@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 28 Dec 2007 23:39:05 -0500
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
.
- References:
- C for Polynomial Fit
- From: Gary Pace
- C for Polynomial Fit
- Prev by Date: Re: C for Polynomial Fit
- Next by Date: Re: I2C trick?
- Previous by thread: Re: C for Polynomial Fit
- Next by thread: Re: C for Polynomial Fit
- Index(es):
Relevant Pages
|