testBoot {ssExtra} | R Documentation |
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.
testBoot(n = 1000, B = 1000, alpha = 0.05, mbm = FALSE, parallel = "no", ncpus = 3L, times = 10L, unit = "s", runQuiet = FALSE, startSeed = 245, ...)
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 |
|
parallel |
See |
ncpus |
See |
times |
The number of |
unit |
The units for the report from microbenchmark; ‘s’ = seconds. |
runQuiet |
|
startSeed |
A scalar specifying a random number seed
for the Monte Carlo draws. See
|
... |
Other arguments passed to |
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.
A list invisibly with...
samp |
The standard normal sample drawn. |
res |
The results from |
boot.samp |
The results from |
boot.cis |
The results from |
mnm.en |
The microbenchmark results from |
mbm.cr |
The microbenchmark results from |
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 |
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
Jeffrey H. Gove
compareBoot
,
bcaboot
,
bcajack
,
boot
,
boot.ci
# # simply... # ## Not run: bs = testBoot() ## End(Not run)