R has a qr() function, which performs QR decomposition using either LINPACK or LAPACK (in my experience, the latter is 5% faster). The main object returned is a matrix "qr" that contains in the upper triangular matrix R (i.e. R=qr[upper.tri(qr)]). So far so good. The lower triangular part of qr contains Q "in compact form". One can extract Q from the qr decomposition by using qr.Q(). I would like to find the inverse of qr.Q(). In other word, I do have Q and R, and would like to put them in a "qr" object. R is trivial but Q is not. The goal is to apply to it qr.solve(), which is much faster than solve() on large systems.
I am confused regarding the qr.Q() code. I tried it and it doesn't seem to work. I'm sure I made a mistake. Could you elaborate on this point of code?
I will say one thing that solve() also depends / uses LAPACK along with almost all the general linear algebra stuff in R. So it should be very fast for large systems as well. You can try to compile R from source with the latest ATLAS libraries. If you have a multicore computer you can use multithreaded ATLAS BLAS & LAPACK, which is extremely fast, comparable to the commercial MKL BLAS & LAPACK from Intel. ATLAS is open source. Using multithreaded ATLAS on a centrino duo Ubuntu 64-bit laptop, I could matrix multiply a 3000 by 3000 matrix of doubles with itself in around 4 seconds. I think all serious R users should take advantage of multithreaded ATLAS. Imho solve() should not be that slow especially if you are taking advantage of all available threads.
Please do elaborate on qr.Q(). Thanks.