density()
computes the density matrix that
accounts for the weighted proportions of the products connected to
each good that the countries are exporting.
density(balassa_index, proximity_product)
(Type: dgCMatrix) the output from
balassa_index()
) or an equivalent arrangement.
(Type: dgCMatrix) the output from
proximity()
) or an equivalent arrangement.
A matrix.
The current implementation follows (Hausmann et al. 2014) to measure the oppotunities implied by a country's position.
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.
d <- density(
economiccomplexity_output$balassa_index,
economiccomplexity_output$proximity$proximity_product
)
# partial view of the density matrix
d[1:5, 1:5]
#> 5 x 5 Matrix of class "dgeMatrix"
#> 0011 0012 0013 0014 0015
#> afg 0.16689576 0.17378847 0.1414189 0.15075914 0.14556406
#> ago 0.01474693 0.01543965 0.0111554 0.01217709 0.01240472
#> aia 0.17902020 0.16726547 0.1688524 0.18488279 0.18946228
#> alb 0.26578601 0.25458634 0.2278275 0.25202762 0.23219603
#> and 0.26138713 0.22934698 0.2312170 0.23978684 0.27186394