[S] Challenge: does a faster simple bootstrap algorithm exist?

Frank E Harrell Jr (fharrell@virginia.edu)
Mon, 15 Jun 1998 10:10:30 -0400


For those of you bored with your regular jobs:

Here is a very fast algorithm for computing nonparametric
confidence limits for the population mean using the basic
bootstrap. I cheated a bit by going through some S-Plus
internals for the sake of raw speed. Can anyone find a
faster algorithm without using appreciably more memory?

Here x is a numeric vector of length n with no NAs present.
conf.int is for example 0.95 and B is the number of boostrap
reps (default B=1000)

z <- unlist(lapply(1:B, function(i,x,N)
sum(x[.Internal(sample.index(N, N, T),
"S_sample",T,0)]), x=x, N=n)) / n
quantile(z, c((1-conf.int)/2,(1+conf.int)/2))
---------------------------------------------------------------------------
Frank E Harrell Jr
Professor of Biostatistics and Statistics
Director, Division of Biostatistics and Epidemiology
Dept of Health Evaluation Sciences
University of Virginia School of Medicine
http://www.med.virginia.edu/medicine/clinical/hes/biostat.htm

-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news