An R package that is able to replicate a great deal of the calculations that run the Observatory of Economic Complexity. (Please note that I am not affiliated with the OEC in any way!) A description of the technique was published by Hidalgo and Hausmann as the Atlas of Economic Complexity.A simplified explanation of the technique follows, but for further details please consult the original document.
In brief, the Economic Complexity Indicator (ECI) is a metric that aims to measure underlying drivers of a country or jurisdiction's present and future prosperity. The work of Hidalgo and Hausmann establishes that higher ECI values tend to be correlated with higher growth of GDP per capita.
Why should this be? We can conceive of goods that are very complex (e.g. photocopiers, aircraft) as having more knowledge "embedded" within then than goods that are relatively simpler (e.g. agricultural products, natural resources). This says something about the countries that are able to produce these goods. Furthermore, countries have the ability to grow their GDP per capita faster if they choose to produce and export more complex goods as opposed to simpler ones.
The underlying mathematics is similar to principal components analysis. Export data is retrieved from the UN Comtrade database. Some manipulation is done on this data to determine export shares by country and by product. This manipulated data is put into matrix form, manipulated further, and then eigenvector/eigenvalue pairs are found which are used to compute the ECI for each country in the dataset. Similar computations can be done to produce measures of product complexity (the Product Complexity Indicator, or PCI), as well as the "proximity" of one product to another. This can be visualized as a network diagram called the "product space".
Economic complexity is of interest to academics and policymakers who are seeking to understand the underlying drivers of economic growth. The product space and the idea of proximity between products also provides a recipe for countries and jurisdictions looking to diversify their economy by moving from relatively less to relatively more complex, yet "nearby", products.