Giter VIP home page Giter VIP logo

econci's Introduction

econci

image

image

image

Calculates Economic Complexity Indexes

  • Free software: MIT license

This package implements the indexes found in the Atlas of Economic Complexity [HaRH2014], [HiCH2009] and [HiCK2007]. It also creates the Product Space.

Installation

econci can be installed from PyPI:

pip install econci

or from Anaconda:

conda install -c conda-forge econci

Usage

import econci

comp = econci.Complexity(df, c='country', p='product', values='export')
comp.calculate_indexes()
eci = comp.eci
pci = comp.pci

# creating the product space
comp.create_product_space()

# the graphs are networkx.Graph objects
complete_graph = comp.complete_graph  # complete product space
max_spanning_tree = comp.maxst  # maximum spanning tree
prod_space = comp.product_space  # product space

# edges_nodes_to_csv saves one csv file with edges and weights
# and another file with nodes information
econci.edges_nodes_to_csv(prod_space, graph_name='prod_space', dir_path='./data/')

Complete list of calculated indexes:

  • Economic Complexity Index: comp.eci
  • Product Complexity Index: comp.pci
  • Country Diversity: comp.diversity
  • Product Ubiquity: comp.ubiquity
  • Balassa's RCA [BaBN1989]: comp.rca
  • Proximity: comp.proximity
  • Density: comp.density
  • Distance: comp.distance

You can also vary the threshold of RCA value when creating the Mcp matrix. The Complexity class accepts the parameter m_cp_thresh, which by default is 1.0.

comp.create_product_space() also accepts the argument edge_weight_thresh, by default 0.65. This argument filters edges to be added to the maximum spanning tree by weight.

References

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

BaBN1989

Balassa, B., & Noland, M. (1989). ``Revealed''Comparative Advantage in Japan and the United States. Journal of International Economic Integration, 8-22.

HaRH2014

Hausmann, R., Hidalgo, C. A., Bustos, S., Coscia, M., Chung, S., Jimenez, J., … Yildirim, M. A. (2014). The Atlas of Economic Complexity: Mapping Paths to Prosperity. MIT Press.

HiCH2009

Hidalgo, C. A., & Hausmann, R. (2009). The building blocks of economic complexity. Proceedings of the national academy of sciences, 106(26), 10570-10575.

HiCK2007

Hidalgo, C. A., Klinger, B., Barabási, A. L., & Hausmann, R. (2007). The product space conditions the development of nations. Science, 317(5837), 482-487.

econci's People

Contributors

phcsoares avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

econci's Issues

some issue about data

Hello, the method you provided is of great help to me. Thank you for your contribution. I've had some problems with computational data builds while working with your code. If it is convenient for you, can you provide an example of data? Thank you very much again. Best Wish !

Could you help me understand the "fix sign" process?

Hi,

Thank you for your effort to implement the ECI algorithm!

However, I do have a question that needs your help. After calculating the ECI for each country and the PCI for each product, why there is an additional step to "fix the sign"? I know the rankings may be reversed without this step, but I can't find it in the papers or books by the authors. Is it a typical procedure in linear algebra?

In addition, according to Kemp-Benedict (2014), ECI and the diversity of countries are orthogonal. Does it mean that ECI is independent of diversity and should have a close-to-zero correlation coefficient? In my experiment with your and the official code, ECI and the diversity show a significant positive correlation (~0.5, both Pearson's and Spearman's correlation). Do I misunderstand what orthogonal means?

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.