The function is used to prepare a vector of traces of powers of a spatial weights matrix
Usage
trW(W=NULL, m = 30, p = 16, type = "mult", listw=NULL, momentsSymmetry=TRUE)
mom_calc(lw, m)
mom_calc_int2(is, m, nb, weights, Card)
Arguments
W
A spatial weights matrix in CsparseMatrix form
m
The number of powers; must be an even number for ‘type’=“moments” (default changed from 100 to 30 (2010-11-17))
p
The number of samples used in Monte Carlo simulation of the traces if type is MC (default changed from 50 to 16 (2010-11-17))
type
Either “mult” (default) for powering a sparse matrix (with moderate or larger N, the matrix becomes dense, and may lead to swapping), or “MC” for Monte Carlo simulation of the traces (the first two simulated traces are replaced by their analytical equivalents), or “moments” to use the looping space saving algorithm proposed by Smirnov and Anselin (2009) - for “moments”, W must be symmetric, for row-standardised weights through a similarity transformation
listw, lw
a listw object, which should either be fully symmetric, or be constructed as similar to symmetric from intrinsically symmetric neighbours using similar.listw, used with ‘type’=“moments”
(used internally only in mom_calc_int2 for ‘type’=“moments” on a cluster)
nb
(used internally only in mom_calc_int2 for ‘type’=“moments” on a cluster)
weights
(used internally only in mom_calc_int2 for ‘type’=“moments” on a cluster)
Card
(used internally only in mom_calc_int2 for ‘type’=“moments” on a cluster)
Value
A numeric vector of m traces, with “timings” and “type” attributes; the ‘type’=“MC” also returns the standard deviation of the p-vector V divided by the square root of p as a measure of spread for the trace estimates.
Note
mom_calc and mom_calc_int2 are for internal use only
LeSage J and RK Pace (2009) Introduction to Spatial Econometrics. CRC Press, Boca Raton, pp. 96–105; Smirnov O and L Anselin (2009) An O(N) parallel method of computing the Log-Jacobian of the variable transformation for models with spatial interaction on a lattice. Computational Statistics and Data Analysis 53 (2009) 2983–2984.