Bug 92231 - Potential regression curve calculation is wrong
Summary: Potential regression curve calculation is wrong
Status: RESOLVED INVALID
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Chart (show other bugs)
Version:
(earliest affected)
5.1.0.0.alpha0+ Master
Hardware: Other All
: medium normal
Assignee: Philippe Jung
URL:
Whiteboard: target:5.1.0
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-21 17:06 UTC by Philippe Jung
Modified: 2016-10-25 19:24 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Test file (18.13 KB, application/vnd.oasis.opendocument.spreadsheet)
2015-06-21 17:07 UTC, Philippe Jung
Details
Example with "Power" and "Exponential" regression (27.04 KB, application/x-vnd.oasis.opendocument.spreadsheet)
2015-06-21 22:10 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Jung 2015-06-21 17:06:11 UTC
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

Code in chart2/source/tools/PotentialRegressionCurveCalculator.cxx is wrong since 2003... so the fix can be cherry-picked to most versions.
Comment 1 Philippe Jung 2015-06-21 17:07:42 UTC
Created attachment 116710 [details]
Test file
Comment 2 Commit Notification 2015-06-21 17:27:09 UTC
Philippe Jung committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=e0e285574244e855fd148ab7320b1aeb5914655a

tdf#92231 Potential regression curve calculation is wrong

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 3 Regina Henschel 2015-06-21 22:10:16 UTC
Created attachment 116717 [details]
Example with "Power" and "Exponential" regression

I think, this change is wrong. The "Potential regression curve" is of kind y=A * x^B and is used for the UI term "Power".

Do not confuse it with "Exponential" regression curve.
Comment 4 Philippe Jung 2015-06-21 22:16:30 UTC
Yep already reverted
Sorry for this.
Closing as invalid report
Comment 5 Commit Notification 2015-06-21 22:23:49 UTC
Philippe Jung committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=d16e154c627ecc0cb21aaf4b28f7f5ae48ebbde1

Revert "tdf#92231 Potential regression curve calculation is wrong"

It will be available in 5.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.