jack: Jackknife

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/jack.R

Description

Generates jackknife samples.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
jack(
  data,
  par = FALSE,
  ncores = NULL,
  mc = TRUE,
  lb = FALSE,
  cl_eval = FALSE,
  cl_export = FALSE,
  cl_expr,
  cl_vars
)

Arguments

data

Vector, matrix, or data frame. Sample data.

par

Logical. If TRUE, use multiple cores. If FALSE, use lapply().

ncores

Integer. Number of cores to use if par = TRUE. If unspecified, defaults to detectCores() - 1.

mc

Logical. If TRUE, use parallel::mclapply(). If FALSE, use parallel::parLapply() or parallel::parLapplyLB(). Ignored if par = FALSE.

lb

Logical. If TRUE use parallel::parLapplyLB(). If FALSE, use parallel::parLapply(). Ignored if par = FALSE and mc = TRUE.

cl_eval

Logical. Execute parallel::clusterEvalQ() using cl_expr. Ignored if mc = TRUE.

cl_export

Logical. Execute parallel::clusterExport() using cl_vars. Ignored if mc = TRUE.

cl_expr

Expression. Expression passed to parallel::clusterEvalQ() Ignored if mc = TRUE.

cl_vars

Character vector. Names of objects to pass to parallel::clusterExport() Ignored if mc = TRUE.

Details

\mathbf{ x }_i = ≤ft\{ x_1, x_2, x_3, …, x_n \right\}

for i = ≤ft\{ 1, 2, 3, …, n \right\} the ith jackknife sample consists of the original sample data with the ith observation removed.

Value

Returns a list of jackknife samples of length n, where n is the sample size of data. Each item in the list, will have a sample size of n - 1.

Author(s)

Ivan Jacob Agaloos Pesigan

References

Wikipedia: Jackknife resampling

See Also

Other jackknife functions: jack_hat()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
n <- 5
#################################
# vector
#################################
x <- rnorm(n = n)
xstar <- jack(
  data = x
)
str(xstar)
#################################
# matrix
#################################
x1 <- rnorm(n = n)
x2 <- rnorm(n = n)
x3 <- rnorm(n = n)
X <- cbind(x1, x2, x3)
Xstar <- jack(
  data = X
)
str(Xstar)
#################################
# data frame
#################################
X <- as.data.frame(X)
Xstar <- jack(
  data = X
)
str(Xstar)

jeksterslabds/jeksterslabRboot documentation built on July 20, 2020, 12:56 p.m.