Enhancing countries' fitness with recommender systems on the international trade network

Prediction is one of the major challenges in complex systems. The prediction methods have shown to be effective predictors of the evolution of networks. These methods can help policy makers to solve practical problems successfully and make better strategy for the future. In this work, we focus on exporting countries' data of the international trading network. A recommendation system is then used to identify the products corresponding to the production capacity of each individual country, but are somehow overlook by the country. Then, we simulate the evolution of the country's fitness if it would have followed the recommendations. The result of this work is the combination combine these two methods to provide insights to countries on how to enhance the diversification of their exported products in a scientific way and improve national competitiveness significantly, especially for developing countries.

Two methods were proposed to assign scores to countries and products using the complex network approach. The basis of these methods is to analyze the relation between countries and their exports, and then to rank the countries according to their economic competitiveness and the exported good with the economic advantage they bring to the exporting countries. The first method, the Method of Reflection (MR), proposed the Economic Complexity Index (ECI) to account for the production characteristics of countries. The countries are ranked according to their exporting capacity. The authors pointed out that the method is able to predict the future economic expansion of countries and that the scores obtained with MR indicate which products should be exported in order to maximize the countries' performance [18]. In Ref. [19], a method based on the Markov chain was proposed. The method showed the need to take into account the nonlinear interactions between exported commodities and national diversity. This lead to the development of the Fitness and Complexity metric [20]. It is an iterative method based on the nonlinearity of the system. This method was shown to be conceptually more grounded than the previous ones and a better predictor of the economic evolution [21,22]. This method was applied to forecast the GDP growth in a recent work. The authors reported that their estimates were on average 25 percent more accurate than were those made by the International Monetary Fund [23].
In this paper, we start with a detailed definition of the used algorithms, namely the Probabilistic Spreading algorithm [24], the Heat Spreading algorithm [25], the Degree Increase algorithm [26], and the Time-aware probabilistic spreading algorithms [27]. We then apply these four algorithms to the international trade network and compare their performance on two different aspects. The first one is the evaluation of the accuracy of the recommendation, which is a standard evaluation of the recommendation algorithms. The second aspect is the evaluation of the algorithms on their ability to recommend products that would improve the countries' fitness. This is obtained by the combination of the recommendation results with the Fitness and Complexity scores to simulate the changes in rankings and fitness values of countries after exporting recommended products. The experimental results confirm the validity of the recommendation algorithm on this task, and show the validity of our approach to tackle this problem.  [28] and the similar categories were merged together. Additionally, the countries that had no entries recorded for exportation between 2001 and 2015 were removed. After cleaning procedure, the international trade network comprise of 192 countries and 786 commodities. We use the bipartite network approach to represent the data. In this approach, one set of nodes represent the countries, and the second set of nodes represent the commodities. If a country is considered as an exporter of a commodity, a link connects the country's node and the commodity node.
RCA: The data of the international trade network includes country nodes and commodity nodes. These two types of nodes form a bipartite network. One important aspect of our network representation is that it is binary. Either two nodes are connected, or they are not. We then need a criterion to define if a country can be considered as an exporter of a commodity or not. Indeed, even if countries cannot produce a specific commodity, they might export a very small amount of it. Therefore it should not be considered as an exporter of the commodity. In order to quantify the advantage of a country on a commodity, we use the 'Revealed Comparative Advantage' (RCA) as a clear constraint to determine whether a country can be considered as an exporter of certain commodities [29].
Where e iα is the total amount of export α for country i. If the country i is regarded as an exporter of the commodity α, the export amount of the commodity α should occupy a larger proportion in the total amount of the export goods of the country i. We set the RCA value to 1 and the country-commodity will have links when this pair of nodes satisfies the condition of RCA iα ≥ 1. These nodes and links together constitute the bipartite network of the international trade activities.

Recommendation System
Recommendation systems aim at recommending the most adequate items for users. In comparison with traditional link prediction, the focus is put on individual nodes rather than individual links. In our case, the main focus of the recommendation process are the countries nodes. For each country node in the system, the algorithms compute a score for every product in the network. If the country is already considered as an exporter of an item, the score corresponding to the product is set to 0 (i.e. a product that is already exported is not recommended). The recommendation list for each country is composed by the top-L products with the highest score for the particular country. We now describe the algorithms used in this work. Note that L is set to 20 in this work and it has been shown to have no impact on the significance of the accuracy [17].
In order to compare the performance of the five recommender algorithms, We choose a year T and predict which additional good the countries exports at year T + 5 (the testing set) based solely on the data up to year T (the training set).
Probabilistic spreading (ProbS): For target user i, the initial resources are first distributed evenly on the item side and then propagated to the user side through a random walk process [24]. In the same way, the resources are then returned to the item side. Both steps are used to allocate resources among neighbors and then spread to the other side. Finally, the score of each item for country i is obtained. The initial resource vector is represented as f (i) and its elements as f The elements of the redistribution matrix W are derived from probabilistic spreading process.
where I denotes the number of products and U the number of countries. a jα a jβ represents path from item β to item α through country j in two random walks. The ProbS algorithm employs a column-normalized transition matrix. The partition of k β and k j corresponds to the uniform partition of resources between all links from nodes β and j [30].
Heat spreading (HeatS): The Heats spreading algorithm evolved from the Probabilistic spreading algorithm. These two methods are similar in structure and both use random walk processes to the redistribute initial resources. Compared with the ProbS algorithm, resources spread more evenly in the Heats spreading method and items with only few connections usually benefit from a higher score than with the ProbS algorithm [25].
The initial resource vector is set to f (i) according to user's item collection, the elements f (i) α =a iα can be regarded as the temperature value of the item. Unlike the ProbS algorithm, which uses column normalization transformation matrix, the HeatS algorithm uses row normalization. The spreading process is represented by a matrix as follows, Resource received by the user i is equal to average resource owned by the user's collected item. Similarly, item side receives resources transmitted from user through the averaging process. The item's score is calculated as: Degree Increase (DI): The time information is often overlooked in the evolution of complex networks. In fact, time plays a crucial role in the evolution of information networks [31,32,33]. The combination of recommendation systems with time dynamics improve the recommendation and allows to perform better predictions. It has been proven that Degree Increase (DI) method can accurately predict the prevalence of items in the future. The increase in popularity of item α within time window τ is: corresponds to the number of users who have collected item α. The final item score is expressed as: In practice, the value of ε must be small enough to ensure that the ranking of commodity popularity growth ∆k α (t, τ ) does not change.
Time-aware probabilistic spreading (TProbS): The ProbS method is characterized by the fact that spread of resources is cumulative, that is, the more popular items are more likely to get high scores and recommend to users. The Time-aware probabilistic spreading method integrate the ProbS method with the DI method. It writes mathematically as: where the parameter θ is an additional parameter to define the length of past time window.

Fitness and Complexity metrics
The Fitness and Complexity metrics are used to measure the competitiveness of countries and the quality of exported products. The algorithm consists of two nonlinear coupling equations [20,34], which eventually reach a fixed value through iterative methods and equations is defined as where F n i indicates the fitness of country i after n iterations. In Ref. [35], the convergence of the algorithm and its stopping condition were demonstrated. The higher the fitness value, the more advantageous the variety and complexity of the goods exported by the country. The study [36] shows, the weak economies can analyze how to get out of the poverty trap and increase the diversification of their exports via fitness metrics. Complexity Q n α cannot simply calculate from average of countries' fitness. Successful countries export almost all products and it is unable to infer the complexity of each product from their export data (for example, our data shows, a total of 786 products were included in the International Trade Network from 2001 to 2015, and the United States exported a total of 775 kinds of products). Therefore, the complexity of product should be measured in a non-linear way, namely, it is essential to reduce contribution of successful countries. Assuming that product α possess two exporter i and j with fitness values of 0.2 and 15, respectively, the complexity of the product would be 0.197. If the two exporter i and j with fitness values of 10 and 15, the complexity would be 6. This two examples verify the fact value of complexity depends mainly on the worst exporter.

Precision and Recall metrics
In general, recommendation algorithms are compared in their ability to predict the future. In order to evaluate their accuracy, we use two metrics, namely the Precision, and the Recall metrics. We are not interested in the accuracy of the algorithms per se, but the accuracy of the recommendation results is an important evaluation indicator. A higher accuracy indicates that the exporting countries possess the capacity to produce the recommending commodities. Indeed, the countries should be able to produce the recommended commodities in the near future, otherwise the recommendation process would be meaningless. Precision: For each country, the individual precision is measured as the fraction of recommended products that are eventually exported. If n i is the number of products eventually exported by country i and that are actually recommended, then the precision for country i is P i = n i /L. The Precision P is the average of P i over every countries. Recall: Recall is similar to precision, but we use the number of newly exported goods instead of the fixed recommendation list L. If country i exports E i additional items in the testing set, the individual recall reads Recall is the average of R i over every countries.

Addition of products to countries' export basket
After having obtained the recommendation list from the previously described recommendation methods, we add the goods that are at the top of the recommendation lists to the respective countries' exports basket. Then, the fitness value of each country is reevaluated and its change is recorded. However, the calculations of fitness is an iterative nonlinear process, which is coupled with the complexity of the products. Thus, in order to evaluate the changes brought by adding the products to the country's export basket, only one country is modified at a time. In other words, for a given country i, only its recommendation list is added to its exports basket and the rest of the network is left untouched. For instance, if we have a high complexity product to the export basket of a low fitness country, the complexity of the product might be greatly reduced, which will have a strong impact on the rest of the fitness and complexity values. The simulation process is described as below. For each country, we add the L products in its recommendation list to its export basket. For each product α in the top L part of the recommendation list of country i, we add a link between the country i and the product α in the data. The export volume of product α from country i must satisfy the condition of RCA ≥ 1. The parameter θ = 0.2 is constantly the one giving the highest recall in our simulation, and thus is fixed to this value. Obviously, this lessen the impact of degree increase on the network, which is compatible with the expected behavior of countries development. They should not all focus on the same products, but they still follow the ongoing trends. As noted in [17], the HeatS method performs surprisingly well. This method usually performs poorly in online e-commerce network [37], but has the advantage of recommending products with lower degree. DI and Degree both perform poorly, which is expected as they do not take into account the production capabilities of countries.

Tier division
An interesting study is to investigate the impact of the methods on countries with different fitness rank. It is not certain that a country that belongs to the top of the fitness list will behave the same than a country that belongs at the bottom of the list. In order to study this effect, we divide the countries into three different categories according to their fitness rank. The three categories hold the same number of countries and thus are denoted as top tier, middle tier, and low tier. For each category, we compute the average increased ranking and increased fitness after the addition of the recommended exports. The results are shown in Figure 2 on page 9. The countries that benefits the most from these recommendation are middle and low tier countries. In panel (a), the most interesting result is in HeatS. The increased ranking by following its recommendation are much higher than those of TProbS. This is especially true with top tier countries, as following the recommendation of TProbS would even lower a country's fitness. This comes from the fact that top tier countries need to innovate and produce goods for which there are only a few competitors. While for middle and low tier countries, it is sufficient to produce additional items. Note that we try adding time to HeatS: the recall improved to the level of TProbS, but the improvement of fitness was lower than that of HeatS. So we decided to keep only HeatS and TProbS for simplicity.
From panel (b), we see that the fitness of top tier countries is the one improving the most, which shows that the recommendation algorithm indeed recommend different complex products in line with the ability of the country. For top tier countries, the difference of fitness between two countries is large. While for lower tier countries, the fitness difference between two countries is much smaller. This fact explains the result that top tier countries' fitness improvement is significant but their ranking is only slightly improved, while the low tier countries can increase the ranking a lot in the case of less improvement in fitness. To illustrate better our recommendation results, we select three countries in each tier. Due to the limit of the page size, we only choose the five products with the highest score according to TProbS and HeatS for each country. The products recommended by TProbS and HeatS are shown in Table 1 on page 7 and Table  2 on page 8, respectively. Both tables show the products with different complexity for various tier countries.

Evolution of countries' fitness
In order to directly study the effect of each algorithm on the country's fitness value, we randomly select 30 countries in the middle tier and compare the evolution in the average fitness of these countries for the different methods. We compare the normal evolution of countries and the one recommended by these algorithms. The results are shown in Figure 3 on page 10 (panel (a)). For any length of the recommendation list L, HeatS is the top performing by a great margin compared to other methods. For all methods, ranking are consistent for every choice of L, and so the choice of the value is not meaningful, as long as it is reasonably small compared to the total number of items. By looking at the evolution with the length of the recommendation list L, we find that the results are consistent and if the country should follow the recommendation, even if it can add only few products to its export basket. Following the recommendation made by HeatS seems to be adequate in terms of technological requirements (i.e. the countries have the required technology) as well as the best path to increase the country's fitness. In Figure 3 on page 10 (panel (b)), the results are shown for different years and for fixed L. Though some methods are better at specific year than other, it is clear that HeatS is always the top performing method, followed by Degree and DI and then TprobS. This is good news as it shows the robustness of our method, both in the isolated case and in the real evolution of countries' exports.
We are also interested in the individual behavior of the fitness evolution. We randomly select four countries, and study the effect of the method on the evolution of the fitness values. The comparison of the five methods as a function of L and the original fitness is shown in Figure 4 Figure 3 on page 10 that HeatS is always best on average, it's different when considering individual countries with especially low production. The impact of the recommendation on the increased ranking of the four countries is shown in Figure 5 on page 12. We see in Figure 5 on page 12 (panel (b)) that even if HeatS is not the best method, the difference in ranking is quite small, while in other panels it clearly outperforms other methods.

Real production ability
In the previous results, we fixed a parameter L and assigned the same number of new products to every countries. However, in reality some countries produce many new products at a specific year, while some others struggle more. To reflect this, we use a dynamic length of the recommendation L i , where L i is the length of the recommendation list for country i, equal to its number of new products between time T + 5 and T . We build a 'virtual network' corresponding exactly to the real one at T + 5, except for one country i, for which we replace the links that appears between T and T + 5 by those of the recommendation list. This ensures that the network is of constant size. The results for HeatS are shown in Figure 6 on page 13. We see that HeatS improves greatly the fitness of most countries that follow its recommendation. Only a few countries see their fitness decreasing compared to their original evolution. As a comparison, we see in Figure 7 on page 13 that TProbS is of no use for top tier countries, but for middle and especially low tier countries they might benefit from it. While lower than for HeatS, the recommendation of TProbS are made of more widespread technologies and so might be easier to follow for the low fitness countries.

Conclusion
In this study, we extended the traditional recommendation, which are usually applied on social networks, to the international trade. Thanks to recent advances in measuring the potential countries' evolution based solely on the network structure, we designed a method which aims to help countries to find a suitable evolution path among all the possible ones. The study suffers two main limitations. The first one is that the exports categories are roughly defined. Only about 786 categories are present in the dataset. This leads to some categories containing very varied products, such as Iron based goods. The second one is that there are important restrictions, or conversely support, to the trade between countries. For instance, USA, Canada, and Mexico recently signed an agreement to open the market of Dairy and Cars parts. On the opposite, countries might limit their sensitive exports, such as military goods, to specific countries. While the first limitation is difficult to address due to the data limitations, the second one can be added by weighting differently the relationships between countries on specific products.
At the same time, the recommendation proved to grasp the countries technological evolution by being able to correctly predict the future, and the method of Fitness and Complexity has been shown in [38,39,40] to uncover hidden features of the countries' evolution. It is important to note that recommendation method should agree with the similar capabilities of a country [41]. Those two ingredients together mixed with our results show remarkable evidence that our methods as supplementary message could help to design objective metrics in order to facilitate the work of policy makers and encourage the development of technology towards the better economic goal.