POV-Ray : Newsgroups : povray.general : Curve fitting Server Time
4 Nov 2024 19:20:08 EST (-0500)
  Curve fitting (Message 1 to 10 of 10)  
From: Stephen
Subject: Curve fitting
Date: 10 Jun 2008 10:36:45
Message: <594t44hfs6cuejciibnd0vrnkve4q303jl@4ax.com>
Does anyone know of free software :) that will give me an equation
from a set of data points?
I've been using Excel's trendline but the equation it returns
sometimes fits but often is way out. I've got a series of translations
and rotations from PoserPhysics that I want to convert into some
equations so I can replicate them in Bishop3D. (Bishop3D does not have
the function to load an input file, yet. It does have the ability to
create the points from a polynomial equation) I'll copy a short
extract below. Excel gives good results up to Frame #22 then gives
nothing useful afterwards. I've been splitting the data into sections.
Of course maybe I'm not very good with excel.

Frame	Yposition
0	3.4884
1	3.4822
2	3.4652
3	3.4373
4	3.3984
5	3.3487
6	3.2881
7	3.2166
8	3.1341
9	3.0408
10	2.9366
11	2.8214
12	2.6954
13	2.5585
14	2.4106
15	2.2519
16	2.0823
17	1.9017
18	1.7103
19	1.508
20	1.2947
21	1.0706
22	0.83559
23	0.78687
24	0.94375
25	0.96928
26	0.84659
27	0.7397
28	0.77747
29	0.88383
30	0.99821
31	1.0788
32	1.1167
33	1.1143
34	1.0975
35	1.0687
36	1.028
37	0.97593
38	0.91267
39	0.83864
40	0.7542
41	0.75308
42	0.75202
43	0.71815
44	0.66709
45	0.60173
46	0.53591
47	0.49003
48	0.48278
49	0.51193
50	0.5476
  
-- 

Regards
     Stephen


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Curve fitting
Date: 10 Jun 2008 10:50:41
Message: <484e94c1@news.povray.org>
Stephen wrote:
> Does anyone know of free software :) that will give me an equation
> from a set of data points?

Try http://en.wikipedia.org/wiki/GNU_Octave - it is Matlab compatible.

	Thorsten


Post a reply to this message

From: Stephen
Subject: Re: Curve fitting
Date: 10 Jun 2008 14:06:56
Message: <pkgt44pkaql9rvd9ernrq4c1cqqo439fqf@4ax.com>
On Tue, 10 Jun 2008 16:50:42 +0200, Thorsten Froehlich
<tho### [at] trfde> wrote:

>Stephen wrote:
>> Does anyone know of free software :) that will give me an equation
>> from a set of data points?
>
>Try http://en.wikipedia.org/wiki/GNU_Octave - it is Matlab compatible.
>
>	Thorsten

Thanks Thorsten, maybe I should have asked for an application instead.
Octave is interesting but beyond my present abilities and programming
skills. 
-- 

Regards
     Stephen


Post a reply to this message

From: Nicolas George
Subject: Re: Curve fitting
Date: 11 Jun 2008 05:13:29
Message: <484f9739@news.povray.org>
Stephen  wrote in message <594t44hfs6cuejciibnd0vrnkve4q303jl@4ax.com>:
> Does anyone know of free software :) that will give me an equation
> from a set of data points?

There is no generic solution to this problem. If you have a particular form
of equation in mind (affine, exponential, etc.), there are ways to calculate
the best coefficients, but nothing can guess the form of equation for you.

And the points you are giving do not look like anything I know.

>					   It does have the ability to
> create the points from a polynomial equation

You can find a polynomial that will fit exactly any points you want (as long
as there are no conflicts), but the number of coefficients will be the same
as the number of points. With so many points, the coefficients will be huge,
and the polynomial will make giant leaps between each point. I strongly
advise against this solution.


Post a reply to this message

From: Stephen
Subject: Re: Curve fitting
Date: 11 Jun 2008 06:01:18
Message: <q88v445n4nj4fib1304g6pdpgibi96gu98@4ax.com>
On 11 Jun 2008 05:13:29 -0400, Nicolas George
<nicolas$george@salle-s.org> wrote:

>Stephen  wrote in message <594t44hfs6cuejciibnd0vrnkve4q303jl@4ax.com>:
>> Does anyone know of free software :) that will give me an equation
>> from a set of data points?
>
>There is no generic solution to this problem. If you have a particular form
>of equation in mind (affine, exponential, etc.), there are ways to calculate
>the best coefficients, but nothing can guess the form of equation for you.

Thanks for your time Nicolas. I know that there is no generic
solution. I have been splitting the points up into smaller sections to
work out several curves in ranges. 

>And the points you are giving do not look like anything I know.
>

The points posted represent the Y coordinates of a falling then
bouncing stick on a sloping stage. (It is for a TC-RTC entry)

>>					   It does have the ability to
>> create the points from a polynomial equation
>
>You can find a polynomial that will fit exactly any points you want (as long
>as there are no conflicts), but the number of coefficients will be the same
>as the number of points. With so many points, the coefficients will be huge,
>and the polynomial will make giant leaps between each point. I strongly
>advise against this solution.

I would advise against it myself :)
But until my modeller has the ability to upload the data I am stuck
with trying to find a solution. I downloaded a curve-fit program to
try out and got similar results when I checked them out in Excel. So I
now believe that my Excel spreadsheet has a problem and will look into
this.
Again thank you for your time.
-- 

Regards
     Stephen


Post a reply to this message

From: pan
Subject: Re: Curve fitting
Date: 11 Jun 2008 13:55:18
Message: <48501186@news.povray.org>
http://en.wikipedia.org/wiki/Curve_fitting

"Stephen" <mcavoysAT@aolDOTcom> wrote in message 
news:594t44hfs6cuejciibnd0vrnkve4q303jl@4ax.com...
> Does anyone know of free software :) that will give me an 
> equation
> from a set of data points?
> I've been using Excel's trendline but the equation it returns
> sometimes fits but often is way out. I've got a series of 
> translations
> and rotations from PoserPhysics that I want to convert into some
> equations so I can replicate them in Bishop3D. (Bishop3D does not 
> have
> the function to load an input file, yet. It does have the ability 
> to
> create the points from a polynomial equation) I'll copy a short
> extract below. Excel gives good results up to Frame #22 then 
> gives
> nothing useful afterwards. I've been splitting the data into 
> sections.
> Of course maybe I'm not very good with excel.
>
> Frame Yposition
> 0 3.4884
> 1 3.4822
> 2 3.4652
> 3 3.4373
> 4 3.3984
> 5 3.3487
> 6 3.2881
> 7 3.2166
> 8 3.1341
> 9 3.0408
> 10 2.9366
> 11 2.8214
> 12 2.6954
> 13 2.5585
> 14 2.4106
> 15 2.2519
> 16 2.0823
> 17 1.9017
> 18 1.7103
> 19 1.508
> 20 1.2947
> 21 1.0706
> 22 0.83559
> 23 0.78687
> 24 0.94375
> 25 0.96928
> 26 0.84659
> 27 0.7397
> 28 0.77747
> 29 0.88383
> 30 0.99821
> 31 1.0788
> 32 1.1167
> 33 1.1143
> 34 1.0975
> 35 1.0687
> 36 1.028
> 37 0.97593
> 38 0.91267
> 39 0.83864
> 40 0.7542
> 41 0.75308
> 42 0.75202
> 43 0.71815
> 44 0.66709
> 45 0.60173
> 46 0.53591
> 47 0.49003
> 48 0.48278
> 49 0.51193
> 50 0.5476
>
> -- 
>
> Regards
>     Stephen


Post a reply to this message

From: Blue Herring
Subject: Re: Curve fitting
Date: 12 Jun 2008 14:42:54
Message: <48516e2e$1@news.povray.org>
Stephen wrote:
> Does anyone know of free software :) that will give me an equation
> from a set of data points?
> I've been using Excel's trendline but the equation it returns
> sometimes fits but often is way out. I've got a series of translations
> and rotations from PoserPhysics that I want to convert into some
> equations so I can replicate them in Bishop3D. (Bishop3D does not have
> the function to load an input file, yet. It does have the ability to
> create the points from a polynomial equation) I'll copy a short
> extract below. Excel gives good results up to Frame #22 then gives
> nothing useful afterwards. I've been splitting the data into sections.
> Of course maybe I'm not very good with excel.

You might try http://zunzun.com/ It has tools to fit equations to a set 
of data points.  I tried out the list of data you gave and came up with 
the equation:

y = (a + b*x + c*x^2 + d*x^3) / (1.0 + e*x + f*x^2 + g*x^3)

with coefficients:
a =  3.5873790068909175E+00
b = -3.6608646543127443E-01
c =  1.2033940968889179E-02
d = -1.1827196216057683E-04
e = -8.7347287735754037E-02
f =  2.2537610587076151E-03
g = -6.0082748897173416E-06

with a sum of squared absolute error of 0.241559470446.  You should 
probably try it out yourself so you can see how it diverges from your 
dataset, try other options, etc.

-- 
-The Mildly Infamous Blue Herring


Post a reply to this message

From: Stephen
Subject: Re: Curve fitting
Date: 13 Jun 2008 04:49:25
Message: <94d454hao8bdf2d8dgcmirin4tj1knmqrm@4ax.com>
On Thu, 12 Jun 2008 14:42:51 -0400, Blue Herring
<pov### [at] bherringcotsenet> wrote:

>
>You might try http://zunzun.com/ It has tools to fit equations to a set 
>of data points.  I tried out the list of data you gave and came up with 
>the equation:

Thanks Mildly Infamous :) and Pan,
The problem has gone away as Bishop3D now has the ability to import
the data points. But out of interest that was a really silly idea of
mine, born out of desperation. I needed a tolerance of 0 to make it
work. Well it only cost time and it increased my knowledge of things
you cannot do :)
Now all I need to do is make PoserPhysics work as I want.
-- 

Regards
     Stephen


Post a reply to this message

From: Doctor John
Subject: Re: Curve fitting
Date: 13 Jun 2008 08:08:31
Message: <4852633f$1@news.povray.org>
Stephen wrote:
> The problem has gone away as Bishop3D now has the ability to import
> the data points. But out of interest that was a really silly idea of
> mine, born out of desperation. I needed a tolerance of 0 to make it
> work. Well it only cost time and it increased my knowledge of things
> you cannot do :)
> Now all I need to do is make PoserPhysics work as I want.

You could just stick to easier compositions ;-)

John

-- 
I will be brief but not nearly so brief as Salvador Dali, who gave the
world's shortest speech. He said, "I will be so brief I am already
finished," then he sat down.


Post a reply to this message

From: Stephen
Subject: Re: Curve fitting
Date: 13 Jun 2008 09:53:49
Message: <1uu454t5kdt8nh1atkb7i9qui35g961mg2@4ax.com>
On Fri, 13 Jun 2008 13:09:40 +0100, Doctor John <doc### [at] gmailcom>
wrote:

>
>You could just stick to easier compositions ;-)

You're one to talk :p
-- 

Regards
     Stephen


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.