
Non-parametric (Y,T) Bootstrap for selecting the number of components in PLS GLR models
Source:R/YTplsRglm.R
nbcomp.bootplsRglm.RdProvides a wrapper for the bootstrap function boot from the
boot R package.
Implements non-parametric bootstraps for PLS
Generalized Linear Regression models by (Y,T) resampling to select the
number of components.
Usage
nbcomp.bootplsRglm(
object,
typeboot = "boot_comp",
R = 250,
statistic = coefs.plsRglm.CSim,
sim = "ordinary",
stype = "i",
stabvalue = 1e+06,
...
)Arguments
- object
An object of class
plsRmodelto bootstrap- typeboot
The type of bootstrap. (
typeboot="boot_comp") for (Y,T) bootstrap to select components. Defaults to (typeboot="boot_comp").- R
The number of bootstrap replicates. Usually this will be a single positive integer. For importance resampling, some resamples may use one set of weights and others use a different set of weights. In this case
Rwould be a vector of integers where each component gives the number of resamples from each of the rows of weights.- statistic
A function which when applied to data returns a vector containing the statistic(s) of interest.
statisticmust take at least two arguments. The first argument passed will always be the original data. The second will be a vector of indices, frequencies or weights which define the bootstrap sample. Further, if predictions are required, then a third argument is required which would be a vector of the random indices used to generate the bootstrap predictions. Any further arguments can be passed to statistic through the...argument.- sim
A character string indicating the type of simulation required. Possible values are
"ordinary"(the default),"balanced","permutation", or"antithetic".- stype
A character string indicating what the second argument of
statisticrepresents. Possible values of stype are"i"(indices - the default),"f"(frequencies), or"w"(weights).- stabvalue
A value to hard threshold bootstrap estimates computed from atypical resamplings. Especially useful for Generalized Linear Models.
- ...
Other named arguments for
statisticwhich are passed unchanged each time it is called. Any such arguments tostatisticshould follow the arguments whichstatisticis required to have for the simulation. Beware of partial matching to arguments ofbootlisted above.
Value
An object of class "boot". See the Value part of the help of
the function boot.
Details
More details on bootstrap techniques are available in the help of the
boot function.
References
A new bootstrap-based stopping criterion in PLS component construction,
J. Magnanensi, M. Maumy-Bertrand, N. Meyer and F. Bertrand (2016), in The Multiple Facets of Partial Least Squares and Related Methods,
doi:10.1007/978-3-319-40643-5_18
A new universal resample-stable bootstrap-based stopping criterion for PLS component construction,
J. Magnanensi, F. Bertrand, M. Maumy-Bertrand and N. Meyer, (2017), Statistics and Computing, 27, 757–774.
doi:10.1007/s11222-016-9651-4
New developments in Sparse PLS regression, J. Magnanensi, M. Maumy-Bertrand,
N. Meyer and F. Bertrand, (2021), Frontiers in Applied Mathematics and Statistics,
doi:10.3389/fams.2021.693126
.
Author
Jérémy Magnanensi, Frédéric Bertrand
frederic.bertrand@lecnam.net
https://fbertran.github.io/homepage/
Examples
set.seed(314)
library(plsRglm)
data(aze_compl, package="plsRglm")
Xaze_compl<-aze_compl[,2:34]
yaze_compl<-aze_compl$y
dataset <- cbind(y=yaze_compl,Xaze_compl)
modplsglm <- plsRglm::plsRglm(y~.,data=dataset,10,modele="pls-glm-family", family = binomial)
#> ____************************************************____
#> Error in eval(mf, parent.frame(n = sys.nframe())): object 'dataset' not found
comp_aze_compl.bootYT <- nbcomp.bootplsRglm(modplsglm, R=250)
#> Error: object 'modplsglm' not found
boxplots.bootpls(comp_aze_compl.bootYT)
#> Error: object 'comp_aze_compl.bootYT' not found
confints.bootpls(comp_aze_compl.bootYT)
#> Error: object 'comp_aze_compl.bootYT' not found
plots.confints.bootpls(confints.bootpls(comp_aze_compl.bootYT),typeIC = "BCa")
#> Error: object 'comp_aze_compl.bootYT' not found
comp_aze_compl.permYT <- nbcomp.bootplsRglm(modplsglm, R=250, sim="permutation")
#> Error: object 'modplsglm' not found
boxplots.bootpls(comp_aze_compl.permYT)
#> Error: object 'comp_aze_compl.permYT' not found
confints.bootpls(comp_aze_compl.permYT, typeBCa=FALSE)
#> Error: object 'comp_aze_compl.permYT' not found
plots.confints.bootpls(confints.bootpls(comp_aze_compl.permYT, typeBCa=FALSE))
#> Error: object 'comp_aze_compl.permYT' not found