boot_scrnp {nlpred} | R Documentation |
Compute the bootstrap-corrected estimator of SCRNP.
Description
This estimator is computed by re-sampling with replacement (i.e., bootstrap sampling) from the data. The SCRNP is computed for the learner trained on the full data. The SCRNP is then computed for the learner trained on each bootstrap sample. The average difference between the full data-trained learner and the bootstrap-trained learner is computed to estimate the bias in the full-data-estimated SCRNP. The final estimate of SCRNP is given by the difference in the full-data SCRNP and the estimated bias.
Usage
boot_scrnp(
Y,
X,
B = 200,
learner = "glm_wrapper",
sens = 0.95,
correct632 = FALSE,
...
)
Arguments
Y |
A numeric vector of outcomes, assume to equal |
X |
A |
B |
The number of bootstrap samples. |
learner |
A wrapper that implements the desired method for building a
prediction algorithm. See |
sens |
The sensitivity constraint to use. |
correct632 |
A boolean indicating whether to use the .632 correction. |
... |
Other options, not currently used. |
Value
A list with $scrnp
the bootstrap-corrected estimate of SCRNP and
$n_valid_boot
as the number of bootstrap of bootstrap samples where learner
successfully executed.
Examples
# simulate data
X <- data.frame(x1 = rnorm(50))
Y <- rbinom(50, 1, plogis(X$x1))
# compute bootstrap estimate of scrnp for logistic regression
# use small B for fast run
boot <- boot_scrnp(Y = Y, X = X, B = 25, learner = "glm_wrapper")