powered by
Draw bootstrap replicates of a fitted PLS model, refitting on each resample.
pls_bootstrap( X, Y, ncomp, R = 100L, algorithm = c("simpls", "nipals", "kernelpls", "widekernelpls"), backend = "arma", conf = 0.95, seed = NULL, type = c("xy", "xt"), parallel = c("none", "future"), future_seed = TRUE, return_scores = FALSE, ... )
A list with bootstrap estimates and summaries.
Predictor matrix.
Response matrix or vector.
Number of components.
Number of bootstrap replications.
Backend algorithm ("simpls", "nipals", "kernelpls" or "widekernelpls").
Backend argument passed to the fitting routine.
Confidence level.
Optional seed.
Character; bootstrap scheme, e.g. "pairs", "residual", or "parametric".
"pairs"
"residual"
"parametric"
Logical or character; if TRUE or one of c("sequential", "multisession", "multicore"), uses the future framework.
TRUE
c("sequential", "multisession", "multicore")
Logical or integer; forwarded to future.seed for reproducible parallel streams.
future.seed
Logical; if TRUE, return component scores for each replicate (may be large).
Additional arguments forwarded to pls_fit().
pls_fit()
set.seed(123) X <- matrix(rnorm(60), nrow = 20) y <- X[, 1] - 0.5 * X[, 2] + rnorm(20, sd = 0.1) pls_bootstrap(X, y, ncomp = 2, R = 20)
Run the code above in your browser using DataLab