| adjR2 {OmicsPLS} | R Documentation |
Gridwise adjusted R2 for O2PLS
Description
For (a grid of) values for a, nx and ny, loocv calculates the R2 of the joint part. Parallel computing is supported on Windows with package parallel.
Usage
adjR2(
X,
Y,
a = 1:2,
a2 = 1,
b2 = 1,
func = o2m,
parall = F,
cl = NULL,
stripped = TRUE,
p_thresh = 3000,
q_thresh = p_thresh,
tol = 1e-10,
max_iterations = 100
)
Arguments
X |
Numeric matrix. Vectors will be coerced to matrix with |
Y |
Numeric matrix. Vectors will be coerced to matrix with |
a |
Vector of integers. Contains the numbers of joint components. |
a2 |
Vector of integers. Contains the numbers of orthogonal components in |
b2 |
Vector of integers. Contains the numbers of orthogonal components in |
func |
Function to fit the O2PLS model with. Only |
parall |
Integer. Should a parallel cluster be set up using package |
cl |
Object of class ' |
stripped |
Logical. Use the stripped version of o2m (usually when cross-validating)? |
p_thresh |
Integer. If |
q_thresh |
Integer. If |
tol |
Double. Threshold for which the NIPALS method is deemed converged. Must be positive. |
max_iterations |
Integer. Maximum number of iterations for the NIPALS method. |
Details
The use of this function is to calculate the R2 of the joint part, while varying the number of orthogonal components. Adding more joint components will increase the R2!
A parallelized version is built in -tested on windows-, use package parallel and set parall=TRUE to activate this. There should not be already a cluster object with the name cl.
In case of some error, don't forget to invoke stopCluster(cl) to end the cluster. See Task Manager (Windows) to verify that the workers are spanned/ended.
See loocv for more intuition.
Value
Matrix with two rows:
adjR2X |
Contains the joint R2 in X |
adjR2Y |
Contains the joint R2 in Y |