[Solved] Curve Fits more accurate than Cubic Spline ?
- VB6_to_PBx
- Enthusiast
- Posts: 627
- Joined: Mon May 09, 2011 9:36 am
[Solved] Curve Fits more accurate than Cubic Spline ?
is there a Curve Fit equation more accurate in regards to X and Y Data pairs
than a Cubic Spline Curve Fit ??
Reason : Cubic Splines are not a good enough Fit to Data i'm trying to simulate
TSpline, BSpline, CSpline, Bezier , others ...etc ??
Anyone have PureBasic Code for Curve Fits they would share ?
than a Cubic Spline Curve Fit ??
Reason : Cubic Splines are not a good enough Fit to Data i'm trying to simulate
TSpline, BSpline, CSpline, Bezier , others ...etc ??
Anyone have PureBasic Code for Curve Fits they would share ?
Last edited by VB6_to_PBx on Mon Mar 04, 2019 8:01 pm, edited 1 time in total.
PureBasic .... making tiny electrons do what you want !
"With every mistake we must surely be learning" - George Harrison
Re: Curve Fits more accurate than Cubic Spline ?
How do you define accuracy in your curve fits?
Do you have a csv file of xy data for the many points(curve fitted) vs a smaller data set(original)?
Do you have a csv file of xy data for the many points(curve fitted) vs a smaller data set(original)?
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Re: Curve Fits more accurate than Cubic Spline ?
Do you want to fit your data with an equation, a law? Than you have to look for your law: Exp(), Sin(), Sqr() ...
Do you want to interpolate your data, with a polynom? In the easiest case linear.
Do you want to interpolate your data, with a polynom? In the easiest case linear.
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
- VB6_to_PBx
- Enthusiast
- Posts: 627
- Joined: Mon May 09, 2011 9:36 am
Re: Curve Fits more accurate than Cubic Spline ?
STARGÅTE wrote:Do you want to fit your data with an equation, a law? Than you have to look for your law: Exp(), Sin(), Sqr() ...
Do you want to interpolate your data, with a polynom? In the easiest case linear.
thanks for the quick Replies ... didn't think i'd get so quick a response ,skywalk wrote: How do you define accuracy in your curve fits?
Do you have a csv file of xy data for the many points(curve fitted) vs a smaller data set(original)?
i'll Post or Link a X,Y Data File in csv format
Polynomial and a Linear Spline i've tried , and are not close enough fit
a Cubic Spline is closer , but still not close enough
i'm testing so far only 33 X Y Data pairs to fit 1300 to 1600 Data points to minimum of 5 decimal places
i've writen a Program that generates minimum of 1300+ points of Data in 5 to 6 decimal places accuracy
and i'm trying to reverse-engineer the Data of that Program back into original accuracy over 1300+ points .
i'm trying to do this without necessarily having to add a bunch more than 33 XY Data points
in other words, trying to keep somewhere around 130 or less XY Data pairs that will accurately simulate 1300+ real points of Data to 5 r more decimal places
i thought i would Post a Thread here to see if anyone know of a Spline or anyother Curve Fit equations
that might use 30 to 100 or even as high as 200 XY Data pairs to simulate real 1300 Data point values to 5 or 6 decimal places minimum.
dividing up 1300 points into 100 or so Cubic Spline XY Data pairs is what i was going to test next
while waiting on anyone in this Forum to Reply with a better more accurate Solution
Thanks for interest + any Code to test out
PureBasic .... making tiny electrons do what you want !
"With every mistake we must surely be learning" - George Harrison
-
- Addict
- Posts: 2344
- Joined: Mon Jun 02, 2003 9:16 am
- Location: Germany
- Contact:
Re: Curve Fits more accurate than Cubic Spline ?
For every type of spline there are two possibilities:
- use the data as control points (curve does not go through the points)
- interpolate the data points (curve goes through it)
bye,
Daniel
Daniel
Re: Curve Fits more accurate than Cubic Spline ?
You just need the XY pairs for the region of the curve that deviates from your attempted curve fit.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
- VB6_to_PBx
- Enthusiast
- Posts: 627
- Joined: Mon May 09, 2011 9:36 am
Re: Curve Fits more accurate than Cubic Spline ?
which means that the curve will create waves with unwanted huge waves.However with many points, you'll experience the problem of overfitting,
which means that the curve will create waves with unwanted huge waves.
B-splines try to limit these for example by limiting the influence of control points (or better said knots).
Yes, that's exactly what is happening !!! ... but using lesser XY Data pairs does not help out either

with a Cubic Spline , it fits perfect in some portions and then wildly deviates in other portions... then comes back again in the next portions with a perfect fit to 6+ decimal point places
i'm trying to correct the deviation section problems with a more accurate Curve Fit equation or Method
i have B-Spline equations in VB6.0 , but must convert to PureBasic plus add all the extra XY data Pair inputs
as VB6 version only has 5 XY Data pairs
so you think B-Spline might help ??
i have VB6 T and C Spline equations , but they also have 5 XY Data pair input boxes, so it takes time to code for 30+ XY Pairs
and test these different Splines in PureBasic or VB6
thats same idea i've had .. just did not yet get to test that out tooYou just need the XY pairs for the region of the curve that deviates from your attempted curve fit.

will start coding all this in ....
PureBasic .... making tiny electrons do what you want !
"With every mistake we must surely be learning" - George Harrison
- VB6_to_PBx
- Enthusiast
- Posts: 627
- Joined: Mon May 09, 2011 9:36 am
Re: Curve Fits more accurate than Cubic Spline ?
well none of the various Splines worked at all 

PureBasic .... making tiny electrons do what you want !
"With every mistake we must surely be learning" - George Harrison
Re: Curve Fits more accurate than Cubic Spline ?
Can you cut and paste some XY values?
Better yet, embed them in a DataSection?
Better yet, embed them in a DataSection?
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
- VB6_to_PBx
- Enthusiast
- Posts: 627
- Joined: Mon May 09, 2011 9:36 am
Re: Curve Fits more accurate than Cubic Spline ?
i placed actual Data files in Excel .XLS formatskywalk wrote:Can you cut and paste some XY values?
Better yet, embed them in a DataSection?
with .PNG picture files
and .TXT files
of problems fitting Cubic Spline Data -VS- Real Data
in this ZIP File Link :
http://www.mediafire.com/file/0d4fm4rns ... s.zip/file
sorry i have not yet coded a PureBasic program
to use XY Pairs in a DataSection to Post or include in the ZIP file
Please read the README.TXT file first .
PureBasic .... making tiny electrons do what you want !
"With every mistake we must surely be learning" - George Harrison
Re: Curve Fits more accurate than Cubic Spline ?
As I suspected, you have discontinuities in the data set that cannot reasonably be described with simple polynomials or cubics. You have to create a model that emits data for these crossover points.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
- VB6_to_PBx
- Enthusiast
- Posts: 627
- Joined: Mon May 09, 2011 9:36 am
Re: Curve Fits more accurate than Cubic Spline ?
Yes ,skywalk wrote:As I suspected, you have discontinuities in the data set that cannot reasonably be described with simple polynomials or cubics. You have to create a model that emits data for these crossover points.
and it appears it would take a ton of XY Data Pairs to get a thorough accurate Fit at each point ,
in doing so , defeats the purpose of Curve Fitting
PureBasic .... making tiny electrons do what you want !
"With every mistake we must surely be learning" - George Harrison
Re: Curve Fits more accurate than Cubic Spline ?
hello VB6_to_PBx
there's program called Eureqa https://www.nutonian.com/download/eureq ... -download/ that tries to find a symbolic expression to a given set of data points
who knows, it may help in your situation.
the program initially was free, but not anymore, and I haven't run the program since then, there's however a 30 day trial version for download.
[edit]
Eureqa was bought out by https://www.datarobot.com/
youtube demo https://www.youtube.com/watch?time_cont ... hC1Qb-PQ5Q
https://www.youtube.com/watch?v=k7GCqfV5Uk4
https://www.youtube.com/watch?time_cont ... So6eeDsFlE
there's program called Eureqa https://www.nutonian.com/download/eureq ... -download/ that tries to find a symbolic expression to a given set of data points
who knows, it may help in your situation.
the program initially was free, but not anymore, and I haven't run the program since then, there's however a 30 day trial version for download.
[edit]
Eureqa was bought out by https://www.datarobot.com/
youtube demo https://www.youtube.com/watch?time_cont ... hC1Qb-PQ5Q
https://www.youtube.com/watch?v=k7GCqfV5Uk4
https://www.youtube.com/watch?time_cont ... So6eeDsFlE
- VB6_to_PBx
- Enthusiast
- Posts: 627
- Joined: Mon May 09, 2011 9:36 am
Re: Curve Fits more accurate than Cubic Spline ?
thanks Jack for the Links ,jack wrote:hello VB6_to_PBx
there's program called Eureqa https://www.nutonian.com/download/eureq ... -download/ that tries to find a symbolic expression to a given set of data points
who knows, it may help in your situation.
the program initially was free, but not anymore, and I haven't run the program since then, there's however a 30 day trial version for download.
[edit]
Eureqa was bought out by https://www.datarobot.com/
youtube demo https://www.youtube.com/watch?time_cont ... hC1Qb-PQ5Q
https://www.youtube.com/watch?v=k7GCqfV5Uk4
https://www.youtube.com/watch?time_cont ... So6eeDsFlE
i've downloaded it , but have not run it yet,
and it might give me some insights , but not completely solve what i want ?
PureBasic .... making tiny electrons do what you want !
"With every mistake we must surely be learning" - George Harrison
-
- User
- Posts: 39
- Joined: Fri Oct 17, 2014 8:52 pm
Re: Curve Fits more accurate than Cubic Spline ?
How do you choose the x-values, where the splines should start and end?