Learn R Programming

blvim (version 0.1.1)

costs: Extract the cost matrix used to compute this model

Description

Extract the cost matrix used to compute this model

Usage

costs(sim, ...)

Value

the cost matrix

Arguments

sim

a spatial interaction model with a cost matrix

...

additional parameters

Examples

Run this code
positions <- matrix(rnorm(10 * 2), ncol = 2)
distances <- as.matrix(dist(positions))
production <- rep(1, 10)
attractiveness <- c(2, rep(1, 9))
model <- static_blvim(distances, production, 1.5, 1, attractiveness)
costs(model) ## should be equal to distances above
all.equal(costs(model), distances)

Run the code above in your browser using DataLab