cv.tripls: Cross-validation for trilinear PLS regression

Description Usage Arguments Value Author(s) Examples

Description

Provides random subset k-fold cross validation for the tripls function. If plot=TRUE, a root mean squared error of prediction plot is drawn.

Usage

1
cv.tripls(X, y, Amax, scaling = TRUE, fold = 10, repeats = 100, plot = TRUE, colors = list(line = "#0000AA", background = "#CCCCFF"))

Arguments

X

The X data as a 3 way (n x p x q) array.

y

The corresponding y data as an n x 1 vector or a length n numeric

Amax

The maximal number of latent components to estimate (integer)

scaling

Logical flag. If TRUE, the data are internally centered and scaled to unit variance. If FALSE, the data are only centered.

fold

The number of cases to leave out in each random cross-validation repeat (integer)

repeats

The number of times to repeat the cross validation process (integer)

plot

Logical flag. If TRUE, an RMSEP plot vs. the number of components is plotted.

colors

A List object specifying the colors for the RMSEP plot. It contains the elements "lines" and "background".

Value

The function returns a list object containing

cvres

A data frame containing a vector of the number of components (1:Amax), and the corresponding RMSEC and RMSEP values

mincv

The number of components that corresponds to the minimal RMSEP

Author(s)

Sven Serneels, BASF Corp.

Examples

1
2
3
data(data_3)
cv.tripls(data_3$X3, data_3$y3, 3, scaling = TRUE, fold = 4, repeats = 100, 
    plot = TRUE, colors = list(line = "#0000AA", background = "#CCCCFF")) 

SvenSerneels/tripls_r documentation built on May 4, 2019, 6:30 a.m.