as_dgRMatrix_listw {spdep} | R Documentation |
Interface between Matrix class objects and weights lists
as_dgRMatrix_listw(listw) as_dsTMatrix_listw(listw) as_dgCMatrix_I(n) as_dgCMatrix_IrW(W, rho) Jacobian_W(W, rho)
listw |
a listw object created for example by nb2listw |
W |
a dsTMatrix object created using as_dsTMatrix_listw from a symmetric listw object |
rho |
spatial regression coefficient |
n |
length of diagonal for identity matrix |
Matrix package class objects
Roger Bivand
example(NY_data) ## Not run: W <- as(as_dsTMatrix_listw(listw_NY), "dsCMatrix") I <- as(as_dgCMatrix_I(dim(W)[1]), "dtCMatrix") IrW <- (I - 0.1 * W) CHOL <- chol(IrW) sum(2*log(diag(CHOL))) sum(log(1 - 0.1 * eigenw(listw_NY))) ## End(Not run)