Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread statistics - curve fitting (linear or polynomial)
Fri, Sep 9 2022 8:06 PMPermanent Link

erickengelke

Avatar

I've added a feature to my Nice library which includes curve fitting.

So if you have data, you can find a polynomial which best fits the data with just three lines of code.  

You plunk in X,Y data, call the code to compute the curve, then give new x values for which it tells you estimated values.

You just specify if you want to use a linear (ie. order = 1) or  2nd order or higher polynomial to fit the curve.

The sample is at: https://www.erickengelke.com/nice/samples.html

under Least Squares Poly with some random data every time you press the button.  In the example I used 2nd order curve fitting.  

As always, people with subscriptions to my library can update at no charge with the updates at the usual location.

However, this feature is based on an open source library   So if you just need the curve fitting, you do not need to purchase the library, but it is needed for all other functionality such as the charting.  Contact me for details.

Have a nice weekend,
Erick
EWB Programming Books and Component Library
http://www.erickengelke.com
Sat, Sep 10 2022 8:54 PMPermanent Link

erickengelke

Avatar

erickengelke wrote:

>I've added a feature to my Nice library which includes curve fitting.

I've added some new extensions, including a simplified graphing library called TStatGraph
which simplifies pretty graphing, and is used in the Least Square Polynomial example.

If you use the curve fitting, realize that it can generate excellent equations to interpolate the data, but should not be used to estimate outside the data range because that would only be a guess.

Erick
EWB Programming Books and Component Library
http://www.erickengelke.com
Image