tel/clatrix — pull request #33 by fasiha (2013-06-13 19:09:27+00:00)
Title: Added wrapper for jblas' `solveLeastSquares` to clatrix as `lm` (a la R)

While clatrix's `solve` can only be used for *solving* linear systems AX=B (i.e., A must be square), this new `lm` function finds good solutions to AX=B for arbitrary A using jblas' `solveLeastSquares` function. This uses the QR decomposition to find the min-norm (under-determined system, fat A) or least squares (over-determined system, tall A) solution. Also includes basic tests for both `solve` and `lm`.

I called it `lm` because that's what R calls it ("linear model"). I'm open to alternatives.

(Hope to push this functionality to Incanter so it can do ordinary least squares respectably.)