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.
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 | 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])
colnames(X.new)
Y.new = as.matrix(Y1[,Y.to.use])
colnames(Y.new) = colnames(Y1)
colnames(Y.new)
SPLS.biplot(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(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)))
|
Loading required package: robustbase
$lambdaY.to.use
[1] 0
$lambdaX.to.use
[1] 0
$min.RMSEP.value
[1] 0.4551436
[1] "logKow" "pKa" "ELUMO" "Ecarb" "Emet" "RM" "IR" "Ts"
[9] "P"
[1] "toxicity"
$overall.quality
[1] 0.959
$axis.pred
logKow pKa ELUMO Ecarb Emet RM IR Ts
0.991 0.933 0.991 1.000 0.916 0.967 1.000 0.958
P toxicity
0.752 0.815
$D.hat
logKow pKa ELUMO Ecarb Emet RM IR Ts P toxicity
1 1.769 1.012 4.98 17.6 2.982 36.0 1.44 36.4 9.85 -0.25379
2 0.850 0.857 4.61 17.1 1.166 28.6 1.44 40.2 6.75 -0.45159
3 1.138 0.928 4.77 17.3 1.712 30.9 1.44 39.0 7.90 -0.39764
4 2.838 1.059 5.18 18.0 5.225 44.3 1.44 32.5 12.42 0.02251
5 0.826 0.859 4.62 17.1 1.112 28.4 1.44 40.3 6.71 -0.45900
6 2.785 1.069 5.19 18.0 5.101 44.0 1.44 32.7 12.40 0.00442
7 1.382 0.877 4.71 17.3 2.286 32.7 1.44 38.3 8.00 -0.31296
8 1.316 0.936 4.80 17.3 2.086 32.3 1.44 38.3 8.33 -0.35155
9 0.330 0.785 4.43 16.9 0.124 24.4 1.44 42.3 5.11 -0.56880
10 2.496 0.921 4.90 17.7 4.627 41.3 1.44 34.2 10.65 -0.02349
11 3.471 0.892 4.96 18.0 6.745 48.8 1.44 30.9 12.43 0.25382
12 4.051 0.830 4.92 18.1 8.046 53.1 1.44 29.1 13.15 0.43367
13 4.508 0.825 4.96 18.3 9.031 56.5 1.44 27.5 14.05 0.56075
14 1.670 0.957 4.88 17.5 2.823 35.1 1.44 37.0 9.22 -0.26203
15 1.623 0.937 4.84 17.4 2.742 34.7 1.44 37.2 8.97 -0.26796
16 2.996 0.873 4.88 17.8 5.746 45.1 1.44 32.6 11.30 0.13024
17 1.906 0.898 4.80 17.5 3.387 36.8 1.44 36.4 9.25 -0.17680
18 -0.295 0.870 4.51 16.8 -1.299 19.8 1.44 44.2 4.48 -0.76948
19 0.219 0.875 4.58 16.9 -0.203 23.7 1.44 42.4 5.58 -0.63037
20 -0.699 0.618 4.03 16.4 -1.918 16.0 1.44 46.6 1.68 -0.79281
21 4.161 0.746 4.78 18.1 8.365 53.7 1.45 29.0 12.72 0.49324
22 3.193 0.796 4.77 17.8 6.244 46.4 1.44 32.2 11.11 0.21093
23 -0.960 0.119 3.14 15.8 -1.987 12.7 1.45 49.4 -2.76 -0.69087
24 0.712 0.856 4.60 17.1 0.871 27.5 1.44 40.7 6.45 -0.48906
25 2.211 0.845 4.74 17.6 4.092 39.0 1.44 35.5 9.46 -0.07485
26 1.215 0.863 4.66 17.2 1.941 31.4 1.44 38.9 7.55 -0.35381
27 1.164 0.327 3.73 16.7 2.359 29.6 1.45 41.1 3.25 -0.18155
28 0.864 0.831 4.57 17.1 1.220 28.6 1.44 40.3 6.57 -0.43894
29 1.926 0.275 3.73 16.9 4.041 35.3 1.45 38.6 4.42 0.04502
30 1.160 0.697 4.37 17.1 1.987 30.5 1.44 39.8 6.14 -0.31122
31 0.676 0.278 3.60 16.5 1.362 25.7 1.45 43.0 1.87 -0.29825
32 1.057 -0.510 2.28 15.9 2.950 26.6 1.47 44.6 -3.50 0.07957
33 2.588 0.301 3.84 17.2 5.433 40.4 1.45 36.2 5.99 0.21711
34 2.068 -0.036 3.21 16.7 4.651 35.6 1.46 39.3 2.29 0.19180
35 -0.414 -0.295 2.49 15.6 -0.410 15.8 1.46 49.0 -4.86 -0.39768
36 2.595 -0.125 3.11 16.8 5.866 39.4 1.46 37.7 2.68 0.36686
37 3.104 0.203 3.73 17.2 6.635 44.1 1.45 34.7 6.30 0.39235
38 0.841 0.608 4.18 16.9 1.390 27.8 1.45 41.2 4.78 -0.36776
$Bmat
toxicity
logKow 3.509
pKa -1.915
ELUMO -1.632
Ecarb 0.724
Emet 3.022
RM 1.880
IR -0.165
Ts -2.045
P 1.332
Loading required package: chemometrics
Loading required package: rpart
$lambdaY.to.use
[1] 0
$lambdaX.to.use
[1] 10.10101
$min.RMSEP.value
[1] 0.7697669
[1] "log(P2O5)" "log(Fe2O3)" "log(Al2O3)" "log(CaO)" "log(Na2O)"
[6] "log(K2O)"
[1] "log(P2O5)" "log(SiO2)" "log(Fe2O3)" "log(Al2O3)" "log(CaO)"
[6] "log(MgO)" "log(Na2O)" "log(K2O)"
[1] "SOT"
$overall.quality
[1] 0.983
$axis.pred
log(P2O5) log(Fe2O3) log(Al2O3) log(CaO) log(Na2O) log(K2O) SOT
0.736 1.412 1.362 0.964 1.376 0.931 0.983
$D.hat
log(P2O5) log(Fe2O3) log(Al2O3) log(CaO) log(Na2O) log(K2O) SOT
13 1.674 -1.3368 -1.5088 2.11 -1.6558 3.369 935
14 1.611 -1.2965 -1.4650 2.13 -1.9895 3.220 953
15 1.670 -1.3357 -1.5079 2.11 -1.6794 3.360 936
34 1.638 -1.4482 -1.6499 2.06 -2.1084 3.309 939
35 1.604 -1.1509 -1.2858 2.20 -1.7603 3.174 962
37 1.634 -1.0258 -1.1283 2.26 -1.3228 3.217 961
45 1.135 0.1722 0.3054 2.80 -2.3077 1.859 1145
48 1.159 1.4170 1.8459 3.39 0.2463 1.669 1200
61 1.717 0.0319 0.1865 2.76 1.2639 3.198 992
62 1.564 -0.7424 -0.7847 2.39 -1.2373 3.004 992
99 1.618 -0.5289 -0.5157 2.49 -0.4682 3.085 989
210 1.498 0.8006 1.1159 3.11 1.2962 2.553 1085
211 1.543 0.0574 0.2017 2.77 0.1659 2.801 1037
214 1.179 1.5873 2.0583 3.47 0.7078 1.682 1204
215 1.558 -0.6468 -0.6671 2.43 -1.0898 2.973 998
216 1.523 -0.5662 -0.5707 2.47 -1.1646 2.879 1011
220 1.710 -0.9151 -0.9843 2.31 -0.6022 3.369 947
221 1.789 -1.0185 -1.1049 2.27 -0.2834 3.566 922
222 1.521 -0.3700 -0.3285 2.56 -0.8025 2.835 1021
246 1.287 1.1344 1.5087 3.26 0.5508 2.014 1154
247 1.646 0.2233 0.4163 2.85 1.1655 3.001 1019
250 1.702 -0.9058 -0.9737 2.32 -0.6402 3.348 949
251 1.511 -1.1648 -1.3115 2.19 -2.3965 2.969 985
263 1.715 -1.5938 -1.8226 1.99 -1.8793 3.511 912
264 1.715 -1.5192 -1.7304 2.03 -1.7348 3.497 916
265 1.650 -1.9108 -2.2204 1.84 -2.9171 3.428 913
267 1.729 -2.2705 -2.6576 1.67 -3.0885 3.676 875
268 1.774 -2.0500 -2.3808 1.78 -2.3650 3.735 875
269 1.783 -1.8714 -2.1594 1.86 -1.9650 3.719 882
270 1.799 -2.0641 -2.3959 1.77 -2.2262 3.794 868
271 1.703 -2.4167 -2.8406 1.60 -3.5408 3.646 875
272 1.763 -1.8458 -2.1295 1.87 -2.0487 3.668 888
274 1.751 -2.2353 -2.6120 1.69 -2.8771 3.718 872
275 1.717 -1.6848 -1.9350 1.95 -2.0420 3.534 907
276 1.596 -1.1942 -1.3400 2.18 -1.8967 3.165 962
277 1.537 -1.3462 -1.5333 2.10 -2.5778 3.062 969
278 1.517 -1.3164 -1.4984 2.11 -2.6526 3.011 976
279 1.550 -1.2478 -1.4105 2.15 -2.2993 3.073 971
280 1.567 -0.8884 -0.9648 2.32 -1.4996 3.039 984
284 1.565 -0.6151 -0.6272 2.45 -0.9827 2.983 998
285 1.603 -0.9671 -1.0586 2.28 -1.4091 3.137 971
286 1.637 -1.2240 -1.3730 2.16 -1.6825 3.263 950
287 1.631 -1.4737 -1.6820 2.04 -2.2033 3.298 939
288 1.604 -1.2809 -1.4464 2.13 -2.0072 3.201 955
290 1.513 -0.9700 -1.0707 2.28 -2.0083 2.935 994
291 1.676 -1.7475 -2.0162 1.92 -2.4318 3.454 914
293 1.580 -1.1333 -1.2662 2.20 -1.8834 3.117 969
347 1.667 0.6687 0.9687 3.06 2.1559 2.959 1036
411 1.270 0.5449 0.7785 2.98 -0.7011 2.090 1130
462 1.593 -1.5569 -1.7885 2.00 -2.6137 3.229 945
463 1.479 1.4557 1.9237 3.42 2.4349 2.383 1122
490 1.517 -1.5687 -1.8101 2.00 -3.1369 3.061 963
491 1.658 -1.5622 -1.7889 2.00 -2.1939 3.377 928
560 1.526 -0.3866 -0.3485 2.55 -0.8024 2.849 1019
561 1.584 -1.0161 -1.1210 2.26 -1.6316 3.103 974
562 1.266 0.8559 1.1625 3.13 -0.1292 2.020 1146
563 1.505 -0.8756 -0.9547 2.32 -1.8806 2.898 1000
564 1.381 -0.2252 -0.1626 2.62 -1.4508 2.490 1064
565 1.346 0.2647 0.4395 2.85 -0.7336 2.318 1096
566 1.518 0.3455 0.5555 2.90 0.5557 2.689 1057
513 1.435 -0.1160 -0.0227 2.68 -0.8832 2.591 1055
525 1.183 1.5116 1.9651 3.44 0.5913 1.706 1199
540 1.206 0.7607 1.0393 3.08 -0.7056 1.904 1156
547 1.312 0.1451 0.2885 2.80 -1.1916 2.263 1099
550 1.632 -1.6843 -1.9422 1.95 -2.6004 3.342 929
551 1.703 -2.2972 -2.6930 1.66 -3.3105 3.623 881
552 1.581 -0.3355 -0.2802 2.58 -0.3379 2.965 1008
554 1.639 -0.8323 -0.8888 2.35 -0.9164 3.191 969
614 1.118 2.6163 3.3241 3.96 2.2875 1.343 1270
621 1.145 2.0918 2.6784 3.71 1.4521 1.505 1237
622 1.187 2.1175 2.7142 3.72 1.7780 1.595 1228
625 1.417 1.8709 2.4309 3.62 2.8223 2.162 1158
626 1.020 2.2670 2.8833 3.79 0.9656 1.190 1277
630 1.130 2.7415 3.4799 4.02 2.6037 1.344 1273
646 1.051 2.4447 3.1058 3.87 1.5133 1.225 1278
647 1.162 1.6959 2.1909 3.52 0.8075 1.623 1213
649 1.120 1.6044 2.0739 3.48 0.3517 1.545 1219
666 0.906 3.0500 3.8402 4.15 1.7210 0.780 1344
667 0.886 2.6528 3.3475 3.96 0.8237 0.812 1330
670 0.919 2.6112 3.2992 3.95 0.9639 0.896 1319
671 1.329 1.5549 2.0321 3.46 1.6323 2.025 1164
674 1.785 -1.3962 -1.5719 2.09 -1.0359 3.631 904
686 1.552 -0.8330 -0.8977 2.34 -1.4904 2.995 991
689 1.689 -1.6227 -1.8608 1.98 -2.1047 3.459 917
711 1.547 -0.4521 -0.4275 2.52 -0.7919 2.909 1011
715 1.586 -1.3772 -1.5671 2.09 -2.3123 3.179 955
763 1.215 0.6520 0.9059 3.03 -0.8526 1.947 1148
777 1.100 1.1878 1.5572 3.28 -0.5817 1.582 1204
779 1.194 1.0678 1.4177 3.23 -0.1916 1.818 1174
780 1.199 2.0566 2.6401 3.70 1.7429 1.635 1222
823 1.527 0.2585 0.4488 2.86 0.4487 2.726 1051
824 1.347 0.6202 0.8788 3.02 -0.0458 2.249 1114
825 1.541 0.3708 0.5888 2.91 0.7522 2.734 1053
826 1.265 1.4361 1.8794 3.41 0.9842 1.905 1175
827 1.163 0.7322 1.0000 3.07 -1.0440 1.813 1166
902 1.570 0.6801 0.9737 3.06 1.5436 2.741 1061
903 1.483 -0.4967 -0.4886 2.50 -1.2962 2.775 1025
904 1.516 0.2890 0.4854 2.87 0.4348 2.696 1055
905 1.323 0.9434 1.2761 3.17 0.4217 2.133 1136
$Bmat
SOT
log(P2O5) -0.239
log(Fe2O3) 3.640
log(Al2O3) 3.228
log(CaO) 1.893
log(Na2O) 1.096
log(K2O) -3.089
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.