spatial.neighbor
(and an optional set of
neighbor coefficients),
spatial.weights
computes the spatial weight
matrix.
spatial.weights(neighbor, parameters=NULL, region.id=NULL)
spatial.neighbor
used (in conjunction with the
elements of argument
parameters
) to compute a the spatial weight
matrix. In situations with more than one weight matrix (see routine
spatial.neighbor
, and the DETAILS section below),
spatial.weights
computes a weighted sum of the weight matrices.
matrix
of argument
neighbor
.
If
parameters
is not specified, a vector of all
1
s is assumed.
row.id
and
col.id
of argument
neighbor
are
not integer valued variables with sequential values from 1 to the
number or regions in the lattice, then argument
region.id
must be
specified and is used to obtain a sequential coding of the lattice
regions.
A[i]
denote the spatial weight matrix of type
i
, and let
parameters[i]
denote its corresponding parameter value. Then
spatial.weights
returns the linear sum over
i
of
parameter[i]*A[i]
.
Argument
neighbor
is a sparse matrix representation of one or more
matrices used to indicate the strength of neighbor relationships
between regions on a regular or irregular spatial lattice.
Let
a[i,j]
denote a non-zero element of the k-th weight matrix.
This implies that regions
i
and
j
are neighbors of the k-th kind,
and the strength
of this relationship is given by the magnitude of
a[i,j]
.
spatial.weights
can compute a weighted sum of the matrices
A
, where
the weights in the linear combination are given by the elements in
argument
parameters
. In practice, you might want to use routine
spatial.weights
when, for example, you want to compute the spatial
covariance matrix for a spatial process.
row.id <- c(1,1,2,3) col.id <- c(2,3,3,4) neighbor <- spatial.neighbor(row.id=row.id, col.id=col.id, symmetric=T) spatial.weights(neighbor)