[R] How to solve error : "cannot allocate vector of size 1208235 Kb"

Kum-Hoe Hwang phdhwang at gmail.com
Mon Feb 14 13:29:31 CET 2005


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




More information about the R-help mailing list