lpls_results {multiblock} | R Documentation |
Result functions for L-PLS objects (lpls
)
Description
Correlation loading plot, prediction and cross-validation for L-PLS
models with class lpls
.
Usage
## S3 method for class 'lpls'
plot(
x,
comps = c(1, 2),
doplot = c(TRUE, TRUE, TRUE),
level = c(2, 2, 2),
arrow = c(1, 0, 1),
xlim = c(-1, 1),
ylim = c(-1, 1),
samplecol = 4,
pathcol = 2,
varcol = "grey70",
varsize = 1,
sampleindex = 1:dim(x$corloadings$R22)[1],
pathindex = 1:dim(x$corloadings$R3)[1],
varindex = 1:dim(x$corloadings$R21)[1],
...
)
## S3 method for class 'lpls'
predict(
object,
X1new = NULL,
X2new = NULL,
X3new = NULL,
exo.direction = c("X2", "X3"),
...
)
lplsCV(object, segments1 = NULL, segments2 = NULL, trace = TRUE)
Arguments
x |
|
comps |
|
doplot |
|
level |
|
arrow |
|
xlim |
|
ylim |
|
samplecol |
|
pathcol |
|
varcol |
|
varsize |
|
sampleindex |
|
pathindex |
|
varindex |
|
... |
Not implemented. |
object |
|
X1new |
|
X2new |
|
X3new |
|
exo.direction |
|
segments1 |
|
segments2 |
|
trace |
|
Value
Nothing is return for plotting (plot.lpls
), predicted values are returned for predictions (predict.lpls
)
and cross-validation metrics are returned for for cross-validation (lplsCV
).
See Also
Overviews of available methods, multiblock
, and methods organised by main structure: basic
, unsupervised
, asca
, supervised
and complex
.
Examples
# Simulate data set
sim <- lplsData(I = 30, N = 20, J = 5, K = 6, ncomp = 2)
X1 <- sim$X1; X2 <- sim$X2; X3 <- sim$X3
# exo-L-PLS:
lp.exo <- lpls(X1,X2,X3, ncomp = 2)
# Predict X1
pred.exo.X2 <- predict(lp.exo, X1new = X1, exo.direction = "X2")
# Predict X3
pred.exo.X2 <- predict(lp.exo, X1new = X1, exo.direction = "X3")
# endo-L-PLS:
lp.endo <- lpls(X1,X2,X3, ncomp = 2, type = "endo")
# Predict X1 from X2 and X3 (in this case fitted values):
pred.endo.X1 <- predict(lp.endo, X2new = X2, X3new = X3)
# LOO cross-validation horizontally
lp.cv1 <- lplsCV(lp.exo, segments1 = as.list(1:dim(X1)[1]))
# LOO cross-validation vertically
lp.cv2 <- lplsCV(lp.exo, segments2 = as.list(1:dim(X1)[2]))
# Three-fold CV, horizontal
lp.cv3 <- lplsCV(lp.exo, segments1 = as.list(1:10, 11:20, 21:30))