Kum-Hoe Hwang
2005-Feb-11 05:33 UTC
[R] How to solve error : "cannot allocate vector of size 1208235 Kb"
Howdy R gurus ! I am newbie to R I use R 2.0.1 in Windows XP. When I run R I got the follwoing memory error. My physical memory size is 3 Gb. My R got the memory problem when it reached to about 2 Gb. Thanks in advance,> library(spdep) > sfr.lagsarlm <- lagsarlm(sfr.data$Bldgsqft ~ sfr.data$Ncounty + sfr.data$Nugb + sfr.data$Ngroup, data=sfr.data, listw=sfr.listw, method="eigen")Error: cannot allocate vector of size 1208235 Kb> memory.size(max=FALSE)[1] 17862584> memory.limit(size=NA)[1] 3145728000>-- Kum-Hoe Hwang, Ph.D. Kyonggi Research Institute, Korea (ROK) (Urban Planning and GIS) Phone : 82-31-250-3283 Email : phdhwang at gmail.com
Prof Brian Ripley
2005-Feb-11 07:03 UTC
[R] How to solve error : "cannot allocate vector of size 1208235 Kb"
You need to read the rw-FAQ (as the posting guide asks) and make the R executable capable of using more than 2Gb (assuming that you have already enabled your OS). On Fri, 11 Feb 2005, Kum-Hoe Hwang wrote:> Howdy R gurus ! > > I am newbie to R > I use R 2.0.1 in Windows XP. When I run R > I got the follwoing memory error. > My physical memory size is 3 Gb. > My R got the memory problem when it reached to > about 2 Gb. > > Thanks in advance, > > >> library(spdep) >> sfr.lagsarlm <- lagsarlm(sfr.data$Bldgsqft ~ sfr.data$Ncounty + sfr.data$Nugb + sfr.data$Ngroup, data=sfr.data, listw=sfr.listw, method="eigen") > Error: cannot allocate vector of size 1208235 Kb >> memory.size(max=FALSE) > [1] 17862584That tells you the state after that command failed: the max=TRUE figure is more interesting at that point.>> memory.limit(size=NA) > [1] 3145728000 >> > > > -- > Kum-Hoe Hwang, Ph.D. > > Kyonggi Research Institute, Korea (ROK) > (Urban Planning and GIS) > Phone : 82-31-250-3283 > Email : phdhwang at gmail.com > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Roger Bivand
2005-Feb-11 12:02 UTC
[R] How to solve error : "cannot allocate vector of size 1208235 Kb"
On Fri, 11 Feb 2005, Kum-Hoe Hwang wrote:> Howdy R gurus ! > > I am newbie to R > I use R 2.0.1 in Windows XP. When I run R > I got the follwoing memory error. > My physical memory size is 3 Gb. > My R got the memory problem when it reached to > about 2 Gb.This is not a question just about memory but also about methods. The number of rows in sfr.data is sufficiently large (about 35000?) that the NxN matrices being used need a lot of room. That is why the function provides the "SparseM" method to cater for your situation (unless you have chosen a representation of neighbour weights that is not similar to symmetric). If you choose a symmetric or similar to symmetric representation, you can use the "SparseM" method, which, as its name suggests, uses sparse matrices. All of this is described in help(lagsarlm). It is also quite possible that the last 95% of your data add almost no new information, so you could also consider choosing a subset for analysis, in which case the "eigen" method using dense matrices should work.> > Thanks in advance, > > > > library(spdep) > > sfr.lagsarlm <- lagsarlm(sfr.data$Bldgsqft ~ sfr.data$Ncounty + sfr.data$Nugb + sfr.data$Ngroup, data=sfr.data, listw=sfr.listw, method="eigen") > Error: cannot allocate vector of size 1208235 Kb > > memory.size(max=FALSE) > [1] 17862584 > > memory.limit(size=NA) > [1] 3145728000 > > > > >-- Roger Bivand Economic Geography Section, Department of Economics, Norwegian School of Economics and Business Administration, Breiviksveien 40, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93 e-mail: Roger.Bivand at nhh.no
Kum-Hoe Hwang
2005-Feb-14 12:29 UTC
[R] How to solve error : "cannot allocate vector of size 1208235 Kb"
I appreciate all who helped all. My problem was not enough memory definietely. First I tried smaple function that solved my problem nicely. Second, I tried a method="sparse" option in lagsarlm model. Comparing results led me to conclude the first trial that estimates better results in the lagsarlm model. Thanks millions, Kum On Fri, 11 Feb 2005 13:02:53 +0100 (CET), Roger Bivand <Roger.Bivand at nhh.no> wrote:> On Fri, 11 Feb 2005, Kum-Hoe Hwang wrote: > > > Howdy R gurus ! > > > > I am newbie to R > > I use R 2.0.1 in Windows XP. When I run R > > I got the follwoing memory error. > > My physical memory size is 3 Gb. > > My R got the memory problem when it reached to > > about 2 Gb. > > This is not a question just about memory but also about methods. The > number of rows in sfr.data is sufficiently large (about 35000?) that the > NxN matrices being used need a lot of room. That is why the function > provides the "SparseM" method to cater for your situation (unless you have > chosen a representation of neighbour weights that is not similar to > symmetric). > > If you choose a symmetric or similar to symmetric representation, you can > use the "SparseM" method, which, as its name suggests, uses sparse > matrices. All of this is described in help(lagsarlm). > > It is also quite possible that the last 95% of your data add almost no new > information, so you could also consider choosing a subset for analysis, in > which case the "eigen" method using dense matrices should work. > > > > > Thanks in advance, > > > > > > > library(spdep) > > > sfr.lagsarlm <- lagsarlm(sfr.data$Bldgsqft ~ sfr.data$Ncounty + sfr.data$Nugb + sfr.data$Ngroup, data=sfr.data, listw=sfr.listw, method="eigen") > > Error: cannot allocate vector of size 1208235 Kb > > > memory.size(max=FALSE) > > [1] 17862584 > > > memory.limit(size=NA) > > [1] 3145728000 > > > > > > > > > > > -- > Roger Bivand > Economic Geography Section, Department of Economics, Norwegian School of > Economics and Business Administration, Breiviksveien 40, N-5045 Bergen, > Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93 > e-mail: Roger.Bivand at nhh.no > >-- Kum-Hoe Hwang, Ph.D. Kyonggi Research Institute, Korea (ROK) (Urban Planning and GIS) Phone : 82-31-250-3283 Email : phdhwang at gmail.com
Possibly Parallel Threads
- Error in solve.default(inf, tol = tol.solve) :
- lagsarlm - using mixed explanatory variables (spdep package)
- Instrumental variable quantile estimation of spatial autoregressive models
- Method dispatch S3/S4 through optimize()
- best analysis method : for time series ans cross sectional data