This function computes a collection of flows between origin locations and
destination locations using blvim() on a grid of parameters. The flows use
the same costs, same production constraints and same attractivenesses. Each
flow is computed using one of all the pairwise combinations between the alpha
values given by alphas and the beta values given by betas. The function
returns an object of class sim_list which contains the resulting flows.
grid_blvim(
costs,
X,
alphas,
betas,
Z,
bipartite = TRUE,
origin_data = NULL,
destination_data = NULL,
epsilon = 0.01,
iter_max = 50000,
conv_check = 100,
precision = 1e-06,
quadratic = FALSE,
progress = FALSE
)an object of class sim_list
a cost matrix
a vector of production constraints
a vector of return to scale parameters
a vector of cost inverse scale parameters
a vector of initial destination attractivenesses
when TRUE (default value), the origin and destination
locations are considered to be distinct. When FALSE, a single set of
locations plays the both roles. This has only consequences in functions
specific to this latter case such as terminals().
NULL or a list of additional data about the origin
locations (see details)
NULL or a list of additional data about the
destination locations (see details)
the update intensity
the maximal number of steps of the BLV dynamic
number of iterations between to convergence test
convergence threshold
selects the update rule, see details.
if TRUE, a progress bar is shown during the calculation (defaults to FALSE)
While models in this package do not use location data beyond X and Z,
additional data can be stored and used when analysing spatial interaction
models.
Spatial interaction models can store names for origin and destination
locations, using origin_names<-() and destination_names<-(). Names
are taken by default from names of the cost matrix costs. More precisely,
rownames(costs) is used for origin location names and colnames(costs) for
destination location names.
Spatial interaction models can store the positions of the origin and
destination locations, using origin_positions<-() and
destination_positions<-().
In addition to the functions mentioned above, location data can be specified
directly using the origin_data and destination_data parameters. Data are
given by a list whose components are not interpreted excepted the following
ones:
names is used to specify location names and its content has to follow
the restrictions documented in origin_names<-() and
destination_names<-()
positions is used to specify location positions and its content has
to follow the restrictions documented in origin_positions<-() and
destination_positions<-()
distances <- french_cities_distances[1:10, 1:10] / 1000 ## convert to km
production <- rep(1, 10)
attractiveness <- log(french_cities$area[1:10])
all_flows <- grid_blvim(
distances, production, c(1.25, 1.5),
c(1, 2, 3, 4) / 500, attractiveness
)
all_flows
length(all_flows)
all_flows[[2]]
Run the code above in your browser using DataLab