tpls.RdDeveloped @ Melbourne Integrative Genomics. Intuition: Fourier-based m transforms compact the data across time points, but preserve the information association for each sample and each feature. In doing so, pls works by calculating the singular vectors associated with a 'global' (across time points) top singular value, and deflating just that relevant face.
tpls(
x,
y,
ncomp = NULL,
m = NULL,
minv = NULL,
mode = "regression",
center = TRUE,
matrix_output = TRUE,
transform_y = NULL,
face_scaling = NULL,
bpparam = NULL
)Tensor input.
Tensor input, or a vector / n x q matrix for a response fixed per
subject (see transform_y).
The estimated number of components. ncomp must be explicitly set as an integer in tpls.
A function which applies an orthogonal tensor tubal transform.
The inverse of m.
Currently supports tensor analogues of canonical ("canonical"), regression ("regression"), and svd ("tsvdm") PLS variants. Defaults to "regression".
If set to false, the data tensor will not be centralized into Mean Deviation Form (see Mor et al. 2022). By default, the mean horizontal slice of the input tensor(s) are subtracted, so that all of the horizontal slices sum to 0, analgous to centering matrix data.
Note: FALSE ONLY AFFECTS THE OUTPUT IN "tsvdm" MODE. TRUE by default. Collects the top singular vectors across the tensor, organized by the magnitude of the corresponding singular vector, and place them into the columns of a matrix. Corresponds to the 'matrix compression' type of scheme described in Mor et al. 2022.
Whether to m-transform the response with x. NULL by default, which decides from the shape of y: a vector or an n x q matrix is a response fixed per subject, such as an endpoint measured once, and is not transformed, so that every face of x is compared with the response itself; an order-3 tensor is transformed. A response that is constant over time and transformed is non-zero on the first face only, which under the default DCT holds the subject time averages. An untransformed response is deflated on every face after each component. TRUE copies a subject-fixed response over time and transforms it; FALSE needs a response that is the same at every time point.
How faces compete when each component picks one. "frobenius" divides each face's score, the largest singular value of t(xhat_f) yhat_f, by the Frobenius norms of xhat_f and yhat_f, so that faces compete on a common scale. "none" compares the raw scores, which favours the face with most variance; under the default DCT that is face 1, which also holds the between-subject variation. It affects which face is chosen only. NULL by default: "frobenius" for an untransformed response, "none" otherwise.
A BiocParallelParam-class object
indicating the type of parallelisation. Does not have any effect if transform
functions explicitly set using m, minv.
A list containing:
The number of components used.
The centered input tensor X.
The centered input tensor Y.
The PLS mode used: "canonical", "regression", or "tsvdm".
Whether the response was m-transformed.
How faces were compared: "frobenius" or "none".
Matrix of X loadings (p x ncomp), or loadings tensor
if mode = "tsvdm" AND matrix_output = FALSE.
Matrix of Y loadings (q x ncomp), or loadings tensor
if mode = "tsvdm" AND matrix_output = FALSE.
Matrix of X projections (n x ncomp), or proections
tensor when mode = "tsvdm" AND matrix_output = FALSE.
Matrix of Y projections (n x ncomp), or proections
tensor when mode = "tsvdm" AND matrix_output = FALSE.
Vector of selected feature indices per component (only
when matrix_output = TRUE).
Vector of selected tensor face indices per component (only
when matrix_output = TRUE).
Whether x and y were centered.
The mean horizontal slices subtracted from x (p x t) and y (q x t), or NULL if they were not centered.
The transform pair used.
The X deflation coefficients of each component (p x ncomp), NULL in tsvdm mode.
In regression mode, the coefficients of Y on the X variates of each component (q x ncomp), which deflate Y; NULL in canonical and tsvdm modes.