Compute Sparse Matrix Vector Product A x

DESCRIPTION:

Function to compute product A x where A = sum (parameters[i] N[i]) is a function of the spatial neighbor matrices N[i], and x is an arbitrary vector (or matrix).

USAGE:

spatial.multiply(neighbor, x, transpose=F, parameters=NULL, 
                 region.id=NULL) 

REQUIRED ARGUMENTS:

neighbor
an object of class spatial.neighbor containing the sparse matrix representation of the spatial neighbor matrices N[i] (see function spatial.neighbor).
x
a vector or matrix for which the product is desired.

OPTIONAL ARGUMENTS:

transpose
a logical value indicating whether the transpose of the spatial neighbor matrices N[i] are to be used in place of the N[i] when computing A. Here A is represented as the sum over i of parameters[i] N[i], parameters[i] is a scalar, and N[i] is the i-th spatial neighbor matrix represented by neighbor. If transpose is TRUE, then the transpose of each N[i] is used in place of N[i].
parameters
a vector of scalars multiplying the neighbor matrices.
region.id
a vector with length equal to the number of regions in the spatial lattice. If variables 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.

VALUE:

a vector (or matrix) containing the product A x.

DETAILS:

The neighbor object is a sparse matrix representation of the neighbor matrix. Because it is sparse, the matrix multiplication is carried out using sparse matrix methods.

SEE ALSO:

, , .

EXAMPLES:

spatial.multiply(sids.neighbor, 1:100, parameters=c(-0.3))