Considering seasonal fluctuations on balancing time series with the use of artificial neural networks when forecasting US imports from the PRC

The paper’s objective is to propose a particular methodology to be used to regard seasonal fluctuations on balancing time series while using artificial neural networks based on the example of imports from the People's Republic of China (PRC) to the USA (US). The difficulty of forecasting the volume of foreign trade is usually given by the limitations of many conventional forecasting models. For the improvement of forecasting it is necessary to propose an approach that would hybridize econometric models and artificial intelligence models. Data for an analysis to be conducted are available on the World Bank website, etc. Information on US imports from the PRC will be used. Each forecast is given by a certain degree of probability which it will be fulfilled with. Although it appeared before the experiment that there was no reason to include the categorical variable to reflect seasonal fluctuations of the USA imports from the PRC, the assumption was not correct. An additional variable, in the form of monthly value measurements, brought greater order and accuracy to the balanced time series.


Introduction
The difficulty of forecasting the volume of foreign trade is usually given by the limitations of many conventional forecasting models. For the improvement of forecasting it is necessary to propose an approach that would hybridize econometric models and artificial intelligence models [1]. The given topic has already been addressed, although not widely, but the example of the USA and China as two dominant economic powers is very interesting.
Export is often seen as a way to increase economic growth. Bernard and Jensen [2] examines the interaction between export the productivity growth in the USA manufacturing. Export involves the redistribution of resources from less efficient facilities into more efficient ones. The overall redistributions are rather large, accounting for more than 40% of the overall productivity growth of the industries in the manufacturing sector. Yu, Dong and Feng [3] state that the key policy of the industry support has resulted in a 0.35% increase compared to import since China´s accession to the WTO, while in the USA this has decreased to 0.35%. With regard to foreign export control, the impact of the key industry´s support policy on China´s trade surplus, indicating that the foreign export control to China has increased the impact of the key industries support on the trade balance.
At the end of 2018, in the first half of 2019, the trade rivalry between the People´s Republic of China and the USA had a significant impact on Chinese ideological and political component, socio-economic, and military development, as well as on the development of its foreign policy. The impact of the "trade war" on the economic development of China still remains slightly negative but the "survival potential" of the country´s economy is quite strong. Coincidentally, China´s "development potential" can suffer considerable losses if the USA continues to maintain a strict restrictive line -not in terms of the tariff-related topics, such as the expansion of Chinese capital into the US market and the access of China to the new American technology market [4]. Given the complexity of the economic system, the interactive effects of the economic variables of factors on Chinese foreign trade make forecasting the state of Chinese foreign trade extremely difficult. In terms of analysing the relationship between the economic variables and foreign trade, this study proposes a new non-linear set of methodology for hybridizing non-linear econometric model and artificial neural networks (ANN) learning in order to forecast Chinese foreign trade. Yu, Wand and Lai [5] create an auto-regression model (EC-VAR) based on the correction of the errors on the basis of co-integration, first used to capture the impacts of economic variables on Chinese foreign market in terms of multidimensional analysis. To capture non-linear patterns hidden between foreign trade and economic factors, the ANN-based EC-VAR model is used. All economic variables, outputs of linear and non-linear EC-VAR models and assessment model are used as other neural networks input for the forecasting purposes. For illustration, the proposed methodology of the set integrating teaching econometric technics and artificial intelligence (AI) methods is applied to the problem of forecasting Chinese export trade.
In order to investigate inefficiency of the market resulting from fast developing software and technological progress all over the world, technology prejudice has been introduced in the foreign Exchange market. The idea of technology distortion arises from the fact that innovative approaches have been used to address business challenges and to find the best business strategies [6]. The situation described above indicates market inefficiency, which casts doubt on the idea of an effective market theory, but is in line with the adaptive market hypothesis [7]. Galeshchuk [8] uses shallow neural network that surpasses a random walk model which confirms the idea of market inefficiency. Zhang [9] finds out that the indicators of GDP, direct foreign investment, and research and development affects Chinese export of goods by means of sensitivity analyses. This method along with the analysis of policy shall be systematically analysed and forecast by Chinese export, thus providing theoretical background for the relevant decision-making departments.
Horák, Šuleř and Vrbka [10] aimed to compare the accuracy of equalizing time series using regression analysis and neural networks on the example of the USA export to Chine. The objective is to show possible application and advantages of using neural networks in practice. The study compares two statistical methods; artificial intelligence is not used in these applications. In many economic sectors, however, better results have been shown. It has been found out that artificial neural networks are able to learn effectively the dependence within time series and between them in the form of export development data [11]. Vrbka, Rowland and Šuleř [12] compare the accuracy of equalizing time series by means of regression analysis and neural networks on the example of the trade balance between the EU and the People´s Republic of China. In general, each forecast is given by certain degree of probability of its fulfilment. Rowland, Šuleř and Vochozka [13] aimed to compare the accuracy of equalizing time series by means of regression analysis and neural networks on the example of the trade balance between the Czech Republic and the People´s Republic of China. They use the data on the trade balance between the Czech Republic and the People´s Republic of China. First, linear regression was carried out, followed by regression using artificial neural networks. The compared both methods at the expert level and the level of the experience of an evaluator, economist. Optically, the LOWESS curve appears to be the most successful from the linear regression, and the fifth retained network (RBF 1-24-1) appears to be a suitable one from the retained neural networks. Neural networks also appear to be a method of optimizing company inventory. They are useful in forecasting time series [14]. Šuleř [15] strives to verify the possibility of using neural networks for inventory management on the example of a concrete company. They are useful for forecasting time series. Chang [16] deals with artificial networks, decision trees, and a hybrid model of ANN and decision trees. The author compares the methods of forecasting stock price derived from the three methods mentioned above. The study has also found that compared to the two methods, ANN is a more stable forecasting method.
Based on non-linear prediction of phase space reconstruction, Weijin and Yuhui [17] presented a model of time lag of a BP neural network, whose generalisation ability had been improved by Baesian regularisation. The model is used to forecast import and export trade within one sector. Compared to conventional evaluation of forecasts, it has been concluded that non-linear forecasting can be focused not only on combining data and improving accuracy but can also reflect non-linear characteristics of the forecasting system.
Zhao et al. [18] examine the impacts of China´s industrial plans for export and trade balance, as well as on how these countries are enlarged by controlling export to China from foreign countries. Empirical results show that China´s political support of the key industries through five-year plans has pad a positive impact on its export and trade balance. Specifically, this key policy of supporting industry has resulted in a 0.35% increase in Chinese export compared to the import since China´s admission to the WTO, while in the USA the increase was only 0.3%. With regard to foreign trade control, the impact of the key industries support policy on China´s surplus decreases, which indicates that foreign controls of export to China have increased the impact of the key industries support policy on the trade balance.

Data and methods
The Data for an analysis to be conducted are available on the World Bank website, etc. Information on US imports from the People's Republic of China (PRC) will be used. A time interval for which the data will be available is the monthly balance beginning January 1985 and ending August 2018, i.e. 404 pieces of input data, with the main unit being billions of US dollars.
Descriptive characteristics of the data are given in Table 1. Source: Own processing.
Certain development of the US imports from the PRC over the course of time is indeed an interesting topic. Figure 1 therefore presents graphically selected statistical characteristics, including a histogram of the input data.  Furthermore, the histogram does not correspond to normal distribution. Data will be processed using DELL Statistica software version 12.
A specific regression using neural structures will be performed. Multilayer perceptron networks and neural networks of a basic radial function will be generated along with two sets of artificial neural networks: 1. Time shall be an independent variable, with the US imports from the PRC being a dependent variable. 2. Time shall be a continuous independent variable. The seasonal fluctuations shall be represented by a categorical variable in the form of a month in which a certain value was measured. Thus, possible monthly seasonality of the time series will be regarded, with the US imports from the PRC being a dependent variable. Next, the time series shall be divided into three sets -training, test and validation. The first group will include 70% of the input data. Based on the training data set, neural structures will be generated. The remaining two data sets will always include 15% of the input information. Both of the groups will serve to verify reliability of a particular neural structure, or model, found. The time series delay shall be 1, and 10,000 neural networks are to be generated. Of these, 5 networks, showing the best characteristics 1 , will be retained. In the hidden layer, there will be at least two neurons, with the maximum being 50. In relation to the radial basic function, there will be at least 21 neurons in the hidden layer, with the maximum being 30. As for the multiple perceptron network, the following distribution functions in the hidden layer and in the output layer shall be considered: The method of least squares is to be applied. Network generating shall be terminated unless there is an improvement, i.e. a decrease, in the sum of the squares. There will therefore be retained those neural structures whose sum of squares of residuals related to the actual development of the US imports from the PRC will be as low as possible -ideally zero).
 Linear,  Logistic,  Atanh,  Exponential,  Sinus. Other settings shall remain as default (according to ANS -Automated Neural Network). As part of conclusion, results of both groups of retained neural networks will be compared.

Neural structures A
Based on the procedure established, 10,000 neural networks were generated. Of these, 5 networks, showing the best parameters, were retained. They are given in Table 2.  There are only neural networks of the basic radial function with only one variable in the input layer -time. In the hidden layer, the neural networks contain 24-28 neurons. Consequently, there is a single neuron in the output layer and a single output variable, i.e. the US imports from the PRC. The RBFT training algorithm was applied to all networks. In addition, all neural structures used the same function, namely the Gaussian curve, to activate the hidden layer of neurons. The same function was used to activate the outer layer of neurons (see Table 2).
Training, test and validation performance is worth mentioning as well. Generally, the goal is to search for a network that performs equally well across all data sets (please note that the data were randomly distributed). Errors should be as small as possible. The performance of individual data sets is given in the form of a correlation coefficient. Values of individual data sets according to specific neural networks are shown in Table 3. The table shows that the performance of all retained neural structures is approximately the same, with slight differences not affecting each network. The correlation coefficient value of all training data sets ranges from more than 0.974 to more than 0.988. The correlation coefficient value of the test data sets reaches more than 0.988 for all neural networks. The correlation coefficient value of the validation data set of all neural networks is above 0.987. In order to select the most suitable neural structure, it is necessary to carry out a closer analysis of the results obtained. Table 4 gives the basic statistical characteristics of each data set for all neural structures.  Ideally, individual statistics of the given neural network are more or less identical across all data sets (minimums, maximums, residues, etc.). As for the balanced time series, however, the differences are minimal, and slightly larger differences are reflected in the residue characteristics. Yet, it is not possible to clearly determine which of the retained neural networks shows the best results. Figure 2 illustrates a line chart representing the actual development of the US imports from the PRC, as well as particular development of forecasts by each generated and retained network.
The graph shows that forecasting of all neural networks related to the imports' development is slightly different at individual intervals. What is important, however, is not the similarity of forecasts of individual networks, but the similarity (or a degree of consistency) to the actual development of the US imports from the PRC. In that respect, it may also be stated that all retained neural networks are worth noting. They respect guidelines of the curve assessing the development of the imports, and, at the same time, tend to (albeit not exactly) perceive extremes of the curve. Source: Own processing.

Neural structures B
Based on the procedure established, additional 10,000 neural networks were generated. Of these, 5 networks, again showing the best parameters, were retained. They are given in Table  5. Source: Own processing.
There are only multilayer perceptron networks. In the input layer, there are two variables -time (a continuous variable) and a month of measurement (as a categorical variable). Time is represented by one neuron in the input layer, whereas months are represented by twelve neurons. In the hidden layer, the neural networks contain 8-16 neurons. In the output layer, there is a single neuron and a single output variable, i.e. the US imports from the PRC. For all networks, the Quasi-Newton training algorithm was applied (yet always in a different variant). Neural structures used a single function, i.e. the logistic function, to activate the hidden layer of neurons. To activate the outer layer of neurons, the exponential function and the logistic function are used (see Table 5). All retained neural structures used the sum of the least squares as an error function. Performance values, or correlation coefficients of individual data sets by particular neural networks, are given in Table 6. As may be gathered from the above table, the performance of all retained neural structures is approximately the same, and slight differences do not affect each network. The correlation coefficient value of all training data sets ranges from more than 0.992 to more than 0.994. The correlation coefficient value of the test data sets reaches more than 0.994 for all neural networks. The correlation coefficient of the validation data set of all neural networks is above 0.992. In order to select the most suitable neural structure, the obtained results need to be analyzed more closely. Table 7 provides basic statistical characteristics of each data set for all neural structures. Source: Own processing.
Ideally, individual statistics of the given neural network coincide across all sets (minimums, maximums, residues, etc.). As for the balanced time series, however, the differences are minimal. Essentially, there are minimal differences in residue characteristics as well. Nonetheless, it is not possible to clearly determine which of the retained neural networks shows the best results. According to Table 4, this may involve 3.MLP 13-8-1 and 4.MLP 13-9-13 networks. Figure 3 is a line chart representing the actual development of the US imports from the PRC, as well as particular forecasts by each generated and retained network. The graph shows that all neural networks forecast the development of the imports in a very similar way. At the same time, the balanced time series´ shape is very similar to the imports' actual development. All retained neural networks are again worth noting. They all forecast not only the basic direction in the development of the imports, but can also forecast local minimums and maximums. It may be seen from the above figure that all retained multilayer perceptron networks are usable.

Comparison of A and B results
All generated and retained artificial neural networks were able to match the discussed time series -the US imports from the PRC. Having compared the correlation coefficients (Tables  3 and 6), one may observe higher performance in relation to the B variant, i.e. retained MLP networks (when an additional categorical variable is included). This is also reflected in the evaluation of basic statistics of the forecasts, balanced time series and in Tables 4 and 7. The MLP networks, or their balanced time series, show less differences in the training, test and validation data sets than in the RBF networks (without an additional variable). The aforementioned is eventually confirmed by Figures 2 and 3. It is clear that only the MLP networks in the B variant are able to capture the time series according to its actual direction. All retained perceptron networks can cover the entire course of the US imports from the PRC and are applicable to forecasting the variable´s future development.

Conclusion
The objective of this paper was to propose a methodology for considering seasonal fluctuations on balancing time series by the means of artificial neural networks on the example of US imports from the People's Republic of China. Generally, it follows that each forecast is given by a certain degree of probability which it will be fulfilled with. When forecasting future development of a certain variable, there is an attempt to estimate the variable´s development on the basis of data from previous periods under review. Although one can include most factors affecting the target variable into a given model, there is always a simplification of reality and a certain degree of probability that any scenario forecast will be fulfilled [19].
In the paper, a particular application of the same instrument with different initial assignments was compared. Although it appeared before the experiment that there was no reason to include the categorical variable to reflect seasonal fluctuations of the US imports from the PRC, the assumption was not correct. An additional variable, in the form of monthly value measurements, brought greater order and accuracy to the balanced time series.
It may be argued that the above imports may be determined on the basis of statistical, causal and intuitive methods, with the statistical methods being compared here. However, they provided only a possible framework for the development of the observed variable. Subsequently, it is important to work with information related to possible future development of the economic, political or legal environment. If one is able to forecast such development, it may then be projected into the monitored variable. At the same time, however, comes a standpoint of an evaluator -an economist, who, on the basis of his/her knowledge and experience, corrects prices determined by the framework statistical methods and specified on the basis of causal links. In this case, however, it seems possible to test forecasting only with the use of the B variant that brings a relatively high degree of accuracy. It may be stated that all retained perceptron networks are usable.
The paper´s objective was fulfilled.