tdf#92231 Potential regression curve calculation is wrong
Fixes potential regression curve class. For potential regression curve algorithm, we try to get y = C * D^x Switching to neperian logs: ln(y) = ln(C) + x ln(D) So we make a linear regression and get slope = ln(D) => D = exp(slope) intercept = ln(C) => C = exp(intercept) The current code computes the linear regression between log(y) and log(x) It should be between ln(y) and x. Moreover, the slope is ln(D) so exp(slope) should be returned. Finally, in getCurveValue, the return value is y = C x^D which is wrong Change-Id: If8c952001229d3436be48abfef87c8302cf0544f Reviewed-on: https://gerrit.libreoffice.org/16400Reviewed-by:Philippe Jung <phil.jung@free.fr> Tested-by:
Philippe Jung <phil.jung@free.fr>
Showing
Please
register
or
sign in
to comment