myriamlr / exposition-family

Automatically exported from code.google.com/p/exposition-family
0 stars 0 forks source link

Lapack oddities. #98

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
With the NK ADNI data, this happens:

###INTERESTING BUG.

X <- makeNominalData(cat.data)
Ix <- nrow(X)
Nx <- ncol(cat.data)
mx <- colSums(X)/sum(X)
wx <- 1/mx
Wx <- diag(wx)
x.bar <- colMeans(X)
X.bar <- matrix(x.bar,nrow(X),ncol(X),byrow=TRUE)

X.dev <- X-X.bar
Zx <- X.dev/X.bar
Zx2 <- X.dev%*%diag(1/x.bar)

                                    row.weights.1 <- rep(1,nrow(X))
                                    row.weights.N <- rep(1/nrow(X),nrow(X))

Zx.mca.works <- corePCA(Zx,M=diag(row.weights.N),W=diag(mx))
Zx.mca.not.works <- corePCA(Zx2,M=diag(row.weights.N),W=diag(mx))

##where the second throws this:Error in La.svd(x, nu, nv) : error code 1 from 
Lapack routine 'dgesdd'

These are identical, except for how they are produced. But even then: Zx/Zx2 
produces all 1s (except where NaNs appear)

Something isn't right. It's either a bizarre bug of:

1) R (R 3.0.2 GUI 1.62 Snow Leopard build (6558))
2) the apple libraries I've linked to or
3) something in the depths of ExPo's SVD pipeline...

Original issue reported on code.google.com by DerekBea...@gmail.com on 17 Dec 2013 at 10:53