Machine prediction of US imports from the PRC in the context of mutual sanctions

The aim of this paper is to mechanically predict the import of the United States of America (USA) from the People's Republic of China (PRC). The trade restrictions of the USA and the PRC caused by the USA feeling of imbalance of trade between the two states have significantly influenced not only the trade between the two players, but also the overall climate of international trade. The result of this paper is the finding that multilayer perceptron networks (MLP) appear to be an excellent tool for predicting USA imports from the PRC. MLP networks can capture both the trend of the entire time series and its seasonal fluctuations. It also emerged that time series delays need to be applied. Acceptable results are shown to delay series of the order of 5 and 10 months. The mutual sanctions of both countries did not have a significant impact on the outcome of the machine learning prediction.


Introduction
The business relationship between the USA and China is currently supported by roughly 2.6 million jobs in a large number of industrial sectors including jobs which Chinese corporations have created in the USA [1]. Since Chinese middle class will go on developing in the next decade, American corporations will have the opportunity to benefit from a new and lucrative consumer basecamp which may further encourage the employment and economic growth [2]. A big advantage to the US economy in going into business with China is that China has become an integral part of the global production supply chain; a considerable part of its export includes components produced abroad and provided for the final assembly in China [3]. If the value of these imported components is subtracted from Chinese export, the business deficit between the USA and China will be reduced by a half to roughly 1% of GNP. The next big advantage is the expectation that China will remain one of the fastest growing strong economies and will be creating ample opportunities for the growth of the US society; supposing that China will continue in economic improvements which will remove existing obstacles to the easy access to the market in a large number of sectors [4]. sanctions did not have a significant devastating impact on the overall Chinese economic growth and trade between the both countries with respect to macro economy, the sanctions have a damaging impact on the producer and consumer in both countries. The US economic sanctions prevented the import of technologies to China. American restrictions on the import from China caused dead weight costs for the USA as a result of higher domestic production costs of import substitutes. American export controls inhibited the export from the USA to China and contributed to huge trade deficits between the USA and China. Export controls also caused losses of highly paid jobs in the USA. Moreover, the US economic sanctions against China also had significant impacts on the third party. Chinese diversification of import to sources other than the USA may have a long-term impact on the export from the USA to China even though American economic sanctions against China will be lifted.
China declared to impose sanctions on American corporations involved in the agreement to sell tanks, rockets and other related equipment equal to 2.2 billion dollars to Thai-wan; China proclaimed that this act had violated Chinese sovereignty and national security. The spokesman of Chinese Ministry of Foreign Affairs Geng Shuang said that the USA having sold the weapons presents "a serious violation of the international law and regulations governing international relationships". In order for China to defend its national interests, the country will impose sanctions on American corporations involved in the above-mentioned sale of weapons to Tchai-wan [17].
In September 2018 American president Donald Trump announced the imposition of tenper cent tariff on the import of products from China. However, Trump also threatened to increase the tariff to 25% as of the following year. China promptly responded by a plan aiming at punitive measures in the sector of fiscal and monetary policy [18]. The monetary policy can thereby expect growing pressure on depreciating Chinese currency with the intent to compensate for the consequences of the measures. This will be implemented by mere verbal interventions or a foreign-exchange intervention of the central bank. The fiscal policy will most likely see other punitive measures [19].
Perhaps American president Donald Trump has just done a great favour to South-Korean electronics, which became Samsung after he had blocked Chinese Huawei, which the president accuses of helping Peking with its spying activities. The main American suppliers of Huawei Corporation allegedly stated that they would immediately disrupt the supplies of the Chinese corporation. In addition, Google added fuel to the flames as it stated that it would block the use of some of Huawei's services and applications for Android on its devices. As Trump had put Huawei on the black list of American technological businesses, he effectively banned Huawei from producing smartphones and tablets to sale outside China and to sell its laptops elsewhere [20].
Besedeš and Prusa [21] estimated impacts of the reduction of anti-dumping tariffs according to the probit model of random outcomes. Their research demonstrated that effects of anti-dumping tariffs which the USA imposed on the trade are under a careful examination and provisional decision and they are even more visible than after the final decision would have been reached. They also found out that for the target countries it is hard to recover lost trade level after the anti-dumping tariff has been abolished. Lee [22] compared the effects of import reduction with the target countries and the effects after the third country has abused the import policy. It demonstrates that anti-dumping tariffs have import-restricting effects. Park [23] in his works analysed the influence of anti-dumping tariffs on import studying Chinese data from 2002 to 2004 using Generalized Method of Moments (GMM). The results show that the anti-dumping protection has far-reaching effects on the inhibition and deflection of the trade.
Choi [24] analysed effects of anti-dumping measures on imports with the intent to find out whether the effect of reducing anti-dumping tariff on the business is principal. Author's  27 7 results suggest that the increase of anti-dumping tariff by 1% reduces the import of the target product roughly by 0.43 which corresponds to 0.51%. However, exact figures show that the overall import of target products increased roughly by 30% while the anti-dumping tariff was legally effective. It means that anti-dumping tariff presents only a temporary relief from import schemes.
Yu, Wang and Lai [25] aim to devise a methodology that should consider seasonal fluctuations while equalizing time series through artificial neural networks giving the import from China to the USA as an example. The difficulty to predict the volume of foreign trade is often caused by restricting a lot of conventional prediction models. In order to boost the prognostic efficiency, it is necessary to develop a method which will hybridize econometric and artificial intelligence models [26].
According to the idea of non-linear prediction of the phase space reconstruction Weijin and Yuhui [27] presented a model of delays in time series of BP neural network; the model's ability to generalize was improved by Bayesian regularization. The model is used for predicting import and export trades in one sector. In comparison with a broad prognosis assessment, the authors concluded that non-linear prognosis may not only focus on data combinations and accuracy improvement, but it can also clearly reflect non-linear characteristics of the prognosis system.

Data and methods
The mutual trade restrictions between the USA and China arising from the feeling of the USA concerning the imbalance of the trade between the two countries have significantly influenced the trade between the countries in the recent years as well as the overall atmosphere in the international trade. The United States have decided to regulate trade by imposing duty on specific kinds of goods. This naturally creates an extraordinary situation in terms of the overall trade balance, import, and export. Given that the trade war has been started by the USA, it could be expected that the first variable to be influenced will be the US import from the China. Therefore, the time series of this variable will show extraordinary fluctuations. The information on the USA import from the China thus constitutes an important data set for time series related research.
The dataset illustrates the course of the time series at monthly intervals from January 2000 to July 2019. The course of the time series is shown in Figure 1.  The Figure clearly shows seasonal fluctuations within the individual years of the monitored period. There was an especially significant growth in import from USD 6902 bn. in October 2018. This means more than 7 times higher USA import from the PRC in the monitored period. Table 1 shows the basic statistical characteristics of the dataset. There will be a regression carried out using neural structures. We will generate multilayer perceptron networks (MLP). Three sets of artificial neural networks will be generated. They will differ according to assumed time series lag: 1. 1-month lag, 2. 5-month lag, 3. 10-month lag. Time series lag is the amount of data used to calculate the next value (that is in the first case, based on the value of one preceding month, and in the second case, based on five preceding values and in the third case, based on outputs of the previous 10 months). A larger time series lag can result from averaging values. A small lag can result in extreme fluctuations of equalized time series. Each time series lag is more challenging for the complexity of the artificial neural network structure, namely neurons in the input layer (the input layer of the neural network will have 3 neurons in experiment 1, and 15 neurons in experiment 2, and even 30 neurons in experiment 3). The other settings will be equal for each experiment. Time will be used as the continuous independent variable. Seasonal fluctuations will be represented by a category variable of the month and year in which the value was measured. Thus we will use possible monthly seasonal fluctuations of a time series. At the same time, we should capture the overall trend of a time series. US import from China will be used as a dependent variable. The time series will be divided into three sets -Training, Testing a Validation. The first set will comprise 70% input data. We will generate neural structures based on the Training set. We will leave 15% input information in the two remaining sets of data. Both sets will be used for reliability verification of the identified neural structure, or model. We will generate 10,000 neural networks. We will retain 5 of them that show the best characteristics. The least squares method will be used. The process of generating networks will be finished if no improvement is achieved, i.e. the sum of squares is not decreasing. Thus we will only retain those neural structures where the sum of residual squares to the actual US import from China is the lowest possible (ideally zero). A hidden layer will have at least two neurons, but no more than 8 for experiment 1 and 9 for experiments 2 and 3. We will consider the following distribution functions in the hidden layer and in the output layer: Linear, Logistic, Atanh, Exponential, Sinus.
Other settings will remain default (according to the ANS tool -automated neural networks). In conclusion, we will compare results of the three completed experiments to determine whether the defined machine learning methodology is correct in terms of direction and to identify what time lag is closest to the correct result. Table 2 provides a summary of neural networks retained from Experiment no. 1. Source: Own processing.

Experiment 1 (1-month lag of time series)
The table shows that neural networks with 4 to 9 neurons in the hidden layer were retained. The hyperbolic tangent function and the logistic function are used neural networks to activate the hidden layer. The output neuron layer is activated by the exponential, identity and sinus functions. Of course, the performance of neural networks is important. It is expressed by a correlation coefficient. The correlation coefficient is very high for all data sets and all networks, each time above 0.98 which is a high level of direct dependence. This parameter clearly shows that the retained neural structures constitute a highly credible model of a real time series, thus being able to truly predict future observations. It is also obvious from Figure 2 that all equalized times series are able to copy fairly well the course of the actual US import from China. Except for minor exceptions, each can not only capture the trend but even seasonal fluctuations. In order to establish whether networks are applicable or not, we will further examine their use in forecasting. We will predict the US import from China in the period of August 2019 to December 2020. The details are shown in Table 3. It is apparent at first sight that network 2. MLP 3-8-1 gives a senseless prediction of the variable under review. It even shows negative values of import. However, this is not possible in real world. There is a less difference between the others. Therefore, we will use Figure 3 (Time series and forecasting trend) to choose the most successful neural network.  Table 4 provides a summary of neural networks retained from Experiment no. 2 where 5month lag of time series is expected. Source: Own processing.

Experiment 2 (5-month lag of time series)
There are 15 neurons in the output layer with respect to the time series lag. The table shows that neural networks with 4 to 10 neurons in the hidden layer were retained. The hyperbolic tangent function and the logistic function are used by neural networks to activate the hidden layer. The output neuron layer is activated by the exponential function and the identity function. The correlation coefficient is very high for all data sets and all networks, each time above 0.96 which is a high level of direct dependence. This parameter clearly shows that the retained neural structures constitute a highly credible model of real time series, thus being able to truly predict future observations. The sum of least squares was used to establish the error rate. Even the error is acceptable with a view to input data (for all networks and sets). Figure 4 provides a comparison of the actual course of time series and equalized times series. It is also obvious from Figure 4 that all equalized times series are able to copy fairly well the course of the actual US import from China. Except for minor exceptions, each can not only capture the trend but even seasonal fluctuations.
In order to establish whether networks are applicable or not, we will further examine their use in forecasting. We will predict the US import from China in the period of August 2019 to December 2020. The details are shown in Table 5.  The results shown in the table represent a potential trend of the time series. It is warranted to a certain extent by the chart in Figure 5. If the actual trend of US import from China is compared to the expected time trend of the variable predicted by using the artificial neural networks retained from Experiment 2, we conclude (mainly considering the statistics table in Schedule 2) that 5. MLP 15-4-1 network is the best evaluated artificial neural structure.

Experiment 3 (10-month lag of time series)
There were 10,000 artificial neural networks again generated for Experiment no. 3 and five with the best characteristics were retained (more details in Table 6). Source: Own processing.
For this part of experiment, there are 30 neurons in the output layer. The table shows that neural networks with 3 and 4 neurons in the hidden layer were retained. The hyperbolic tangent function is used by neural networks to activate the hidden layer. The output neuron layer is activated by the exponential function and the identity function. Of course, the performance of neural networks is important. It is expressed by a correlation coefficient. The correlation coefficient is very high for all data sets and all networks, each time above 0.96 which is a high level of direct dependence. This parameter clearly shows that the retained neural structures constitute a highly credible model of real time series, thus being able to truly predict future observations. The sum of least squares was used to establish the error rate. In this case too, the error is not significant and good-quality forecasting of time series can be expected. Figure 6 provides a comparison of the actual course of time series and equalized times series.  It is obvious from Figure 6 that all equalized times series are able to copy fairly well the course of actual US import from China and moreover, the course of all equalized time series is very similar. Neural networks are able to capture the trend as well as seasonal fluctuations.
Also in the case of 10-month lag of time series, we will address future predictions of the variable under review. We will predict the US import from China in the period of August 2019 to December 2020. The details are shown in Table 7. As previously mentioned, the forecasts are very similar. It is warranted to a certain extent by the chart in Figure 7.  If the actual trend of US import from China is compared to the expected time trend of the variable predicted by using the artificial neural networks retained from Experiment 3, we conclude (mainly considering the statistics table in Schedule 2) that 5. MLP 30-3-1 network provides the best prediction of future observations.

Discussion of results
Three experiments were conducted in research. The intention was to examine the trend of time series represented by US import from China. In particular, we examined how multilayer perceptron networks are able to equalize time series. In each experiment, 10,000 artificial neural networks were generated. Five best structures were retained from each experiment. All but one from Experiment 1 which clearly suffered from overfitting can be used for prediction of the future US import from China. In each case, the performance of networks was high and the error rate was fairly low. We defined the best network in each experiment and conducted further comparison of this network (more details in Table 8). The differences between neural networks are already presented in Table 8. Although not visible at first sight, the differences mainly between networks selected from Experiment 2 and 3 are not significant. This situation is even better illustrated in Figure 8. A very similar course of all selected neural structures is apparent from the figure. Some differences, although not fundamental are identified in February 2020 and November and December of the same year. However, it should be noted that a very similar output is presented by the networks from Experiment 2 and 3.

Conclusion
The objective of this paper was to forecast the import of the United States of America from the People´s Republic of China using machine learning techniques. It can be concluded that the objective of this paper was achieved: 1. It appears as if multilayer perceptron networks will be a great forecasting tool for US import from China. 2. MLP networks are able to cover both the trend of the entire time series and its seasonal fluctuations. 3. Time-series lag must be applied. Acceptable results are established for 5-and 10-month lag of time series. 4. Mutual sanctions of both countries did not have a significant impact on forecasting using machine learning. Further research should solely be directed to an experiment that would provide information which lag of time series would be the most appropriate for this type of task and this specific variable.