https://bz.apache.org/bugzilla/show_bug.cgi?id=62836
--- Comment #3 from Matthias Becht <[email protected]> --- I'm still not entirely sure about all of Excel's behavior: - So if all x and y values are the same, Excel just returns that value, no matter what? - If the y's are different but all x's are the same, Commons Math works but gives a different answer than Excel. For instance the test "All x values the same" (B65; currently skipped) gives -32 but Excel gives 12, which is simply the average of the two y values (20 and 4). Is this just mathematically illegal, and Excel chooses to simply average the y values or what is happening here? - When there is only one y value, Excel generally just returns that, but it does still calculate the linear regression if the constant is set to false in order to force the line to go through zero. I'm assuming it just adds (0,0) as another point in that case. When there is still only one y value but multiple x variables to go with it, the y value is always returned, even if the constant is set to false, which also makes sense since it would need more than just the point (0,0) to add another sample. I guess the easiest thing to do then would be to automatically add the point (0,0) if there is only one y and one x value and the constant is set to false. When there are multiple x variables, the new_x's, if given, need to be exactly the same dimensions as x (which has to be either a single column or row), or #REF! is given. I must admit that I don't know much about the underlying mathematics of this, so there are probably many obvious things I'm missing. -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
