Learn R Programming

blvim (version 0.1.1)

sim_converged: Reports whether the spatial interaction model construction converged

Description

Some spatial interaction models are the result of an iterative calculation, see for instance blvim(). This calculation may have been interrupted before convergence. The present function returns TRUE if the calculation converged, FALSE if this was not the case and NA if the spatial interaction model is not the result of an iterative calculation. The function applies also to a collection of spatial interaction models as represented by a sim_list.

Usage

sim_converged(sim, ...)

Value

TRUE, FALSE or NA, as described above. In the case of a sim_list

the function returns a logical vector with one value per model.

Arguments

sim

a spatial interaction model object (an object of class sim) or a collection of spatial interaction models (an object of class sim_list)

...

additional parameters

See Also

sim_iterations(), blvim(), grid_blvim()

Examples

Run this code
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)
destination_flow(model)
sim_converged(model) ## must be NA

Run the code above in your browser using DataLab