GNOME Bugzilla – Bug 317426
LINEST (and friends) does not support matrix array input
Last modified: 2010-06-12 01:19:34 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
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?
polynomial regression. This was in an excel file jody sent to me (I have not enough imagination to devise such a formula).
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.
Created attachment 60120 [details] the workbook showing that problem The bug affects "Polynomial" and "sin function" sheets. Predicted Y are clearly not correct.
reopening as requested information has been provided.
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.
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.
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.
Created attachment 163401 [details] [review] Typo fixed
Review of attachment 163401 [details] [review]: Looks good to me. Please commit.
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.)