Learn R Programming

spdep (version 0.4-9)

as_dgRMatrix_listw: 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

Examples

Run this code
example(NY_data)
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)))

Run the code above in your browser using DataLab