WeightMatrix: Create spatial weighting matrices

Description Usage Arguments Value Author(s) References Examples

Description

This step-1 function creates a matrix of spatial weights on the basis of a user-defined distance matrix, Kernel function, and bandwidth value. The distance matrix needs to specify a value for each of the possible n by n binomials that correspond to n contextual units. It can be either symmetric or asymmetric. In principle, its diagonal, corresponding to the distance of each unit with itself, should be composed of zero values. A Kernel function proposed by default generates spatial weights that tend toward 1 for distances substantially lower than the bandwidth value, toward 0 for distances substantially higher than the bandwidth value and toward 0.5 for distances approaching the bandwidth value.

Usage

1
2
WeightMatrix(distance.matrix, bandwidth, kernel = NULL,
  moran = FALSE)

Arguments

distance.matrix

square matrix of dimension n by n, where n is the number of contextual units.

bandwidth

scalar numeric value specifying the bandwidth h

kernel

function applied to the distance matrix. By default NULL, in which case the kernel function

w_ij = f(d, h) = (1/2)^((d_ij/h)^2)

is used, where w_ij, d_ij, h are elements of the weight matrix W, of the distance matrix D and the bandwidth h. User-supplied kernel functions have to take 2 arguments and return a matrix of the same dimension as the first argument.

moran

a logical value specifying whether the proximity weights matrix should have zeros in the diagonal. By default set to FALSE.

Value

A weights matrix of the same dimension as distance.matrix.

Author(s)

Till Junge, Sandra Penic, Guy Elcheroth

References

Elcheroth, G., Penic, S., Fasel, R., Giudici, F., Glaeser, S., Joye, D., Le Goff, J.-M., Morselli, D., & Spini, D. (2012). Spatially weighted context data: a new approach for modelling the impact of collective experiences. LIVES Working Papers, 19.

Examples

1
2
3
4
# creating geographical proximity weight, with bandwidth h=50

data(d_geo) 
geow_50 <- WeightMatrix(distance.matrix=d_geo, bandwidth=50)

spacom documentation built on May 1, 2019, 7:35 p.m.