distance()
computes the distance matrix that
accounts for the weighted proportions of the products connected to
each good that the countries are not exporting.
Arguments
- balassa_index
(Type: matrix) the output from
balassa_index()
) or an equivalent arrangement.- proximity_product
(Type: matrix) the output from
proximity()
) or an equivalent arrangement.
Details
The current implementation follows (Hausmann et al. 2014) to measure the oppotunities implied by a country's position.
References
For more information on this index see:
Hausmann R, Hidalgo C, Bustos S, Coscia M, Simoes A, Yildirim M (2014). The atlas of economic complexity: Mapping paths to prosperity. MIT Press. doi:10.7551/mitpress/9647.001.0001 .
and the references therein.
Examples
d <- distance(
economiccomplexity_output$balassa_index,
economiccomplexity_output$proximity$proximity_product
)
# partial view of the distance matrix
n <- seq_len(5)
d[n, n]
#> 0011 0012 0013 0014 0015
#> afg 0.8331042 0.8262115 0.8585811 0.8492409 0.8544359
#> ago 0.9852531 0.9845604 0.9888446 0.9878229 0.9875953
#> aia 0.8209798 0.8327345 0.8311476 0.8151172 0.8105377
#> alb 0.7342140 0.7454137 0.7721725 0.7479724 0.7678040
#> and 0.7386129 0.7706530 0.7687830 0.7602132 0.7281361