Skip to contents

Creating spatial interaction models

Functions for creating spatial interaction models and extracting their parameters.

static_blvim()
Compute flows between origin and destination locations
blvim()
Compute an equilibrium solution of the Harris and Wilson model
blvim_gradient_control()
Control parameters for the blvim gradient algorithms
blvim_initialise()
Specify how initial attractivenesses are generated
costs()
Extract the cost matrix used to compute a model
inverse_cost()
Extract the inverse cost scale parameter used to compute a model
return_to_scale()
Extract the return to scale parameter used to compute a model
sim_conversion()
Return the conversion factors between attractivenesses and incoming flows
sim_is_bipartite()
Report whether a spatial interaction model is bipartite
location_names() `location_names<-`()
Names of origin and destination locations in a spatial interaction model
location_positions() `location_positions<-`()
Positions of origin and destination locations in a spatial interaction model
destination_flow()
Compute the incoming flow at each destination location
destination_names() `destination_names<-`()
Names of destination locations in a spatial interaction model
destination_positions() `destination_positions<-`()
Positions of destination locations in a spatial interaction model
origin_names() `origin_names<-`()
Names of origin locations in a spatial interaction model
origin_positions() `origin_positions<-`()
Positions of origin locations in a spatial interaction model

Using spatial interaction models

Functions for getting properties of spatial interaction models.

attractiveness()
Extract the attractivenesses from a spatial interaction model object
initial_attractiveness()
Extract the initial attractivenesses from a spatial interaction model object
destination_flow()
Compute the incoming flow at each destination location
diversity()
Compute the diversity of the destination locations in a spatial interaction model
flows()
Extract the flow matrix from a spatial interaction model object
flows_df()
Extract the flow matrix from a spatial interaction model object in data frame format
production()
Extract the production constraints from a spatial interaction model object
sim_potential()
Compute the potential of a spatial interaction model
sim_residual_jacobian()
Compute the Jacobian of the residual map G

Monitoring the construction of spatial interaction models

Functions for getting diagnostics of the algorithms used to build the models.

sim_converged()
Report whether the construction of a spatial interaction model converged
sim_diagnostic()
Return a full diagnostic of the algorithm used to build a spatial interaction model
sim_history()
Return the iteration history of the algorithm used to build a spatial interaction model
summary(<blvim_history>) print(<summary_blvim_history>)
Summary of the iteration history of blvim
sim_iterations()
Return the number of iterations used to produce a spatial interaction model
sim_logs()
Extract summaries of individual algorithm runs
summary(<blvim_logs>) print(<summary_blvim_logs>)
Summary of the runs of a multiple start blvim
sim_runs()
Extract spatial interaction models produced by individual runs

Non-bipartite models

Functions that apply only to non-bipartite models.

is_terminal()
Report whether locations are terminals
nd_graph()
Compute the Nystuen and Dacey graph for a spatial interaction model
terminals()
Compute terminals for a spatial interaction model

Multiple models

Functions to create and use multiple spatial interaction models using a grid of parameters.

costs(<sim_list>)
Extract the common cost matrix from a collection of spatial interaction models
grid_attractiveness()
Extract all the attractivenesses from a collection of spatial interaction models
grid_autoplot()
Create a complete ggplot for spatial interaction models in a data frame
grid_blvim()
Compute a collection of Boltzmann-Lotka-Volterra model solutions
grid_destination_flow()
Extract all the destination flows from a collection of spatial interaction models
grid_diversity()
Compute diversities for a collection of spatial interaction models
grid_is_terminal()
Extract all terminal statuses from a collection of spatial interaction models
grid_sim_converged()
Report the convergence statuses of a collection of spatial interaction models
grid_sim_history()
Return the iteration histories of a collection of spatial interaction models
grid_sim_iterations()
Return the numbers of iterations used to produce a collection of spatial interaction models
grid_sim_potential()
Compute the potentials of a collection of spatial interaction models
grid_var_autoplot()
Create a complete variability plot for spatial interaction models in a data frame
median(<sim_list>)
Compute the "median" of a collection of spatial interaction models
quantile(<sim_list>)
Compute quantiles of the flows in a collection of spatial interaction models
sim_df()
Create a spatial interaction models data frame from a collection of interaction models
`$<-`(<sim_df>) `[[<-`(<sim_df>) `[`(<sim_df>) `[<-`(<sim_df>)
Extract or replace parts of a SIM data frame
`names<-`(<sim_df>)
Set the column names of a SIM data frame
sim_column()
Get the collection of spatial interaction models from a SIM data frame
sim_distance()
Compute all pairwise distances between the spatial interaction models in a collection
sim_list()
Create a sim_list object from a list of spatial interaction models
c(<sim_list>)
Combine multiple sim_list objects into a single one
as.data.frame(<sim_list>)
Coerce a collection of spatial interaction models to a data frame
summary(<sim_list>) print(<summary_sim_list>)
Summary of a collection of spatial interaction models

Graphical representations

Functions that provide graphical representations of spatial interaction models.

autoplot(<blvim_history>)
Plot the iteration history of blvim
autoplot(<blvim_logs>)
Plot the runs of a multiple start blvim
autoplot(<sim>)
Create a complete ggplot for a spatial interaction model
autoplot(<sim_df>)
Create a complete ggplot for a spatial interaction models data frame
autoplot(<sim_list>)
Create a complete variability plot for a collection of spatial interaction models
fortify(<sim>)
Turn a spatial interaction model into a data frame
fortify(<sim_list>)
Turn a collection of spatial interaction models into a data frame
grid_autoplot()
Create a complete ggplot for spatial interaction models in a data frame
grid_var_autoplot()
Create a complete variability plot for spatial interaction models in a data frame

Helper functions

sample_weighted_simplex()
Sample points from a weighted simplex
blvim_simplex_initialise()
Generate initial attractivenesses from the weighted simplex

Data sets

french_cities
French cities
french_cities_distances french_cities_times
Distances and travel times between French cities
french_departments
French departments
french_regions
French regions