Method used to create "best fit" trend line

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Kyma
Newbie
Newbie
Posts: 2
Joined: Tue Jun 03, 2008 12:00 am

Method used to create "best fit" trend line

Post by Kyma » Tue May 15, 2012 12:58 pm

Hello,
Can you give some details on what method is used to fit a series of data to a straight trend line in the TTrendFunction (TTrendStyle = tsNormal)?
We are using this in our product and have customers who wants to know the method used to generate the trend line.

Thanks,
Kjetil

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

Re: Method used to create "best fit" trend line

Post by Yeray » Thu May 17, 2012 2:10 pm

Hi Kjetil,

You are a source code customer, aren't you?
Check the following functions in CurvFitt.pas to see how it is exactly calculated:
TCustomTrendFunction.CalculateAllPoints
TCustomTrendFunction.CalculatePeriod
TCustomTrendFunction.CalculateTrend
TCustomTrendFunction.CalculateValues
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

Kyma
Newbie
Newbie
Posts: 2
Joined: Tue Jun 03, 2008 12:00 am

Re: Method used to create "best fit" trend line

Post by Kyma » Mon May 21, 2012 8:13 am

Thanks,
I see as expected that the "least square fit" method is used. Just had to get it confirmed. Source code helps :)

- Kjetil

Post Reply