On Tuesday, September 15, 2015 at 10:22:47 AM UTC-4, Cedric St-Jean wrote: > > In the discussion of issue 9804 > <https://github.com/JuliaLang/julia/pull/9804#issuecomment-140404574>, > the general consensus seemed to be: > > > Right. "rref" has no use in real numerical coding, but every use in > pedagogy. > > > I had a linear regression yield a PosDefError (the X matrix contains only > integers and was singular). I solved it by selecting a linearly > independent subset of columns > <http://math.stackexchange.com/questions/199125/how-to-remove-linearly-dependent-rows-cols>. > > This uses the Row-Echelon-Form, rref. Is there a simpler way of doing > this that I'm missing? >
A \ x, where A is a non-square matrix, finds least-square solution via QR. This is normally the "right" way to do regression. (You can also compute the QR factorization of A explicitly to get a rank estimate; google "rank revealing QR" for more info on this sort of thing.)
