trW {spdep} | R Documentation |
The function is used to prepare a vector of traces of pwers of a spatial weights matrix
trW(W, m = 100, p = 50, type = "mult")
W |
A spatial weights matrix in CsparseMatrix form |
m |
The number of powers |
p |
The number of samples used in Monte Carlo simulation of the traces if type is MC |
type |
Either mult (default) for powering a sparse matrix, or MC for Monte Carlo simulation of the traces |
A numeric vector of m
traces.
Roger Bivand Roger.Bivand@nhh.no
LeSage J and RK Pace (2009) Introduction to Spatial Econometrics. CRC Press, Boca Raton, pp. 96–105.
example(columbus) listw <- nb2listw(col.gal.nb) W <- as(as_dgRMatrix_listw(listw), "CsparseMatrix") trMat <- trW(W, type="mult") str(trMat) trMC <- trW(W, type="MC") str(trMC) plot(trMat, trMC)