X-Git-Url: https://git.auder.net/?p=valse.git;a=blobdiff_plain;f=pkg%2FR%2FEMGrank.R;h=db0b8f2df276684c352601778e9fb6ac43396f80;hp=db409481bcfffe6a94000d6982b18ce1f2ccedb1;hb=96b591b7a76da9780e766ead693eb065281b6d62;hpb=c8baa02224d4ee13889e964b56b9a67280c1816f diff --git a/pkg/R/EMGrank.R b/pkg/R/EMGrank.R index db40948..db0b8f2 100644 --- a/pkg/R/EMGrank.R +++ b/pkg/R/EMGrank.R @@ -73,8 +73,8 @@ matricize <- function(X) if (length(Z_indice) == 0) next # U,S,V = SVD of (t(Xr)Xr)^{-1} * t(Xr) * Yr - s <- svd(MASS::ginv(crossprod(matricize(X[Z_indice, ]))) - %*% crossprod(matricize(X[Z_indice, ]), matricize(Y[Z_indice, ]))) + s <- svd(MASS::ginv(crossprod(matricize(X[Z_indice, ]))) %*% + crossprod(matricize(X[Z_indice, ]), matricize(Y[Z_indice, ]))) S <- s$d # Set m-rank(r) singular values to zero, and recompose best rank(r) approximation # of the initial product