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 317426 - LINEST (and friends) does not support matrix array input
LINEST (and friends) does not support matrix array input
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: Analytics
git master
Other All
: High normal
: ---
Assigned To: Morten Welinder
Jody Goldberg
Depends on: 361074
Blocks:
 
 
Reported: 2005-09-28 12:05 UTC by Jean Bréfort
Modified: 2010-06-12 01:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
the workbook showing that problem (21.67 KB, application/vnd.ms-excel)
2006-02-25 19:54 UTC, Jean Bréfort
  Details
Tentative patch (17.29 KB, patch)
2010-06-11 16:44 UTC, Morten Welinder
none Details | Review
Typo fixed (17.29 KB, patch)
2010-06-11 17:12 UTC, Morten Welinder
accepted-commit_now Details | Review

Description Jean Bréfort 2005-09-28 12:05:50 UTC
a formula such as :
=linest(B3:B32,A3:A32^{1,2,3,4,5,6})
gives an error in gnumeric, but works in excel. Gnumeric also emits criticals :

** (gnumeric:16705): CRITICAL **: value_area_get_x_y: assertion `x <
v->v_array.x && y < v->v_array.y' failed
Comment 1 Andreas J. Guelzow 2005-09-28 13:06:59 UTC
I am not sure what A3:A32^{1,2,3,4,5,6} is supposed to do. It looks to me like
this is not a linest issue, since 
=sum(A1:A6^{1,2,3})
with A1:A6 containing 1 through 6 yields "6" which does not seem to make any sense.

In any case, what does excel calculate for your formula?
Comment 2 Jean Bréfort 2005-09-28 13:34:27 UTC
polynomial regression. This was in an excel file jody sent to me (I have not
enough imagination to devise such a formula).
Comment 3 Jody Goldberg 2006-02-23 05:38:36 UTC
jean : could you attach the workbook or tell me which one.  A few details of where to look to find the mis-calculation would also be useful.
Comment 4 Jean Bréfort 2006-02-25 19:54:04 UTC
Created attachment 60120 [details]
the workbook showing that problem

The bug affects "Polynomial" and "sin function" sheets. Predicted Y are clearly not correct.
Comment 5 André Klapper 2006-09-30 09:48:23 UTC
reopening as requested information has been provided.
Comment 6 Jody Goldberg 2006-10-14 01:32:12 UTC
Ahh, I see at least part of the problem.
We had only tested in the case of array*array we only supported
  row * row and col * col
when things did not match
  col * row or row * col
thngs broke.  On top of that there was an additional error that even when things did work we did not bounds check and multiplying vectors of the same type but different sizes could produce errors.
Comment 7 Jody Goldberg 2006-10-16 23:52:26 UTC
Looks like there is another level of screw up operating here.
Even once the array evaluation is fixed (A1:B2^{1,2,3} now works), things are still broken.  The code in LINEST and it's cut-n-paste replicas does not handle array arguments that are not vectors.   We need to modernize things in there.
Comment 8 Morten Welinder 2010-06-11 16:44:00 UTC
Created attachment 163398 [details] [review]
Tentative patch

This ought to fix LINEST.  It needs testing and needs to be extended to
the other copy-pasted locations in the same file.
Comment 9 Morten Welinder 2010-06-11 17:12:00 UTC
Created attachment 163401 [details] [review]
Typo fixed
Comment 10 Andreas J. Guelzow 2010-06-11 22:01:45 UTC
Review of attachment 163401 [details] [review]:

Looks good to me. Please commit.
Comment 11 Morten Welinder 2010-06-12 01:19:34 UTC
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.

When the collector is improved to handle blanks better, more functions can use
this.  (Must also check what Excel does if it gets a column and a row in, say,
TREND.)