MBValidation {MBAnalysis}R Documentation

Cross-Validation of MBPLS or MBWCov models

Description

Computes MSEP and corresponding standard error based on Leave One Out (LOO) or Out Of Bag (OOB) Cross-Validation (CV) by number of components of a MBPLS or MBWCov model from MBPLS or MBWCov.

Usage

MBValidation(
  res,
  ncomp.max = min(res$call$ncomp, nrow(res$call$X) - 2, ncol(X)),
  method = "LOO",
  nboot = 1000,
  graph = TRUE,
  size.graph = 2.25
)

Arguments

res

An object resulting from MBPLS or MBWCov.

ncomp.max

The maximum number of components to be investigated in the CV procedure.

method

Either "LOO" or "OOB". Default is LOO.

nboot

Number of bootstrap samples to be generated in case of OOB CV.

graph

Logical. Should the results be plotted? Default is TRUE.

size.graph

If graph=TRUE, the overall size of labels, points, etc.

Value

A matrix with two rows (MSEP and std.error) and ncomp.max+1 columns. The +1 column corresponds to the null model (Dim.0) where Y is predicted by its empirical average on the training sample.

See Also

predict.MBPLS predict.MBWCov

Examples

# With MBPLS

data(ham)
X=ham$X
block=ham$block
Y=ham$Y
res.mbpls <- MBPLS(X, Y, block, name.block = names(block))
MBValidation(res.mbpls)

# With MBWCov

data(ham)
X=ham$X
block=ham$block
Y=ham$Y
res.mbwcov <- MBWCov(X, Y, block, name.block = names(block))
MBValidation(res.mbwcov)


[Package MBAnalysis version 2.0.2 Index]