The world’s leading publication for data science, AI, and ML professionals.

Visualizing How Global Trade Shapes the Climate Crisis

How is global trade and the climate crisis related? It's complicated, but a picture says more than a thousand words.

Decision-makers are on a tight schedule if they want to live up to their obligations in the Paris agreement. Luckily, there is a lot of research about understanding the climate crisis from a financial perspective that can help them. As a data scientist, I thought it would be interesting to look at some of the data and see if I could make out some patterns.

Figure 1. Intermediate demand from my previous blog post. Image by author.
Figure 1. Intermediate demand from my previous blog post. Image by author.

In my previous blog post, I used Data Science tools to mine the global economy. I used Pymrio and a few other libraries along with Gephi to visualize the global economy based on the Eora26 dataset[1,2]. I found that there is a closely connected core of economies that trade with each other. Roughly half of the world’s countries belong to this core while the rest play a minor role. I also found that the US was the economic powerhouse of the global economy throughout the ’90s but that China is catching up fast. You can see a visualization of the trade between a few of the core countries of the economy in 2014 in Figure 1.

In this blog post, I will try to couple the international trade to global emission data using the PRIMAP-hist dataset[3] which includes all greenhouse gasses included in the Kyoto Protocol but does not include land-use change and forestry. This data is included in Eora26. I will first explain the idea behind input-output theory to model the economy and how it can be coupled to emission data. After that, we’ll dig into the data.

A crash course in input-output tables

In input-output theory, the economy is modeled by considering the flow of capital into, out of, and within the economy. The idea is that end-users drive the economy because they provide final demand for products which produces intermediate demand to supply the products. Consider the following example. You buy a handful of nails from a carpenter for $1. You are then the end-user of the nail so your purchase constitutes final demand. The carpenter didn’t make the nail, he bought it from a wholesale vendor who bought it from a factory. The factory needs steel, machines, and a bunch of other stuff to make the nail. The steel manufacturer needs gas, electricity, and computers and buys them from other vendors. In that way, all sectors are connected and generate intermediate demand to satisfy the final demand. The amount of capital in the economy is not constant, so to balance the economy you also need information about the value added to the economy. Input-output tables capture how capital flows in and out of the economy and between the sectors and of the economy. All this information is collected into giant tables that make up for example Eora26.

First off, though, let’s try to get a sense of the scale of the intermediate and final demand.

Final and intermediate demand

In the bar plot below (Figure 2) I plotted the magnitude of global final and intermediate demand in basic prices (before tax) in 2015.

Figure 2. Total final and intermediate demand in 2015. Image by author.
Figure 2. Total final and intermediate demand in 2015. Image by author.

We can see that on average for the global economy, $1 worth of final demand (e.g. a handful of nails) generates approximately $1 of intermediate demand. If you assume a linear relationship between the final demand and the total output of the economy (intermediate + final) you can calculate what the flow of capital between the sectors should be to satisfy the final demand. If you are interested in the details of this model I recommend you to read this introduction [4] or have a look at the notebook containing my code. But let’s see an example.

Visualizing supply chains

In Figure 3, below, I show a visualization of the calculated intermediate demand necessary to satisfy $1 of final demand from the construction sector (from which you bought the nails, remember?). The data used to build the model is from 2015. I used NetworkX to built the network and wrote some code to visualize it in Gephi.

Figure 3. Intermediate demand generated from $1 of final demand in the "Construction" sector. Image by author.
Figure 3. Intermediate demand generated from $1 of final demand in the "Construction" sector. Image by author.

Each sector in the economy is represented by a dot (node) and each sector is connected to all other sectors with an arrow (directed edge) which indicates the direction of the flow of capital and the magnitude of the flow by its size and blackness. You will see that there are also arrows that loop onto themselves. This indicates the flow of capital within a sector. I used a spring algorithm to place the dots at distances from each other that correspond to intermediate demand (Force Atlas 2 algorithm). The color of the nodes corresponds to the contribution to the total output generated as a result of $1 of final demand for the construction sector. You can find this value by adding up all the arrows going into each node (the in-degree).

We see that the final demand for the "Construction" sector on average results in a large output generated in the "Petroleum, Chemical …", "Metal Products" and "Financial Intermediation". Conversely, the sector does not appear to generate a lot of output in the "Hotels and Restaurants" and "Electricity, Gas and Water" sectors. But you can see that other sectors in the supply chain generate output in the "Electricity Gas and Water" sector. These are especially the "Petroleum, Chemical …" and "Metal Products" sectors. This type of Visualization makes it very easy to visualize the flow of capital and identify potential hotspots in the supply chain. But how is this related to the climate crisis you ask? Hang on, because we are almost there!

Accounting for emission

We have learned a way to attribute final demand with the output of different sectors. If we know the emission of each sector, then we can argue that the footprint associated with final demand for the products of that sector should be proportional to the output and emission of that sector. That way we can account for the total output of the economy and the total emission related to the economy. For a given final demand we can then calculate the total footprint and understand it as contributions from the different sectors. This is of course only a model – but a model which is intuitive and interpretable. So let’s get stuck into the emission data.

Relationship between emission and outputI wanted to know the nature of the relationship between the output of the different sectors and their emission on a global scale. In Figure 4, below, I show a scatter plot where the emission of each sector is plotted along with the total output of the sector.

Figure 4. Scatter plot of total emission excluding LULUCF from the PRIMAP-hist dataset and output in the Eora26 dataset.
Figure 4. Scatter plot of total emission excluding LULUCF from the PRIMAP-hist dataset and output in the Eora26 dataset.

As you can see, there appears to be an almost linear relationship between the emission of each sector and its output. There is one exception though. The "Electricity, Gas and Water" sector has an average output but a gigantic emission. So in all supply chains that include "Electricity, Gas and Water" (which are all supply chains) the contribution to the footprint from this sector is much larger than the contribution to the total output (on average). Let’s go back to our example for a second.

In Figure 3 you will see that each node has a different size. The size indicates the contribution to the total footprint from that sector. You can see that although "Electricity, Gas and Water" does not really contribute to the indirect output (the arrows into it are small and the node is far from the "Construction" node), it contributes a lot to the indirect footprint.

Visualizations like these make it easy to identify emission hotspots in global supply chains. For example, even if the construction sector reduced its demand for "Electricity, Gas and Water", it would not change the total footprint a lot since all the other sectors also need "Electricity, Gas and Water", some of them even more than the "Construction" sector. So a better solution would be to transform the "Gas, Water and Electricity" sector to reduce the emission per output.

Making predictions

The power of the model is that we can also anticipate the effect of "small" changes in demand on the entire supply chain (small, because the model assumes linearity, remember?). For example, how much could we reduce the global footprint of the Construction sector if we made the "Gas, Water and Electricity" sector 10% more efficient in terms of emission? Information like this may be important for decision-makers, but also consumers because it is their final demand that drives the intermediate demand. For example, a method similar to the one outlined in this post was recently used to calculate the footprint of the 500 most popular grocery items in Denmark. This makes it possible for consumers to make informed decisions about how their spending habits contribute to their individual footprint. In Denmark, a lot of the grocery items are imported. So a lot of the emission associated with the final demand takes place abroad. I was interested in understanding the extent to which this was true on a global scale. So let’s take a look at that next.

Visualizing the export/import of emission

I approached the problem by first calculating the magnitude of the local contribution to the local footprint for all regions. I then compared the global total emission to the sum of these local contributions. I plotted this in Figure 5, below, for the years 1993–2015.

Figure 5. Total territorial emission and emission to satisfy regional demand. Image by author.
Figure 5. Total territorial emission and emission to satisfy regional demand. Image by author.

You can see that global emissions increased in the time period and that 85–90% of the total emission could be attributed to local contributions from local demand. But still, 10–15% is imported/exported emission which is still a substantial contribution, although not necessarily a bad thing. To see the development over time, I plotted the ratio of the footprint of each region to the territorial emission of the region in the map in Figure 6.

Figure 6. The ratio of footprint and territorial emission for regions in the Eora26 dataset.
Figure 6. The ratio of footprint and territorial emission for regions in the Eora26 dataset.

Some smaller countries have very high and very low ratios so I had to restrict the color range from -0.5 to 0.5. You can see that the map becomes more colorful over time. This tendency indicates an increase in import/export of emissions. We can also see from the blue and red color that it appears that final demand in the west tends to lead to emission abroad. For Asia and parts of Africa, final demand abroad tends to lead to local emission. But the map does not tell us between which regions the export/import occurs. So I made another graph…

Mapping the flow of emission

I wanted to understand which countries drove the emission associated with international trade. To go about this, I could have plotted the supply chain of each region and looked for patterns like we did for each sector. Instead, I calculated the extent to which the final demand in region A could be attributed to emissions in all other regions. I then drew an arrow between region A and all other regions where the size and redness of each arrow reflected the direction and magnitude of the emission in that country as a result of the final demand in region A. I did this for all regions and again visualized the graph using Gephi and the Force Atlas 2 spring algorithm. You can see the result in Figure 7, below.

Figure 7. Visualization of local emissions as a result of final demand in different countries. Only arrows above a certain threshold are shown. Image by author.
Figure 7. Visualization of local emissions as a result of final demand in different countries. Only arrows above a certain threshold are shown. Image by author.

Remember, the arrows point in the direction of the emission and the size and redness indicates the magnitude of the emission. I set a threshold for when to draw an arrow to make the visualization prettier. The size of the dots (nodes) reflects the magnitude of total imported or exported emission. If a region is a net exporter of emission, then the hue of the node is blue and if the region is a net importer of emission, the hue of the node is red. The saturation of the color and the size of the node indicates the magnitude of total import/export of emission to/from the region. As an example, the US is the largest exporter of emission, so the USA node is the largest of the blue nodes and has the clearest blue color. Conversely, China is the largest importer of emissions, so it has the clearest red color. The size of the Chinese node is larger than the USA node which indicates that the net import of emission in China is larger than the net export of emission from the US.

We see that the final demand in the West and a few Asian countries drive emissions in China. Interestingly, the final demand in China appears to drive emission in Russia and the final demand in Russia appears to drive emission in Belarus. Final demand in Hong Kong also appears to drive emissions in China. But a picture says more than a thousand words, so I encourage you to explore the visualization yourself and see if you can find some interesting patterns. Let me know what you find as a comment.

All of this import and export of emissions is not necessarily a bad thing. If China and Indonesia were more efficient in terms of emission per output than the countries they export products from, then it would actually be a good thing. Unfortunately, they are not. So while the territorial emissions in some western countries are decreasing, it comes at the cost of a larger footprint abroad. Decision-makers should remember this.

I am new to blogging. So so let me know if you have any comments or suggestions. You can find the code here. You can also find me on LinkedIn.

[1] Lenzen M, Kanemoto K; Moran D, and Geschke A (2012) Mapping the structure of the world economy. Environmental Science & Technology 46(15) pp 8374–8381. DOI: 10.1021/es300171x

[2] Lenzen, M., Moran, D., Kanemoto, K., Geschke, A. (2013) Building Eora: A Global Multi-regional Input-Output Database at High Country and Sector Resolution. Economic Systems Research, 25:1, 20–49, DOI:10.1080/09535314.2013.769938

[3] Gütschow, J., Jeffery, M. L., Gieseke, R., Gebel, R., Stevens, D., Krapp, M., & Rocha, M. (2016). The PRIMAP-hist national historical emissions time series. Earth System Science Data, 8(2), 571–603. https://doi.org/10.5194/essd-8-571-2016

[4] Leontief, W. (1970). Environmental Repercussions and the Economic Structure: An Input-Output Approach, The Review of Economics and Statistics, Vol . 52, No. 3 ( Aug ., 1970 ), pp. 262–271, The MIT Press. The Review of Economics and Statistics, 52(3), 262–271.


Related Articles