[R-sig-Geo] errorsarlm out of memory

Roger Bivand Roger.Bivand at nhh.no
Fri Jun 25 12:10:07 CEST 2010


On Fri, 25 Jun 2010, elaine kuo wrote:

> Dear List,
>
> I am using errorsarlm (spdep) to measure SAR autocorrelation but failed as
> detailed below.
>
> system: windows XP and Vista
> RAM : 2G (XP) and 4G(Vista)
>
> sample size : 4500
> variable: 4
> nb10<-dnearneigh(coords,0,9)
>
> the error issue: out of memory of 180 Mb
>
> The similar messages in the archive were checked and tried but failed to
> solve the issues.
> 1. enlarging the R space to 2047 Mb
> 2. updating the neighboring unit from 0.5 to 9
>
> Please kindly help how to solve the problem, for I found SAR and CAR seem to
> be more reliable for autocorrelation than autocovariate.


No, you have not included the verbatim code leading to the memory problem, 
nor the output of traceback() after the error, nor the output of 
sessionInfo() to tell us which versions of packages you are using. This is 
almost certainly nothing to do with dnearneigh(), unless the (0, 9) 
thresholds include all n observations as neighbours for each neighbour, 
and even then the neighbour object would not be very large.

Did you read the help page for errorsarlm() or spautolm()? No? Then do so 
and look carefully at the method= argument. You are almost certainly using 
the default method, which uses dense matrices. Use your choice of sparse 
or approximation alternatives, for example "Matrix" for updating sparse 
Cholesky Jacobians, or "Chebyshev" for a fast approximate Jacobians.

Using sparse matrix methods to overcome memory constraints has been 
mentioned on this and other lists many times. With n=25000 ther is no 
problem on a 1GB machine, so your problem doesn't even count as large.

The list isn't really an alternative for reading help pages, and crucially 
accessing the references given on the help pages. I'll add a link to 
?do_ldet on the function fitting pages, and add LeSage J and RK Pace 
(2009) Introduction to Spatial Econometrics. CRC Press, Boca Raton too, as 
this is the key reference that is required reading in this area.

Hope this helps,

Roger


>
> Thanks
>
> Elaine
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no



More information about the R-sig-Geo mailing list