Learn R Programming

spdep (version 0.1-2)

listw2sn: Spatial neighbour sparse representation

Description

The function makes a spatial neighbour object representation (similar to the S-PLUS spatial statististics module representation of a listw spatial weights object. The object is used in calculating the Jacobian of the likelihood functions of spatial autoregressive models when the "sparse" method is chosen in errorsarlm and lagsarlm.

Usage

listw2sn(listw)
spwdet(sparseweights, rho)
log.spwdet(sparseweights, rho)

Arguments

listw
a listw object from for example nb2listw
sparseweights
a spatial.neighbour object
rho
spatial autoregressive parameter value

Value

  • A data frame with three columns, and with class spatial.neighbour:
  • fromregion number id for the start of the link (S-PLUS row.id)
  • toregion number id for the end of the link (S-PLUS col.id)
  • weightsweight for this link
  • log.spwdet returns log det(I - rho * W).

Details

The methods used for finding the determinant directly by sparse matrix techniques are given by R. Kelley Pace and R. P. Barry (1998), and are implemented here using the sparse library by Kenneth Kundert and Alberto Sangiovanni-Vincentelli; the same reference is used by the S-PLUS spatial statistics module.

References

R. Kelley Pace and R. P. Barry (1998) Quick computations of spatially autoregressive estimators, Geographical Analysis 29 (3) 232-247; http://www.spatial-statistics.com/pace_manuscripts/ga_ms_dir/pdf/fin_geo_analysis.pdf.

Files: src/spAllocate.c, src/spBuild.c, src/spConfig.h, src/spDefs.h, src/spFactor.c, src/spMatrix.h, src/spUtils.c are by Kenneth Kundert and Alberto Sangiovanni-Vincentelli, University of California, Berkeley, and are from:

http://www.netlib.org/sparse/index.html

(Kenneth Kundert, Sparse Matrix Techniques, in Circuit Analysis, Simulation and Design, Albert Ruehli (Ed.), North-Holland, 1986)

They are copyright (c) 1985,86,87,88 by Kenneth S. Kundert and the University of California, with the following licence:

Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the copyright notices appear in all copies and supporting documentation and that the authors and the University of California are properly credited. The authors and the University of California make no representations as to the suitability of this software for any purpose. It is provided "as is", without express or implied warranty.

See Also

nb2listw, errorsarlm, lagsarlm

Examples

Run this code
data(columbus)
col.listw <- nb2listw(col.gal.nb)
col.listw$neighbours[[1]]
col.listw$weights[[1]]
col.sn <- listw2sn(col.listw)
col.sn[col.sn[,1] == 1,]
rho <- seq(-0.8, 0.9, 0.1)
for (i in rho) print(paste("rho:", i, "log(det(I - rho*W))",
  log.spwdet(col.sn, i)), quote=TRUE)

Run the code above in your browser using DataLab