expand_spflow_neighborhood: Derive the OD-level neighborhood matrices

View source: R/spflow_neighborhood.R

expand_spflow_neighborhoodR Documentation

Derive the OD-level neighborhood matrices

Description

Use the neighborhood matrices of origins and destinations to derive the up to three neighborhood matrices of the origin-destination pairs:

  • W_d relates to flows starting from the same origin going to neighbors of the destination

  • W_o relates to flows starting from the neighbors of the origin going the same destination

  • W_w relates to flows starting from the neighbors of the origin going the neighbors of the destination

Usage

expand_spflow_neighborhood(
  OW,
  DW,
  n_o = nrow(OW),
  n_d = nrow(DW),
  M_indicator = NULL,
  model = "model_9"
)

Arguments

OW

The origin neighborhood matrix

DW

The destination neighborhood matrix

n_o

A numeric indicating the number of origins

n_d

A numeric indicating the number of destinations

M_indicator

A matrix of binary indicators for origin-destination pairs that should be included in the model. When the argument is NULL or when all entries of this matrix are different from zero we consider the Cartesian product of all origins and destinations as OD pairs.

model

A character indicating the model number, that controls different spatial dependence structures should be one of paste0("model_", 1:9). Details are given in the documentation of spflow_control().

Value

A list of at most three (sparse) matrices with names given by c("Wd", "Wo", "Ww").

Author(s)

Lukas Dargel

Examples

expand_spflow_neighborhood(DW = 1-diag(2),OW = 1-diag(2))

LukeCe/spflow documentation built on Nov. 11, 2023, 8:20 p.m.