[R-sig-Geo] memory allocation problem with envelope function in spatstat

Erika Mudrak mudrak at wisc.edu
Fri May 7 22:06:17 CEST 2010


Hi everyone-  I am trying to fit an inhomogenous K function based to a large(ish) dataset.  I have successfully executed this code on data sets with a smaller n. 



> SPECIES.ppp
 planar point pattern: 1598 points 
window: rectangle = [564320, 564320] x [228490, 228500] units 
> lambda=density(SPECIES.ppp)
> Lin=envelope(SPECIES.ppp,Linhom,nsim=5,simulate=expression(rpoispp(lambda)),
+ correction="border")
Error: cannot allocate vector of size 244.5 Mb

I am working on a Windows Vista OS with 3GB RAM, and I have attempted to increase the memory size using  memory.limit(2000) within R and by adding --max-vsize=2000M  to the end of the Target field in the shortcut tab of the R properties dialog box. 

I have also tried making a list of simulated patterns ahead of time, but I get the same error:

> simpatterns=list()
> for (i in 1:5)simpatterns[[i]]=rpoispp(lambda)
> Lin=envelope(SPECIES.ppp,Linhom,nsim=5,simulate=simpatterns,
+ correction="border")
Error: cannot allocate vector of size 244.5 Mb

The spatstat FAQ suggest that a complete analysis should be feasible on a data set up of to 4000 points. 

Can anyone suggest ways to increase my memory limit or to modify my code to make this possible? I don't know what else to try!! Ideally, I would like to be able to make nsim=200, but I am trying to make it work with small numbers for now.  

Thank you,

Erika Mudrak


-- 
-------------------------------------------
Erika Mudrak
Graduate Student
Department of Botany
University of Wisconsin-Madison
430 Lincoln Dr
Madison WI, 53706
608-265-2191
mudrak at wisc.edu
http://botany.wisc.edu/waller/lab/Mudrak/



More information about the R-sig-Geo mailing list