This function generates row-normalized spatial weight matrices for different types of neighborhood structures.
generateW(
method = c("rectangle", "line", "circle", "full", "independent"),
dim,
maxOrder = NULL,
width = NULL,
...
)A list of (row normalized) spatial weight matrices.
(character scalar) Defines type of neighborhood structure. Options are "rectangle", "line", "circle", "full", and "independent". Default is "rectangle".
(integer scalar) Number of locations, i.e. dimension of the time series.
(integer scalar) Maximum spatial order up to which the spatial weight matrices are generated. Ignored if `method`` is "full" or "independent".
(integer scalar) Width of the rectangular grid. Must be a divisor of dim. Ignored if method is not "rectangle".
Additional arguments passed to specific methods.
The function generates spatial weight matrices for different types of neighborhood structures. The options are:
"rectangle" - A regular rectangular grid (2 dimensional) with width columns and dim / width rows. The spatial order is defined by the Euclidean distances between locations.
"line" - Locations are placed on a line (1 dimensional). The spatial order is defined by the Euclidean distances between locations.
"circle" - Locations are placed on a circle. The spatial order is defined by the Euclidean distances between locations. In contrast to the "line" neighborhood, there are no boundary locations.
"full" - Generates a list with dim^2 matrices. Allows simulation/fitting of a full time series model without any restrictions in dependencies between the locations. Not recommended if dim is large.
"independent" - Generates a list with dim matrices. Each matrix is a spatial weight matrix with a single 1 in the diagonal. Allows simultaneously simulation/fitting of dim univariate time series models without spatial dependencies.
For more advanced spatial weight matrices, consider using the spdep package.
Bivand R, Pebesma E, Gómez-Rubio V (2013). Applied spatial data analysis with R, Second edition. Springer, NY. https://asdar-book.org/.
Pebesma E, Bivand R (2023). Spatial Data Science With Applications in R. Chapman & Hall. https://r-spatial.org/book/.
generateW(method = "rectangle", dim = 100, maxOrder = 2, width = 5)
generateW(method = "full", dim = 4)
Run the code above in your browser using DataLab