loocv_combi: K-fold CV based on symmetrized prediction error

View source: R/OmicsPLS.R

loocv_combiR Documentation

K-fold CV based on symmetrized prediction error

Description

The prediction error of both X~Xhat and Y~Yhat are summed. This provides a symmetrized version of loocv.

Usage

loocv_combi(
  X,
  Y,
  a = 1:2,
  a2 = 1,
  b2 = 1,
  fitted_model = NULL,
  func = o2m,
  app_err = F,
  kcv,
  stripped = TRUE,
  p_thresh = 3000,
  q_thresh = p_thresh,
  tol = 1e-10,
  max_iterations = 100,
  seed = "off"
)

Arguments

X

Numeric matrix. Vectors will be coerced to matrix with as.matrix (if this is possible)

Y

Numeric matrix. Vectors will be coerced to matrix with as.matrix (if this is possible)

a

Vector of integers. Contains the numbers of joint components.

a2

Vector of integers. Contains the numbers of orthogonal components in X.

b2

Vector of integers. Contains the numbers of orthogonal components in Y.

fitted_model

List. Deprecated. O2PLS model fit with o2m. Is used to calculate the apparent error without recalculating this fit.

func

Function to fit the O2PLS model with. Only o2m and o2m_stripped are supported.

app_err

Logical. Deprecated. Should the apparent error also be computed?

kcv

Integer. The value of k, i.e. the number of folds. Choose N for LOO-CV.

stripped

Logical. Use the stripped version of o2m (usually when cross-validating)?

p_thresh

Integer. If X has more than p_thresh columns, a power method optimization is used, see o2m2

q_thresh

Integer. If Y has more than q_thresh columns, a power method optimization is used, see o2m2

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.

seed

Integer. A random seed to make the analysis reproducible.

Details

Note that this function can be easily parallelized (on Windows e.g. with the parallel package.). If there are NAs in the CVerr component, this is due to an error in the fitting.

Value

List with two numeric vectors:

CVerr

Contains the k-fold CV estimated RMSEP

Fiterr

Contains the apparent error


selbouhaddani/OmicsPLS documentation built on Aug. 25, 2022, 9:52 p.m.