Bug 70673 - EDITING: More regression functions : negative power trend line
Summary: EDITING: More regression functions : negative power trend line
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Chart (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: lowest enhancement
Assignee: Laurent BP
QA Contact:
URL:
Whiteboard: BSA target:5.1.0
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-20 14:23 UTC by fldrivers
Modified: 2016-10-25 19:20 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Test file as described (34.07 KB, application/vnd.oasis.opendocument.spreadsheet)
2013-10-20 14:23 UTC, fldrivers
Details
Test file (17.90 KB, application/vnd.oasis.opendocument.spreadsheet)
2015-06-21 08:28 UTC, Philippe Jung
Details
Test file with positive and negative values for exponential and power trend line (21.93 KB, application/vnd.oasis.opendocument.spreadsheet)
2015-06-21 19:52 UTC, Laurent BP
Details

Note You need to log in before you can comment on or make changes to this bug.
Description fldrivers 2013-10-20 14:23:33 UTC
Created attachment 87879 [details]
Test file as described

Problem description: Add (now they are only linear, logarithm, exponential and power functions) and correct regression functions.

Steps to reproduce:
1. Have rising power function in testing file and only negative the sign to correct function from NaN to better.

Expected behavior: As data with oposite sign

Add polynomial function https://en.wikipedia.org/wiki/Polynomial and
Operating System: Windows 7
Version: 4.1.2.3 release
Comment 1 Tomaz Vajngerl 2013-10-21 21:00:29 UTC
Polynomial regression will be available in 4.2
As for power function I tried in excel and gnumeric and both also couldn't handle series 2 power function.
Comment 2 Owen Genat (retired) 2013-11-23 10:46:51 UTC
This is an enhancement request. Severity set to enhancement. Platform set to All/All. Further details in relation to comment #1 include https://wiki.documentfoundation.org/ReleaseNotes/4.2#Chart which indicates that bug 35712 is implementing polynomial regression.

In order for this enhancement request to be confirmed, please edit the summary to be clear about the specific regression model required (preferably one per bug) and provide links in a comment indicating the model. It is not clear from the description what a "rising power function" is i.e., is a specific function indicated here, or a family of functions? Do any of the links in the right-hand sidebar of https://en.wikipedia.org/wiki/Regression_analysis list the required function / model?

Thanks.
Comment 3 fldrivers 2013-11-26 19:27:01 UTC
For adding regression funcions is sufficient polynomial regression which will be available in 4.2.

But for function in attached file I'm expecting regression with power function (https://en.wikipedia.org/wiki/Power_function or https://cs.wikipedia.org/wiki/Mocninná_funkce), where exponent is -0.92 and constant is -213.1. Data in column A is time (which cannot be negative), column B is measured value (discharging capacitor current in amperes), column C is measured value converted to pA and column D is column C with opposite sign. Expected expression is -213.1 x ^ -0,92 from cx^r . Its not big problem because I can think negative constant c. But solution can be helpful.

Thanks
Comment 4 Joel Madero 2013-12-22 17:15:46 UTC
Thank you for reporting this enhancement request! I can confirm that this is a valid enhancement request on:
Version: 4.3.0.0.alpha0+Build ID: daa57a101a20e0b37db7090796ad002b8d192b9b
Date:   Sun Dec 15 23:07:57 2013 +0100 
Platform: Ubuntu Linux 13.10 x64
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
As I've been able to confirm the enhancement request I am marking as:

New (confirmed)
Enhancement
Lowest - not going to be incredibly useful for the vast majority of our users but a valid request none the less


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
LibreOffice is powered by a team of volunteers, every bug is confirmed (triaged) by human beings who mostly give their time for free. We invite you to join our triaging by checking out this link:
https://wiki.documentfoundation.org/QA/BugTriage

There are also other ways to get involved including with marketing, UX, documentation, and of course developing -  http://www.libreoffice.org/get-help/mailing-lists/. 

Lastly, good bug reports help tremendously in making the process go smoother, please always provide reproducible steps (even if it seems easy) and attach any and all relevant material
Comment 5 Laurent BP 2015-06-20 08:18:32 UTC
Proposed patch for negative value of power trend line:
https://gerrit.libreoffice.org/15357
Same may be applied to exponential trend line:
https://gerrit.libreoffice.org/15353
Comment 6 Philippe Jung 2015-06-21 08:28:59 UTC
Created attachment 116698 [details]
Test file

Wanted to test the gerrit patch, so I started by testing the simple X & Y positive case as the patch relies on this.

But, with a known serie Y= 2 * 3^X, this trend line is not at all what is expected, (at least, what I would expect).
Comment 7 Laurent BP 2015-06-21 19:52:04 UTC
Created attachment 116716 [details]
Test file with positive and negative values for exponential and power trend line

@Philippe: you made wrong assumption about trend lines type:
- Power trend line calculates: y = m.x^p not y = m.p^x
- exponential trend line is what you expected: y = m.exp(a.x) with a = ln(p)
Comment 8 Commit Notification 2015-06-22 09:57:52 UTC
Laurent Balland-Poirier committed a patch related to this issue.
It has been pushed to "master":

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

tdf#70673 Exponential trendline: enable negative Y values

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 9 Commit Notification 2015-06-22 09:59:20 UTC
Laurent Balland-Poirier committed a patch related to this issue.
It has been pushed to "master":

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

tdf#70673 Power trendline: enable negative Y values

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 10 Philippe Jung 2015-06-22 10:02:44 UTC
Patch includes fixes for negative trendline of the form

y = A x ^ B where A < 0

and

y = A exp ( Bx ) where A < 0

I have started unit tests for calculators. (https://gerrit.libreoffice.org/16406) Feel free to add tests.
These tests fails before the patches and pass after that.
Comment 11 Commit Notification 2015-10-09 07:20:05 UTC
Laurent Balland-Poirier committed a patch related to this issue.
It has been pushed to "master":

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

tdf#70673 Improve exponential trend line equation

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.