as_dgRMatrix_listw: Interface between Matrix class objects and weights lists

Description Usage Arguments Value Author(s) Examples

View source: R/listw2Matrix.R

Description

Interface between Matrix class objects and weights lists

Usage

1
2
3
4
5

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
example(NY_data)
W_C <- as(listw_NY, "CsparseMatrix")
W_R <- as(listw_NY, "RsparseMatrix")
W_S <- as(listw_NY, "symmetricMatrix")
n <- nrow(W_S)
I <- Diagonal(n)
rho <- 0.1
c(determinant(I - rho * W_S, logarithm=TRUE)$modulus)
sum(log(1 - rho * eigenw(listw_NY)))
nW <- - W_S
nChol <- Cholesky(nW, Imult=8)
n * log(rho) + (2 * c(determinant(update(nChol, nW, 1/rho))$modulus))

spdep documentation built on Aug. 19, 2017, 3:01 a.m.