Question About Curve Fitting

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
madup
Newbie
Newbie
Posts: 28
Joined: Fri Oct 07, 2005 4:00 am

Question About Curve Fitting

Post by madup » Sat Sep 12, 2009 10:11 pm

I tried to follow the posts and could not find the information.
Sorry for a repeated question.
I would like to use the polynomials from the Curve fit AnswerVector to perform anaylsis in seperate charts and summaries.
I am able to obtain the poly coeff, now my question if I want to plot these values in a seperate chart, how do I apply them.
For example for polydegree of 3,
coeff 1 83.227
2 -285616.255
3 95581543.071

Same line polydegree of 2 .
coeff 1 81.491
2 -254115.206
How would I build the line ? Y = what * X + what * (X * X) + ....

Thanks for your help
Regards
Mike

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Question About Curve Fitting

Post by Narcís » Mon Sep 14, 2009 8:48 am

Hi Mike,

In that case you could probably use custom function y=f(x) together with what Marjan explained here. You'll find custom function examples at All Features\Welcome!\Functions\Extended\Custom y=(fx) in the new features demo, available at TeeChart's program group.

Hope this helps!
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

madup
Newbie
Newbie
Posts: 28
Joined: Fri Oct 07, 2005 4:00 am

Re: Question About Curve Fitting

Post by madup » Mon Sep 14, 2009 10:40 am

Hi Narcis,
Tahnks for the reply an info. The info from Marjan, I think will help.
I not clear on how to use the Custom y=f(x). Any help would be appreciated.
Again Thanks
Mike

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Question About Curve Fitting

Post by Narcís » Mon Sep 14, 2009 10:51 am

Hi Mike,

Have you found the custom function example I told you? It's available in the new features demo included with binary installers. If you already found that, which is the exact problem you are having with it?

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

madup
Newbie
Newbie
Posts: 28
Joined: Fri Oct 07, 2005 4:00 am

Re: Question About Curve Fitting

Post by madup » Mon Sep 14, 2009 11:08 am

Hi Narcis,
I found the example, I understand it now. It will plot the function defined by y = f(x).
I was still thinking in terms of deriving coefficients, not plotting results from a function.
Thanks
Mike

madup
Newbie
Newbie
Posts: 28
Joined: Fri Oct 07, 2005 4:00 am

Re: Question About Curve Fitting

Post by madup » Tue Sep 15, 2009 9:30 am

Hi Narcis,
Again Thanks for the help.
For the curve fitting, Marjan's info really helped.
First, the normalization was the item, that clouds the understanding of the coefficients.
Next the piece that is a bit confusing, correct me if I'm wrong.
A 2nd degree polynomial will have a squared term ie y = ax^2 + bx + c or y = a[2[x^2 + a[1]X = a[0]
here for polydegree of 2 you get y = ax +b, or y = a[1]x + a[0] which represents a line that is not parallel to the bottom axis. when "a" is non-zero.
So I've worked through my issues, however maybe this should be a documentation note.
Regards
Mike

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Question About Curve Fitting

Post by Narcís » Tue Sep 15, 2009 12:05 pm

Hi Mike,

Yes, exactly. That's the same that was discussed here. I'll also add your request to the wish-list to be enhanced.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Hans Wolfgang
Newbie
Newbie
Posts: 58
Joined: Fri Nov 15, 2002 12:00 am
Location: Naples, FL
Contact:

Re: Question About Curve Fitting

Post by Hans Wolfgang » Mon Oct 26, 2009 12:51 pm

I found the same mismatch. PolyDegree=1 gives a constant line parallel to x axis. PolyDegree=2 gives a linear graph. Instead they should give linear and parabola, respectively. Then you should probably add PolyDegree=0 for the constant line.

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Question About Curve Fitting

Post by Yeray » Tue Oct 27, 2009 8:27 am

Hi,

I've incremented this issue priority. But more than a bugfix this will probably be a documentation improvement.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply