Skip to contents

Some spatial interaction models are the result of an iterative calculation, see for instance blvim(). This function returns a diagnostic object that gives details about the behaviour of the iterative algorithm. For a spatial interaction model that is not the result of an iterative calculation, the diagnostic object is essentially empty.

Usage

sim_diagnostic(sim, ...)

Arguments

sim

a spatial interaction model object (an object of class sim)

...

additional parameters

Value

a diagnostic object whose class inherits from sim_diagnostic

Examples

distances <- french_cities_distances[1:10, 1:10] / 1000 ## convert to km
production <- log(french_cities$population[1:10])
attractiveness <- log(french_cities$area[1:10])
model <- static_blvim(distances, production, 1.5, 1 / 250, attractiveness)
sim_diagnostic(model)
#> Static spatial interaction model
dyn_model <- blvim(distances, production, 1.5, 1 / 250, attractiveness,
  algorithm = "gradient"
)
sim_diagnostic(dyn_model)
#> BLV model obtained with the "gradient" algorithm.
#> ℹ The algorithm converged after 2 iterations:
#> • Number of potential evaluations: 2.
#> • Duality gap: 0.
#> • Return status: "converged".