Laura Quinn wrote:
> I am attempting to perform a pca on a data frame of dimension 5000x19, but
> when I execute
>
> pcapres<-prcomp(pres,center=TRUE)
>
> the following error message is returned:
>
> Error in La.svd(x, nu, nv, method) : error code 18 from Lapack routine
> dgesdd
>
> Where am I going wrong? I am running R-1.8.0 on Debian.
Have you tried using the scale=TRUE argument?
You have to check the Lapack documentation or source to find the error
code's meaning. This is the INFO argument in Lapack routines. Positive
error codes in Lapack indicate some computational failure (singular
matrix, iterative routine fails to converge, ...).
From http://www.netlib.org/lapack/double/dgesdd.f
* INFO (output) INTEGER
* = 0: successful exit.
* < 0: if INFO = -i, the i-th argument had an illegal value.
* > 0: DBDSDC did not converge, updating process failed.
From the DBDSDC.f source:
* INFO (output) INTEGER
* = 0: successful exit.
* < 0: if INFO = -i, the i-th argument had an illegal value.
* > 0: The algorithm failed to compute an singular value.
* The update process of divide and conquer failed.
So it looks like you've found a problem that's a bit numerically odd.
Scaling might help this -- it has for me, and it's more (statistically)
sensible anyway.
Cheers
Jason