statistics icon indicating copy to clipboard operation
statistics copied to clipboard

add test for regressions

Open mwotton opened this issue 10 years ago • 2 comments

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.

mwotton avatar May 22 '15 04:05 mwotton

I think I have the invariants right now, but I am still getting -Infinity for R-squared, which should range from 0 to 1.

mwotton avatar May 22 '15 05:05 mwotton

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)].

Shimuuar avatar May 22 '15 19:05 Shimuuar