[R] Observations on SVD linpack errors, and a workaround

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Oct 18 19:42:29 CEST 2007


On Thu, 18 Oct 2007, Ravi Varadhan wrote:

> Hi,
>
> This is in response to Simon's observation about QR decomp being way too
> slow for the "badx" matrix posted by Art Owen.  This is due to the use of
> LINPACK routine DQRDC.  QR decomp is much faster when LAPACK routine is
> used.
>
>> system.time(qr(badx, LAPACK=T))
> [1] 1.11 0.03 1.14   NA   NA
>
>> system.time(qr(badx))  # Simon's timing
>   user  system elapsed
> 845.896   0.164 846.182
>
> Since LAPACK is more recent and has better routines, I think that it should
> be the default for QR decomp (as it is already for SVD).

Please look more carefully at the help page: the default was not changed 
for a very good reason, that the LAPACK and LINPACK versions do not solve 
the same problem and the difference is important for typical R uses of 
qr().  (Hint: look at the value section.)

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list