Compute all pairwise distances between the spatial interaction models in a collection
Source:R/sim_list_distances.R
sim_distance.Rd
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.
Details
The vector representation is selected using the flows
parameters. Possible
values are
"full"
(default value): the representation is obtained by considering the matrix offlows()
as a vector (with the standardas.vector()
function);"destination"
: the representation is thedestination_flow()
vector associated to each spatial interaction model;"attractiveness"
: the representation is theattractiveness()
vector associated to each spatial interaction model.
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")