robust.boot {GeneTS}R Documentation

Robust Error Resistant Bootstrap Algorithm

Description

robust.boot generates ordinary nonparametric bootstrap replicates. If an error occurs during the function evaluation (e.g., due to numerical problems) the bootstrap draw is repeated.

robust.boot offers only very limited bootstrap support, for much more advanced bootstrapping methods use boot.

Usage

robust.boot(data, statistic, R)

Arguments

data data matrix or data frame (each row is considered as one multivariate observation)
statistic A function which when applied to data returns a vector containing the statistic(s) of interest
R number of bootstrap replicates

Details

robust.boot is used in the functions bagged.cov, bagged.cov, and bagged.pcor.

Value

A list with one component:

t a matrix with 'R' rows each of which is a bootstrap replicate of 'statistic'.

Author(s)

Korbinian Strimmer (http://www.stat.uni-muenchen.de/~strimmer/).

See Also

boot, bagged.pcor.

Examples

# load GeneTS library
library(GeneTS)

# small example data set 
data(caulobacter)
dat <- caulobacter[,1:15]
dim(dat)

# test statistic: vector of means 
test.fun <- function(data, i)
{
  res <- apply(data[i,], 2, mean) 
  if (runif(1) < .01) stop("Error!") # in 1 percent of cases an error occurs ... 
  return(res)
}

# perform bootstrap
b.out <- robust.boot(dat, test.fun, 1000)

# despite the errors bootstrapping has finished
dim(b.out$t)

# bootstrap means
bag <- apply(b.out$t, 2, mean)
bag

[Package GeneTS version 2.3 Index]