Skip to contents

This function extracts from each spatial interaction model of the collection a vector representation derived from its flow matrix (see details). This vector is then used to compute distances between the models.

Usage

sim_distance(
  sim_list,
  flows = c("full", "destination", "attractiveness"),
  method = c("euclidean"),
  ...
)

Arguments

sim_list

a collection of spatial interaction models, an object of class sim_list

flows

"full" (default), "destination" or "attractiveness", see details.

method

the distance measure to be used. Currently only "euclidean" is supported

...

additional parameters (not used currently)

Value

an object of class "dist"

Details

The vector representation is selected using the flows parameters. Possible values are

  • "full" (default value): the representation is obtained by considering the matrix of flows() as a vector (with the standard as.vector() function);

  • "destination": the representation is the destination_flow() vector associated to each spatial interaction model;

  • "attractiveness": the representation is the attractiveness() vector associated to each spatial interaction model.

See also

Examples

positions <- matrix(rnorm(15 * 2), ncol = 2)
distances <- as.matrix(dist(positions))
production <- rep(1, 15)
attractiveness <- rep(1, 15)
all_flows <- grid_blvim(distances,
  production,
  c(1.1, 1.25, 1.5),
  c(1, 2, 3),
  attractiveness,
  epsilon = 0.1
)
flows_distances <- sim_distance(all_flows)
inflows_distances <- sim_distance(all_flows, "destination")