statistics
statistics copied to clipboard
add test for regressions
I'm having a bit of trouble understanding how the least-squares regression is meant to be called, so I added a failing test with my understanding of the constraints.
I think I have the invariants right now, but I am still getting -Infinity for R-squared, which should range from 0 to 1.
I didn't looked at code closely not I did try to run it. But R² = ∞ could happen if matrix becomes singular. Having more rows that columns is necessary but not sufficient condition. For example it's not possible to make regression with following points: [(0,1),(0,2),(0,3)].