Extract the flow matrix from a spatial interaction model object
Examples
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)
flows(model)
#> [,1] [,2] [,3] [,4] [,5] [,6]
#> [1,] 0.62991660 0.02206512 0.01621128 0.05409671 0.03221035 0.06841589
#> [2,] 0.10819231 0.38608519 0.01738726 0.15078426 0.09534045 0.02929027
#> [3,] 0.08384841 0.01834081 0.40725888 0.02235256 0.07424642 0.09251065
#> [4,] 0.22739967 0.12926619 0.01816640 0.33098787 0.08202744 0.04637397
#> [5,] 0.12021498 0.07256886 0.05357488 0.07282883 0.29387066 0.06410629
#> [6,] 0.23145481 0.02020890 0.06050949 0.03732196 0.05810945 0.26638042
#> [7,] 0.34657653 0.01582403 0.03055176 0.03506895 0.03434031 0.13116901
#> [8,] 0.07487577 0.12326498 0.03467978 0.07100242 0.15534475 0.03397150
#> [9,] 0.07804772 0.04121022 0.11133704 0.03764679 0.15166109 0.06087115
#> [10,] 0.17565823 0.01197592 0.07203870 0.02248255 0.03695461 0.15766038
#> [,7] [,8] [,9] [,10]
#> [1,] 0.10270502 0.01621063 0.01757519 0.04059321
#> [2,] 0.02299322 0.13085445 0.04550245 0.01357013
#> [3,] 0.04682806 0.03883403 0.12967520 0.08610498
#> [4,] 0.04368520 0.06461761 0.03563582 0.02183984
#> [5,] 0.03798043 0.12552159 0.12746094 0.03187254
#> [6,] 0.13150219 0.02488185 0.04637250 0.12325844
#> [7,] 0.26570550 0.01526199 0.02368273 0.10181918
#> [8,] 0.02089032 0.36369251 0.10539501 0.01688296
#> [9,] 0.03116625 0.10133022 0.34966591 0.03706361
#> [10,] 0.13056814 0.01581694 0.03611624 0.34072828