After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 779177 - Regression Equation with Date Axis
Regression Equation with Date Axis
Product: libgoffice
Classification: Other
Component: Graphing / Charting
Other All
: Normal enhancement
: ---
Assigned To: Jean Bréfort
Jody Goldberg
Depends on:
Reported: 2017-02-24 13:03 UTC by Morten Welinder
Modified: 2018-05-22 13:09 UTC
See Also:
GNOME target: ---
GNOME version: ---

Sample file (2.75 KB, application/x-gnumeric)
2017-02-24 13:03 UTC, Morten Welinder

Description Morten Welinder 2017-02-24 13:03:48 UTC
Created attachment 346633 [details]
Sample file

1-Jan-2001	1
1-Jan-2002	3
1-Jan-2003	2
1-Jan-2004	5
1-Jan-2005	4
1-Jan-2006	7
1-Jan-2007	6
1-Jan-2008	9
1-Jan-2009	8
1-Jan-2010	10

Graph that data and add a linear regression and an equation to go with that.
I see "0.00260507x-94.887".

That is, I'm sure, a correct equation, but in contains in it raw information
about the date system we use.

0.002507 makes sense: it is increment per day.

-94.889 does not: it is the predicted Y value for 1-Jan-1900. (Bearing in mind
that we have a hole in the date numbering where 1900-02-29 would have been
and that all date is after that hole, the right date is probably 1899-Dec-31.)

I think we would be better off presenting the result as

Comment 1 Jean Bréfort 2017-02-24 13:14:29 UTC
We clearly need to add a format to the equation (and may be even a format for each coefficient).
Comment 2 Jean Bréfort 2017-02-24 14:38:34 UTC
The other way might be to retrieve the preferred format for the x values, unfortunately, it is not currently possible from the reg curves code. We would need an ABI break, at least (we need a new method in GogSeriesClass).
Comment 3 Morten Welinder 2017-02-24 17:29:34 UTC
It would definitely be useful to have a way to format values used in the
equation.  I don't think it will be very useful to use the X axis format,
though: in y=ax+b, b in units of the Y axis and a is in units of Y/X.
For regressions other than linear regression it is even more complicated.

However, we would need access to the X axis to do the change I mentioned
in the initial report.  We would need to check that

    gog_axis_is_zero_important(axis) == FALSE

before applying the offset-x method.
Comment 4 GNOME Infrastructure Team 2018-05-22 13:09:17 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: