| bootstrap_curve | R Documentation |
Generic bootstrap for curve-valued estimators
bootstrap_curve(est_fun, R = 300, conf = 0.95, seed = NULL, keep_reps = FALSE)
est_fun |
Function of one argument |
R |
Number of replicates. |
conf |
Confidence level in |
seed |
Optional RNG seed. |
keep_reps |
If |
A list with estimate, lo, hi, and conf.
vals <- c(1, 2, 4, 8)
boot <- bootstrap_curve(
function(r) {
if (is.null(r)) {
mean(vals)
} else {
mean(sample(vals, replace = TRUE))
}
},
R = 20,
seed = 1
)
boot$estimate
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.