as_dgRMatrix_listw {spdep}R Documentation

Interface between Matrix class objects and weights lists

Description

Interface between Matrix class objects and weights lists

Usage

as_dgRMatrix_listw(listw)
as_dsTMatrix_listw(listw)
as_dgCMatrix_I(n)
as_dgCMatrix_IrW(W, rho)
Jacobian_W(W, rho)

Arguments

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

Value

Matrix package class objects

Author(s)

Roger Bivand

Examples

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)

[Package spdep version 0.4-17 Index]