Page 1 of 1

Method used to create "best fit" trend line

Posted: Tue May 15, 2012 12:58 pm
by 10549203
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

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

Posted: Thu May 17, 2012 2:10 pm
by yeray
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

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

Posted: Mon May 21, 2012 8:13 am
by 10549203
Thanks,
I see as expected that the "least square fit" method is used. Just had to get it confirmed. Source code helps :)

- Kjetil