Polynomial & Exponential Trend

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
faruque
Newbie
Newbie
Posts: 3
Joined: Thu Oct 13, 2005 4:00 am

Polynomial & Exponential Trend

Post by faruque » Tue May 22, 2007 8:33 am

hi there,

Can i generate Polinomial & exponetial Trend line and Equation?

Edu
Advanced
Posts: 206
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia

Post by Edu » Thu May 24, 2007 8:07 am

Hi Faruque

The Exponetial Trend function has a CalculateTrend method as Trend function, it works the same way:

Code: Select all

expTrendFunction1.CalculateTrend(expTrendFunction1.Series, 0, expTrendFunction1.Series.Count - 1, ref m, ref b);
label2.Text = "y = " + b.ToString() + "x + " + m.ToString();
For polynomial fitting you should use Steema.TeeChart.Functions.PolyFitting function class. It has a Coefficient(int index) method which returns polynomial coefficients. There is an example of this available in TChart.Net demo. Check the examples under the tab "All Features\Functions\Extended\Polynomial Fitting ", You'll find the demo at TeeChart's program group.

You should be aware of is polynomial coefficents are calculated for scaled x and y values i.e. Y -> Y - Ymin and X -> X - Xmin. This is to avoid fpu when large x or y values are used in series. Internally the algorithm uses Gaussian method to find optimized polynomial coefficients.
Best Regards,
Edu

Steema Support Central
http://support.steema.com/

Post Reply