Page 1 of 1

Question About Curve Fitting

Posted: Sat Sep 12, 2009 10:11 pm
by 9343745
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

Re: Question About Curve Fitting

Posted: Mon Sep 14, 2009 8:48 am
by narcis
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!

Re: Question About Curve Fitting

Posted: Mon Sep 14, 2009 10:40 am
by 9343745
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

Re: Question About Curve Fitting

Posted: Mon Sep 14, 2009 10:51 am
by narcis
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.

Re: Question About Curve Fitting

Posted: Mon Sep 14, 2009 11:08 am
by 9343745
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

Re: Question About Curve Fitting

Posted: Tue Sep 15, 2009 9:30 am
by 9343745
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

Re: Question About Curve Fitting

Posted: Tue Sep 15, 2009 12:05 pm
by narcis
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.

Re: Question About Curve Fitting

Posted: Mon Oct 26, 2009 12:51 pm
by 5890703
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.

Re: Question About Curve Fitting

Posted: Tue Oct 27, 2009 8:27 am
by yeray
Hi,

I've incremented this issue priority. But more than a bugfix this will probably be a documentation improvement.