Re: [R] Memory Problems with a Simple Bootstrap - Part II

2008-08-02 Thread Prof Brian Ripley
The following version of boot:::ordinary.array will enable this to run in 300Mb: ordinary.array <- function(n, R, strata) { inds <- as.integer(names(table(strata))) if (length(inds) == 1) { output <- sample(n, n*R, replace=TRUE) dim(output) <- c(R, n) } else {

Re: [R] Memory Problems with a Simple Bootstrap - Part II

2008-08-02 Thread jim holtman
I was suggesting adding the gc() call to help provide some additional information on the utilization of memory. As you indicated, it probably do not help in reducing the fragmentation of memory, but it was worth a try to see if there was any additional information that might be gleaned from the ex

Re: [R] Memory Problems with a Simple Bootstrap - Part II

2008-08-02 Thread Prof Brian Ripley
On Sat, 2 Aug 2008, Tom La Bone wrote: I have distilled my bootstrap problem down to this bit of code, which calculates an estimate of the 95th percentile of 7500 random numbers drawn from a standard normal distribution: library(boot) per95 <- function( annual.data, b.index) { sample.data <- a

[R] Memory Problems with a Simple Bootstrap - Part II

2008-08-02 Thread Tom La Bone
I have distilled my bootstrap problem down to this bit of code, which calculates an estimate of the 95th percentile of 7500 random numbers drawn from a standard normal distribution: library(boot) per95 <- function( annual.data, b.index) { sample.data <- annual.data[b.index] return(quantile(s