testBoot {ssExtra}R Documentation

Test ‘bca’ Confidence Intervals from bcaboot and boot

Description

This routine will calculate bootstrap ‘bca’ confidence intervals from a sample of standard normal random variates. The output will facilitate comparison of the corresponding routines for ‘bca’ calculation from two popular packages: bcaboot and boot.

Usage

testBoot(n = 1000,
         B = 1000,
         alpha = 0.05,
         mbm = FALSE,
         parallel = "no",
         ncpus = 3L,
         times = 10L,
         unit = "s",
         runQuiet = FALSE,
         startSeed = 245,
         ...)

Arguments

n

The number of standard normal random variates in the sample.

B

The number of bootstrap sample replicates.

alpha

The two-tailed alpha level for comparison with normal theory intervals.

mbm

TRUE: run microbenchmark for times; FALSE; no timing.

parallel

See boot, it does not seem to work.

ncpus

See boot.

times

The number of microbenchmark replicates.

unit

The units for the report from microbenchmark; ‘s’ = seconds.

runQuiet

TRUE: sssshhh; FALSE: print results.

startSeed

A scalar specifying a random number seed for the Monte Carlo draws. See initRandomSeed for details.

...

Other arguments passed to boot.

Details

Calculating the bootstrap ‘bca’ intervals adds a lot of extra time to the big BAF Monte Carlo simulations. I use the boot package in monte, and it seems to have worked well. But recently the bcaboot package appeared and I wanted to see if it had any advantage, and how close the calculated confidence intervals were between the two. The results are also compared against the normal theory intervals. I assumed that bcajack from bcaboot might be somewhat better since it uses the jackknife standard error (though I am not sure about boot).

I was somewhat disappointed in the results, which differ, and seem to take a large number of bootstrap replicates to converge to the normal theory intervals (this actually never happened, they just tend that way). Also, boot can throw an error (see ‘Note’ section below) that I had not encountered before. Of course, the boot function has a lot of options, which I did not try, but can be passed using the ... argument above if desire.

In the end, I decided to use bcajack for the intervals in the version of monte for big BAF sampling in the ssExtra package.

Value

A list invisibly with...

samp

The standard normal sample drawn.

res

The results from bcajack.

boot.samp

The results from boot.

boot.cis

The results from boot.ci.

mnm.en

The microbenchmark results from bcajack.

mbm.cr

The microbenchmark results from boot & boot.ci.

df.samp

A data frame with the normal theory results from the sample.

df

A data frame with the bootstrap results.

call

The results from match.call.

Note

Be careful with boot.ci as it requires B>n evidently or you will get an error. One time I got an error because B was not a multiple of n. It seems that making B = 2n is the usual trick; e.g., see here.

The error produced is... bca.ci(boot.out, conf, index[1L], L = L, t = t.o, t0 = t0.o, : estimated adjustment 'a' is NA

Author(s)

Jeffrey H. Gove

See Also

compareBoot, bcaboot, bcajack, boot, boot.ci

Examples

#
# simply...
#
## Not run: 
bs = testBoot()

## End(Not run) 

[Package ssExtra version 0.1-2 Index]