[R-sig-eco] Quantreg / R memory issue

Dan Rabosky drabosky at berkeley.edu
Thu Jan 28 03:46:32 CET 2010


Hi - 

I've recently hit an apparent R issue that I cannot resolve (or understand, actually). This is possibly more computer science but probably relevant to others using quantreg for ecological analysis. 

I am using quantreg to fit a vector of quantiles to a dataset, approx 200-400 observations. To accommodate some autocorrelation issues, I have to assess significance with randomization. The problem is that I consistently observe what appears to be a memory problem causing an R crash. The problem occurs within a local function I am using to (i) randomize the data and (ii) run quantile regression on the randomized dataset. 

The crash only occurs (or so it seems) when I try send rq() a vector of quantiles to fit. Even when I set the random number seed, the crash occurs on different iterations of the simulation. It sometimes occurs before rq() is called within the local function, and sometimes after rq() is called within the local function. Sometimes it occurs after returned to the main function. It does occur at approximately the same iteration, though.

I cannot explain this. It seems like using method="fn" instead of "br" avoids the crash, but have not rigorously investigated this and would like to understand the problem. My dataset is well-within the size range for which "br" is recommended. Is it possible that this problem is truly so memory intensive? Seems like not that many points. And why does this occur at roughly the same iteration every time? That would suggest that the memory issue is cumulative - shouldn't any memory consumed within rq(...) be freed up after I return???

This is occurring with R 2.10.1 on a 64 bit machine running OSX 10.6.2 (6 GB RAM).

Thanks!
~Dan Rabosky



More information about the R-sig-ecology mailing list