Description Usage Arguments Value Author(s) Examples
Takes in a set of predictor variables and a set of response variables and produces a PLS biplot for the SPLS with the labels of the tick markers excluded.
1 2 |
X |
A (NxP) predictor matrix |
Y |
A (NxM) response matrix |
algorithm |
The SPLS algorithm |
eps |
Cut off value for convergence step |
lambdaY |
A value for the penalty parameters for the soft-thresholding penalization function for Y-weights |
lambdaX |
A value for the penalty parameters for the soft-thresholding penalization function for X-weights |
ax.tickvec.X |
tick marker length for each X-variable axis in the biplot |
ax.tickvec.Y |
tick marker length for the Y-variable axis in the biplot |
... |
Other arguments. Currently ignored |
The PLS biplot of a SPLS of D=[X Y] with some parameters
Opeoluwa F. Oyedele and Sugnet Gardner-Lubbe
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | if(require(robustbase))
data(toxicity, package="robustbase")
Y1 = as.matrix(cbind(toxicity$toxicity))
dimnames(Y1) = list(paste(1:nrow(Y1)), "toxicity")
X1 = as.matrix(cbind(toxicity[,2:10]))
rownames(X1) = paste(1:nrow(X1))
#choosing a value for the penalty parameters lambdaY and lambdaX for this data
main2 = opt.penalty.values(X=scale(X1), Y=scale(Y1), A=2, algorithm=mod.SPLS, eps=1e-5,
from.value.X=0, to.value.X=10, from.value.Y=0, to.value.Y=0, lambdaY.len=1, lambdaX.len=100)
min.RMSEP.value = main2$min.RMSEP.value
lambdaY.to.use = main2$lambdaY.to.use
lambdaX.to.use = main2$lambdaX.to.use
list(lambdaY.to.use=lambdaY.to.use, lambdaX.to.use=lambdaX.to.use, min.RMSEP.value=min.RMSEP.value)
#SPLS analysis
main3 = mod.SPLS(X=scale(X1), Y=scale(Y1), A=2,
lambdaY=lambdaY.to.use, lambdaX=lambdaX.to.use,
eps=1e-5)
X.to.use = main3$X.select
Y.to.use = main3$Y.select
X.new = as.matrix(X1[,X.to.use])
Y.new = as.matrix(Y1[,Y.to.use])
colnames(Y.new) = colnames(Y1)
SPLS.biplot_no_ax.labels(X.new, Y.new,
algorithm=mod.SPLS, lambdaY=lambdaY.to.use,
lambdaX=lambdaX.to.use,
eps=1e-5, ax.tickvec.X=rep(3,ncol(X.new)),
ax.tickvec.Y=rep(4,ncol(Y.new)))
#ash data
if(require(chemometrics))
data(ash, package="chemometrics")
X1 = as.matrix(ash[,10:17], ncol=8)
Y1 = as.matrix(ash$SOT)
colnames(Y1) = paste("SOT")
#choosing a value for the penalty parameters lambdaY and lambdaX for this data
main2 = opt.penalty.values(X=scale(X1), Y=scale(Y1), A=2, algorithm=mod.SPLS, eps=1e-5,
from.value.X=0, to.value.X=500, from.value.Y=0, to.value.Y=0, lambdaY.len=1, lambdaX.len=100)
min.RMSEP.value = main2$min.RMSEP.value
lambdaY.to.use = main2$lambdaY.to.use
lambdaX.to.use = main2$lambdaX.to.use
list(lambdaY.to.use=lambdaY.to.use, lambdaX.to.use=lambdaX.to.use, min.RMSEP.value=min.RMSEP.value)
#SPLS analysis
main3 = mod.SPLS(X=scale(X1), Y=scale(Y1), A=2,
lambdaY=lambdaY.to.use, lambdaX=lambdaX.to.use,
eps=1e-5)
X.to.use = main3$X.select
Y.to.use = main3$Y.select
X.new = as.matrix(X1[,X.to.use])
colnames(X.new) #P=6
colnames(X1) #P=8
Y.new = as.matrix(Y1[,Y.to.use])
colnames(Y.new) = colnames(Y1)
colnames(Y.new)
SPLS.biplot_no_ax.labels(X.new, Y.new,
algorithm=mod.SPLS, lambdaY=lambdaY.to.use,
lambdaX=lambdaX.to.use,
eps=1e-5, ax.tickvec.X=rep(1,ncol(X.new)),
ax.tickvec.Y=rep(5,ncol(Y.new)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.