[R-sig-Geo] CHOLMOD and GetClass error when running errorsarlmfrom spdep package with method = Matrix or SparseM

Roger Bivand Roger.Bivand at nhh.no
Mon Jan 14 22:24:50 CET 2008


On Mon, 14 Jan 2008, Debarchana Ghosh wrote:

> Hi,
>
> I'm working on Windows with 2GB RAM.
>
> I'm trying to run the errorsarlm with 28 predictor variables and 16,854
> records. The listw object is created by the dnearneigh function with upper
> limit of distance as 2500m. Following are the sequence of codes.

Quote:

CHOLMOD error: out of memory

seems quite clear. How dense is your weights matrix - just say:

print(wts2500)

If it is such that some observations have many neighbours, the matrix will 
still be large. Users have run with n > 30,000, so 16,000 is feasible, but 
your case may be special - distance is not an ideal criterion.

Roger

>
> ## Read polygon shape file
> adrbaseshp<-readShapePoly("tricounty_2005_12JAN_WORKING.shp", IDvar="ID",
> verbose=TRUE)
>
> ### creating neighbor list
> coords<-coordinates(adrbaseshp)
> rn<-sapply(slot(adrbaseshp, "polygons"), function(x) slot(x, "ID"))
> nb2500<-dnearneigh(coords, 0, 2500, row.names=rn)
>
> ## neighbor to weigth matrix
> wts2500<-nb2listw(nb2500, zero.policy=TRUE)
>
> ## lagrange diagnostics
> adr_rd_ols.lagrange<-lm.LMtests(adr_rd_ols.lm, wts2500, test="all",
> zero.policy=TRUE)
>
> # Spatial error model package spdep
> ##  To work around the memory problem I used method="Matrix" (suggested by
> Roger Bivand)
>
> adr_rd.saerror<-errorsarlm(LN_PRICE~., data=adr_rd_ols, wts2500,
> zero.policy=TRUE, method="Matrix")
>
> ## It gave me the following error which I can't understand
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> CHOLMOD error: out of memory
> Error in asMethod(object) : no function to return from, jumping to top level
> In addition: Warning messages:
> 1: NA/Inf replaced by maximum positive value in: optimize(sar.error.f.M,
> interval = interval, maximum = TRUE,
> 2: NA/Inf replaced by maximum positive value in: optimize(sar.error.f.M,
> interval = interval, maximum = TRUE,
> 3: NA/Inf replaced by maximum positive value in: optimize(sar.error.f.M,
> interval = interval, maximum = TRUE,
> CHOLMOD error: out of memory
> Error in switch(.Generic, "+" = , "-" = .Call(Tsparse_to_Csparse,
> new("dgTMatrix",  :
>        no function to return from, jumping to top level
> In addition: Warning message:
> NA/Inf replaced by maximum positive value in: optimize(sar.error.f.M,
> interval = interval, maximum = TRUE,
> CHOLMOD error: out of memory
> Error in switch(.Generic, "+" = , "-" = .Call(Tsparse_to_Csparse,
> new("dgTMatrix",  :
>        no function to return from, jumping to top level
> In addition: Warning message:
> NA/Inf replaced by maximum positive value in: optimize(sar.error.f.M,
> interval = interval, maximum = TRUE,
> CHOLMOD error: out of memory
> Error in switch(.Generic, "+" = , "-" = .Call(Tsparse_to_Csparse,
> new("dgTMatrix",  :
>        no function to return from, jumping to top level
> In addition: Warning message:
> NA/Inf replaced by maximum positive value in: optimize(sar.error.f.M,
> interval = interval, maximum = TRUE,
> CHOLMOD error: out of memory
> Error in switch(.Generic, "+" = , "-" = .Call(Tsparse_to_Csparse,
> new("dgTMatrix",  :
>        no function to return from, jumping to top level
> In addition: Warning message:
> NA/Inf replaced by maximum positive value in: optimize(sar.error.f.M,
> interval = interval, maximum = TRUE,
> CHOLMOD error: out of memory
> Error in switch(.Generic, "+" = , "-" = .Call(Tsparse_to_Csparse,
> new("dgTMatrix",  :
>        no function to return from, jumping to top level
> In addition: Warning message:
> NA/Inf replaced by maximum positive value in: optimize(sar.error.f.M,
> interval = interval, maximum = TRUE,
> CHOLMOD error: out of memory
> Error in switch(.Generic, "+" = , "-" = .Call(Tsparse_to_Csparse,
> new("dgTMatrix",  :
>        no function to return from, jumping to top level
> In addition: Warning message:
> NA/Inf replaced by maximum positive value in: optimize(sar.error.f.M,
> interval = interval, maximum = TRUE,
> CHOLMOD error: out of memory
> Error in switch(.Generic, "+" = , "-" = .Call(Tsparse_to_Csparse,
> new("dgTMatrix",  :
>        no function to return from, jumping to top level
> In addition: Warning message:
> NA/Inf replaced by maximum positive value in: optimize(sar.error.f.M,
> interval = interval, maximum = TRUE,
> CHOLMOD error: out of memory
> Error in switch(.Generic, "+" = , "-" = .Call(Tsparse_to_Csparse,
> new("dgTMatrix",  :
>        no function to return from, jumping to top level
> In addition: Warning message:
> NA/Inf replaced by maximum positive value in: optimize(sar.error.f.M,
> interval = interval, maximum = TRUE,
> CHOLMOD error: out of memory
> Error in switch(.Generic, "+" = , "-" = .Call(Tsparse_to_Csparse,
> new("dgTMatrix",  :
>        no function to return from, jumping to top level
> In addition: Warning message:
> NA/Inf replaced by maximum positive value in: optimize(sar.error.f.M,
> interval = interval, maximum = TRUE,
> CHOLMOD error: out of memory
> Error in switch(.Generic, "+" = , "-" = .Call(Tsparse_to_Csparse,
> new("dgTMatrix",  :
>        no function to return from, jumping to top level
> In addition: Warning message:
> NA/Inf replaced by maximum positive value in: optimize(sar.error.f.M,
> interval = interval, maximum = TRUE,
> Error in initialize(value, ...) : no function to return from, jumping to top
> level
> In addition: Warning message:
> NA/Inf replaced by maximum positive value in: optimize(sar.error.f.M,
> interval = interval, maximum = TRUE,
> Error in initialize(value, ...) : no function to return from, jumping to top
> level
> In addition: Warning message:
> NA/Inf replaced by maximum positive value in: optimize(sar.error.f.M,
> interval = interval, maximum = TRUE,
> Error in initialize(value, ...) : no function to return from, jumping to top
> level
> In addition: Warning message:
> NA/Inf replaced by maximum positive value in: optimize(sar.error.f.M,
> interval = interval, maximum = TRUE,
> Error in initialize(value, ...) : no function to return from, jumping to top
> level
> In addition: Warning message:
> NA/Inf replaced by maximum positive value in: optimize(sar.error.f.M,
> interval = interval, maximum = TRUE,
> Error in initialize(value, ...) : no function to return from, jumping to top
> level
> In addition: Warning message:
> NA/Inf replaced by maximum positive value in: optimize(sar.error.f.M,
> interval = interval, maximum = TRUE,
> Error in initialize(value, ...) : no function to return from, jumping to top
> level
> In addition: Warning message:
> NA/Inf replaced by maximum positive value in: optimize(sar.error.f.M,
> interval = interval, maximum = TRUE,
> Error in initialize(value, ...) : no function to return from, jumping to top
> level
> In addition: Warning message:
> NA/Inf replaced by maximum positive value in: optimize(sar.error.f.M,
> interval = interval, maximum = TRUE,
> Error in initialize(value, ...) : no function to return from, jumping to top
> level
> In addition: Warning message:
> NA/Inf replaced by maximum positive value in: optimize(sar.error.f.M,
> interval = interval, maximum = TRUE,
> Error in initialize(value, ...) : no function to return from, jumping to top
> level
> In addition: Warning message:
> NA/Inf replaced by maximum positive value in: optimize(sar.error.f.M,
> interval = interval, maximum = TRUE,
> Error in initialize(value, ...) : no function to return from, jumping to top
> level
> In addition: Warning message:
> NA/Inf replaced by maximum positive value in: optimize(sar.error.f.M,
> interval = interval, maximum = TRUE,
> Error in initialize(value, ...) : no function to return from, jumping to top
> level
> In addition: Warning message:
> NA/Inf replaced by maximum positive value in: optimize(sar.error.f.M,
> interval = interval, maximum = TRUE,
> Error in initialize(value, ...) : no function to return from, jumping to top
> level
> In addition: Warning message:
> NA/Inf replaced by maximum positive value in: optimize(sar.error.f.M,
> interval = interval, maximum = TRUE,
> Error in initialize(value, ...) : no function to return from, jumping to top
> level
> In addition: Warning message:
> NA/Inf replaced by maximum positive value in: optimize(sar.error.f.M,
> interval = interval, maximum = TRUE,
> Error in initialize(value, ...) : no function to return from, jumping to top
> level
> In addition: Warning message:
> NA/Inf replaced by maximum positive value in: optimize(sar.error.f.M,
> interval = interval, maximum = TRUE,
> Error in initialize(value, ...) : no function to return from, jumping to top
> level
> In addition: Warning message:
> NA/Inf replaced by maximum positive value in: optimize(sar.error.f.M,
> interval = interval, maximum = TRUE,
> Error in initialize(value, ...) : no function to return from, jumping to top
> level
> In addition: Warning message:
> NA/Inf replaced by maximum positive value in: optimize(sar.error.f.M,
> interval = interval, maximum = TRUE,
> Error in initialize(value, ...) : no function to return from, jumping to top
> level
> In addition: Warning message:
> NA/Inf replaced by maximum positive value in: optimize(sar.error.f.M,
> interval = interval, maximum = TRUE,
> Error in initialize(value, ...) : no function to return from, jumping to top
> level
> In addition: Warning message:
> NA/Inf replaced by maximum positive value in: optimize(sar.error.f.M,
> interval = interval, maximum = TRUE,
> Error in initialize(value, ...) : no function to return from, jumping to top
> level
> In addition: Warning message:
> NA/Inf replaced by maximum positive value in: optimize(sar.error.f.M,
> interval = interval, maximum = TRUE,
> Error in initialize(value, ...) : no function to return from, jumping to top
> level
> In addition: Warning message:
> NA/Inf replaced by maximum positive value in: optimize(sar.error.f.M,
> interval = interval, maximum = TRUE,
> Error in `slot<-`(.Object, slotName, check = FALSE, slotVal) :
>        no function to return from, jumping to top level
> In addition: Warning message:
> NA/Inf replaced by maximum positive value in: optimize(sar.error.f.M,
> interval = interval, maximum = TRUE,
> Error in `slot<-`(.Object, slotName, check = FALSE, slotVal) :
>        no function to return from, jumping to top level
> In addition: Warning message:
> NA/Inf replaced by maximum positive value in: optimize(sar.error.f.M,
> interval = interval, maximum = TRUE,
> Error in `slot<-`(.Object, slotName, check = FALSE, slotVal) :
>        no function to return from, jumping to top level
> In addition: Warning message:
> NA/Inf replaced by maximum positive value in: optimize(sar.error.f.M,
> interval = interval, maximum = TRUE,
> Error in `slot<-`(.Object, slotName, check = FALSE, slotVal) :
>        no function to return from, jumping to top level
> In addition: Warning message:
> NA/Inf replaced by maximum positive value in: optimize(sar.error.f.M,
> interval = interval, maximum = TRUE,
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> I also tried the following
>
> adr_rd.saerror<-errorsarlm(LN_PRICE~., data=adr_rd_ols, wts2500,
> zero.policy=TRUE, method="SparseM")
>
> I got the following
>
> Error in getClass(Class, where = topenv(parent.frame())) :
>        "matrix.csr" is not a defined class
> In addition: Warning message:
> 'asMatrixCsrListw' is deprecated.
> Use 'as_dgRMatrix_listw' instead.
> See help("Deprecated") and help("spdep-deprecated").
>
> Again, I don't understand the error. How should I run the errorsarlm
> function?
>
> Thanks in advance.
> Debs.
>
> --
>
>
> Debarchana Ghosh
> PHD Candidate | Research Assistant
> Department of Geography
> University of Minnesota.
> PH: 8143607580
> www.tc.umn.edu/~ghos0033/ <http://www.tc.umn.edu/%7Eghos0033/>
>
> 	[[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