boot_fit: Fit Model on Bootstrap Resamples

Description Usage Arguments See Also Examples

View source: R/boot.R

Description

Fits a specified model on the bootstrap resamples.

Usage

1
boot_fit(boot_resamples, fitFUN, cluster = FALSE, cores = NULL, ...)

Arguments

boot_resamples

A list of bootstrap resamples.

fitFUN

Function to use to fit the model.

cluster

Logical. If TRUE, parallelize computations using a cluster.

cores

Integer. Number of cores to use. Defaults to total number of threads minus 1.

...

Arguments to pass to fitFUN.

See Also

Other bootstrap functions: boot_lav(), boot_nb(), boot_pb_med_simple(), boot_pb_vm(), boot_pb()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
B <- 5
Sigma <- matrix(
  data = c(
    225, 112.50, 56.25,
    112.5, 225, 112.5,
    56.25, 112.50, 225
  ),
  ncol = 3
)
mu <- c(100, 100, 100)
data <- gendat_mvn(
  n = 100,
  Sigma = Sigma,
  mu = mu
)
boot_nb_resamples <- boot_nb(data = data, B = B)
nb <- boot_fit(boot_resamples = boot_nb_resamples, fitFUN = med_simple)
n <- nrow(data)
est_Sigma <- cov(data)
est_mu <- colMeans(data)
boot_pb_resamples <- boot_pb(n = n, Sigma = est_Sigma, mu = est_mu, B = B)
pb <- boot_fit(boot_resamples = boot_pb_resamples, fitFUN = med_simple)

jeksterslabds/jeksterslabRds documentation built on July 16, 2020, 3:41 p.m.