matrix icon indicating copy to clipboard operation
matrix copied to clipboard

QR Decomposition with column pivoting

Open ArniDagur opened this issue 3 years ago • 2 comments

My goal is to implement an equivalent to the LINEST function in excel. The goal is to calculate a mulitple linear regression for matrices that are potentially not full rank. My (limited) understanding is that this requires doing "column pivoting" in the implementation of QR decomposition. Does ml-matrix support this algorithm? Currently it seems that QrDecomposition.solve fails when the matrix is not full rank.

ArniDagur avatar Jun 01 '21 10:06 ArniDagur

It probably doesn't support this algorithm. Do you have a reference on this?

targos avatar Jun 01 '21 11:06 targos

  • Julia notebook, "Householder QR with column pivoting": https://hua-zhou.github.io/teaching/biostatm280-2019spring/slides/11-qr/qr.html#Householder-QR-with-column-pivoting

  • Here is an explaination from lapack docs: https://www.netlib.org/lapack/lug/node42.html

    To solve a linear least squares problem (2.1) when A is not of full rank, or the rank of A is in doubt, we can perform either a QR factorization with column pivoting ...

  • Here is a Rust implementation in nalgebra: https://github.com/dimforge/nalgebra/pull/613/files

ArniDagur avatar Jun 01 '21 12:06 ArniDagur