Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

cv.spls

Compute and plot cross-validated mean squared prediction error for SPLS regression


Description

Draw heatmap of v-fold cross-validated mean squared prediction error and return optimal eta (thresholding parameter) and K (number of hidden components).

Usage

cv.spls( x, y, fold=10, K, eta, kappa=0.5,
        select="pls2", fit="simpls",
        scale.x=TRUE, scale.y=FALSE, plot.it=TRUE )

Arguments

x

Matrix of predictors.

y

Vector or matrix of responses.

fold

Number of cross-validation folds. Default is 10-folds.

K

Number of hidden components.

eta

Thresholding parameter. eta should be between 0 and 1.

kappa

Parameter to control the effect of the concavity of the objective function and the closeness of original and surrogate direction vectors. kappa is relevant only when responses are multivariate. kappa should be between 0 and 0.5. Default is 0.5.

select

PLS algorithm for variable selection. Alternatives are "pls2" or "simpls". Default is "pls2".

fit

PLS algorithm for model fitting. Alternatives are "kernelpls", "widekernelpls", "simpls", or "oscorespls". Default is "simpls".

scale.x

Scale predictors by dividing each predictor variable by its sample standard deviation?

scale.y

Scale responses by dividing each response variable by its sample standard deviation?

plot.it

Draw heatmap of cross-validated mean squared prediction error?

Value

Invisibly returns a list with components:

mspemat

Matrix of cross-validated mean squared prediction error. Rows correspond to eta and columns correspond to the number of components (K).

eta.opt

Optimal eta.

K.opt

Optimal K.

Author(s)

Dongjun Chung, Hyonho Chun, and Sunduz Keles.

References

Chun H and Keles S (2010), "Sparse partial least squares for simultaneous dimension reduction and variable selection", Journal of the Royal Statistical Society - Series B, Vol. 72, pp. 3–25.

See Also

Examples

data(yeast)
    set.seed(1)

    # MSPE plot. eta is searched between 0.1 and 0.9 and
    # number of hidden components is searched between 1 and 10

    ## Not run: 
        cv <- cv.spls(yeast$x, yeast$y, K = c(1:10), eta = seq(0.1,0.9,0.1))
        
        # Optimal eta and K
        cv$eta.opt
        cv$K.opt
        (spls(yeast$x, yeast$y, eta=cv$eta.opt, K=cv$K.opt))
    
## End(Not run)

spls

Sparse Partial Least Squares (SPLS) Regression and Classification

v2.2-3
GPL (>= 2)
Authors
Dongjun Chung <chungdon@stat.wisc.edu>, Hyonho Chun <chun@stat.wisc.edu>, Sunduz Keles <keles@stat.wisc.edu>
Initial release
2019-05-04

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.