| gplssvd_op | R Documentation |
Compute the top-k singular triplets of S = Xe' Ye without
materializing the whitened matrices Xe = Mx^{1/2} X Wx^{1/2},
Ye = My^{1/2} Y Wy^{1/2} when doing so would densify sparse data.
When the whitening is sparsity-preserving (identity/diagonal metrics) or
the data are dense, the whitened blocks are precomputed once so each
matrix-vector product in the iterative SVD costs two multiplies.
gplssvd_op(
X,
Y,
XLW = NULL,
YLW = NULL,
XRW = NULL,
YRW = NULL,
k = 2,
center = FALSE,
scale = FALSE,
svd_backend = c("eigencore", "irlba", "RSpectra"),
svd_opts = list(tol = 1e-07, maxitr = 1000),
constraints_remedy = c("error", "ridge", "clip", "identity")
)
X |
n x I matrix (numeric or Matrix) |
Y |
n x J matrix (numeric or Matrix) |
XLW |
Row metric for X (M_X): NULL/identity, numeric length-n, diagonalMatrix, or PSD Matrix |
YLW |
Row metric for Y (M_Y) |
XRW |
Column metric for X (W_X) |
YRW |
Column metric for Y (W_Y) |
k |
Number of components. If |
center, scale |
Logical; pre-center/scale columns of X, Y before metrics |
svd_backend |
One of "eigencore" (default) or "irlba"; "RSpectra" is
accepted as a deprecated alias of "eigencore". Ignored
whenever both |
svd_opts |
List of options for the backend: |
constraints_remedy |
What to do with a metric that is not positive
semi-definite: |
Naming map: this function names its metrics XLW/YLW (left/row
weights) and XRW/YRW (right/column weights); these correspond to
Mx/My (row metrics) and Ax/Ay (column metrics) in genpca()'s and
genpls()'s M/A convention.
A list with elements:
Length-k numeric vector of singular values of
S = Xe' Ye.
I x k matrix; left singular vectors of S (orthonormal in
the Euclidean metric).
J x k matrix; right singular vectors of S (orthonormal in
the Euclidean metric).
I x k matrix of generalized X-weights,
p = W_X^{-1/2} u.
J x k matrix of generalized Y-weights,
q = W_Y^{-1/2} v.
I x k matrix of X-variable scores, F_i = W_X p D
(columns of p rescaled by the singular values).
J x k matrix of Y-variable scores, F_j = W_Y q D.
N x k matrix of X row latent variables,
L_x = M_X^{1/2} X W_X p.
N x k matrix of Y row latent variables,
L_y = M_Y^{1/2} Y W_Y q.
Integer; number of components actually returned (may be
less than the requested k if it exceeded min(I, J)).
A list list(N, I, J) with the row count N and column
counts I = ncol(X), J = ncol(Y).
A list list(X, Y) of the length-I / length-J
column means subtracted from X/Y (all zero when
center = FALSE).
A list list(X, Y) of the length-I / length-J
column scale factors divided out of X/Y (all one when
scale = FALSE).
Beaton, D. (2020). Generalized eigen, singular value, and partial least squares decompositions: The GSVD package. arXiv:2010.14734.
Abdi, H. (2007). Partial least square regression PLS-Regression. In N. Salkind (Ed.), Encyclopedia of Measurement and Statistics. Thousand Oaks, CA: Sage.
set.seed(1)
X <- matrix(rnorm(40 * 6), 40, 6)
Y <- matrix(rnorm(40 * 4), 40, 4)
op <- gplssvd_op(X, Y, k = 2, center = TRUE)
round(op$d, 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.