Perform cross-validation to find the optimal number of variables/groups to keep for each joint component
crossval_sparsity(
X,
Y,
n,
nx,
ny,
nr_folds,
keepx_seq = NULL,
keepy_seq = NULL,
groupx = NULL,
groupy = NULL,
tol = 1e-10,
max_iterations = 100
)
A list containing
A vector with length n, giving the optimal number of variables/groups to keep for each X-joint compoent. One standard error rule is applied
A vector with length n, giving the optimal number of variables/groups to keep for each Y-joint compoent. One standard error rule is applied
A vector with length n, giving the optimal number of variables/groups to keep for each X-joint compoent, without applying the one standard error rule
A vector with length n, giving the optimal number of variables/groups to keep for each Y-joint compoent, without applying the one standard error rule
Numeric matrix. Vectors will be coerced to matrix with as.matrix
(if this is possible)
Numeric matrix. Vectors will be coerced to matrix with as.matrix
(if this is possible)
Integer. Number of joint PLS components. Must be positive.
Integer. Number of orthogonal components in \(X\). Negative values are interpreted as 0
Integer. Number of orthogonal components in \(Y\). Negative values are interpreted as 0
Integer. Number of folds of CV
Numeric vector. A vector indicating how many variables/groups to keep for CV in each of the joint component of X. Sparsity of each joint component will be selected sequentially.
Numeric vector. A vector indicating how many variables/groups to keep for CV in each of the joint component of Y. Sparsity of each joint component will be selected sequentially.
Vector. Used when sparse = TRUE
. A vector of strings indicating group names of each X-variable. Its length must be equal to the number of variables in \(X\). The order of group names must corresponds to the order of the variables.
Vector. Used when sparse = TRUE
. A vector of strings indicating group names of each Y-variable. The length must be equal to the number of variables in \(Y\). The order of group names must corresponds to the order of the variables.
Double. Threshold for which the NIPALS method is deemed converged. Must be positive.
Integer. Maximum number of iterations for the NIPALS method.