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.49951266 0.02243939 0.12826069 0.03346684 0.04052598 0.09444665
#> [2,] 0.10555386 0.29371053 0.02912267 0.08506004 0.04714929 0.05810860
#> [3,] 0.42236493 0.02038743 0.20561311 0.02832667 0.04857410 0.09720505
#> [4,] 0.16723037 0.09035726 0.04298349 0.31200172 0.02998791 0.06159922
#> [5,] 0.20147846 0.04983188 0.07333404 0.02983602 0.31042141 0.12416211
#> [6,] 0.29616230 0.03873652 0.09256306 0.03865609 0.07831359 0.19579415
#> [7,] 0.11144436 0.17825844 0.02952123 0.13432216 0.03471647 0.05335277
#> [8,] 0.08248587 0.17740952 0.02411284 0.05139039 0.05990261 0.05083496
#> [9,] 0.25598759 0.02243202 0.07733624 0.06472720 0.02115684 0.05225266
#> [10,] 0.31940421 0.03590818 0.09685570 0.03921653 0.06751696 0.16809584
#> [,7] [,8] [,9] [,10]
#> [1,] 0.02325631 0.01327663 0.03937989 0.10543495
#> [2,] 0.17498301 0.13432231 0.01623256 0.05575712
#> [3,] 0.02028671 0.01278059 0.03917716 0.10528426
#> [4,] 0.14006543 0.04133240 0.04975570 0.06468650
#> [5,] 0.03601750 0.04793460 0.01618086 0.11080312
#> [6,] 0.03491266 0.02565748 0.02520619 0.17399795
#> [7,] 0.29920835 0.08364673 0.02250985 0.05301963
#> [8,] 0.10844850 0.38792547 0.01043591 0.04705392
#> [9,] 0.03053513 0.01091901 0.40588305 0.05877026
#> [10,] 0.03351780 0.02294352 0.02738856 0.18915270