| listw2sn {spdep} | R Documentation |
The function makes a "spatial neighbour" object representation
(similar to the S-PLUS spatial statististics module representation of a
"listw" spatial weights object. sn2listw() is the inverse function to listw2sn(), creating a "listw" object from a "spatial neighbour" object
listw2sn(listw) sn2listw(sn)
listw |
a listw object from for example nb2listw |
sn |
a spatial.neighbour object |
A data frame with three columns, and with class spatial.neighbour:
from |
region number id for the start of the link (S-PLUS row.id) |
to |
region number id for the end of the link (S-PLUS col.id) |
weights |
weight for this link |
logSpwdet returns log det(I - rho * W).
Roger Bivand Roger.Bivand@nhh.no
nb2listw, errorsarlm,
lagsarlm
data(columbus)
col.listw <- nb2listw(col.gal.nb)
col.listw$neighbours[[1]]
col.listw$weights[[1]]
col.sn <- listw2sn(col.listw)
str(col.sn)
W <- asMatrixCsrListw(similar.listw(col.listw))
str(W)
rho <- seq(-0.8, 0.9, 0.1)
for (i in rho) print(paste("rho:", i, "log(det(I - rho*W))",
log(det(asMatrixCsrIrW(W, i)))), quote=TRUE)