Learn R Programming

bootsPLS (version 1.1.2)

spls.hybrid: spls.hybrid, midway between PLS and sPLS

Description

Performs a constraint sPLS on the first PLS-components and a sPLS on the last components

Usage

spls.hybrid(X,
            Y,
            ncomp = 2,
            mode = c("regression", "canonical", "invariant", "classic"),
            max.iter = 500,
            tol = 1e-06,
            keepX.constraint,
            keepY.constraint,
            keepX,
            keepY,
            near.zero.var = FALSE)

Arguments

X

numeric matrix of predictors. NAs are allowed.

Y

numeric vector or matrix of responses (for multi-response models). NAs are allowed.

ncomp

the number of components to include in the model (see Details). Default is 2.

mode

character string. What type of algorithm to use. one of "regression", "canonical", "invariant" or "classic". See Details.

max.iter

integer, the maximum number of iterations.

tol

a positive real, the tolerance used in the iterative algorithm.

keepX.constraint

A list containing which variables of X are to be kept on each of the first PLS-components.

keepY.constraint

A list containing which variables of Y are to be kept on each of the first PLS-components.

keepX

number of \(X\) variables kept in the model on the last components.

keepY

number of \(Y\) variables kept in the model on the last components.

near.zero.var

boolean, see the internal nearZeroVar function (should be set to TRUE in particular for data with many zero values). Setting this argument to FALSE (when appropriate) will speed up the computations.

Value

A 'spls.hybrid' object is returned. The object is a list that contains the following components:

X

the centered and standardized original predictor matrix.

Y

the centered and standardized original response vector or matrix.

ncomp

the number of components included in the model.

mode

the algorithm used to fit the model.

keepX.constraint

A list of length ncomp containing which variables of X are to be kept on each component.

keepY.constraint

A list of length ncomp containing which variables of Y are to be kept on each component.

mat.c

matrix of coefficients to be used internally by predict.

variates

list containing the variates.

loadings

list containing the estimated loadings for the \(X\) and \(Y\) variates.

names

list containing the names to be used for individuals and variables.

nzv

list containing the zero- or near-zero predictors information, for X and Y.

coeff

A list of means.X, sigma.X, means.Y and sigma.Y. Means and variances for the variables of X and the columns of Y.mat.

Details

The spls.hybrid function allows you to compute a constraint spls on the first components and a spls on the last components. Note that the only condition on keepX.constraint and keepX is that the sum of both length is ncomp; likewise for the ones relative to Y.

References

Rohart et al. (2016). A Molecular Classification of Human Mesenchymal Stromal Cells. PeerJ, DOI 10.7717/peerj.1845

Examples

Run this code
# NOT RUN {
data(MSC)
X=MSC$X
Y=MSC$Y

Y.mat=unmap(Y)

n=nrow(X)
p=ncol(X)


keepX.constraint=list(sample(1:p,7),sample(1:p,15))
fit=spls.hybrid(X,Y=Y.mat,ncomp=4,keepX.constraint=keepX.constraint,keepX=c(5,10))

plotIndiv(fit,ind.names=FALSE)
# }

Run the code above in your browser using DataLab