Learn R Programming

bigPLSR (version 0.7.2)

pls_bootstrap: Bootstrap a PLS model

Description

Draw bootstrap replicates of a fitted PLS model, refitting on each resample.

Usage

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,
  ...
)

Value

A list with bootstrap estimates and summaries.

Arguments

X

Predictor matrix.

Y

Response matrix or vector.

ncomp

Number of components.

R

Number of bootstrap replications.

algorithm

Backend algorithm ("simpls", "nipals", "kernelpls" or "widekernelpls").

backend

Backend argument passed to the fitting routine.

conf

Confidence level.

seed

Optional seed.

type

Character; bootstrap scheme, e.g. "pairs", "residual", or "parametric".

parallel

Logical or character; if TRUE or one of c("sequential", "multisession", "multicore"), uses the future framework.

future_seed

Logical or integer; forwarded to future.seed for reproducible parallel streams.

return_scores

Logical; if TRUE, return component scores for each replicate (may be large).

...

Additional arguments forwarded to pls_fit().

Examples

Run this code
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