Comparison of neural networks and regression time series in estimating the development of the EU and the PRC trade balance

China, by GDP, is the second largest economic power, and hence also a key player in the field of international relations. As far as the EU is concerned, it is China's largest trading partner. From this point of view, it is clear that monitoring export and import development between these partners is essential. This paper therefore aims to compare two useful methods, namely the accuracy of time series alignment through regression analysis and artificial neural networks, to assess the evolution of the EU and the People's Republic of China trade balance. Data on the export and import trends of these two partners since 2000 have been used, and it is clear that the trade balance was completely different that year than it is now. The development over time is interesting. The most appropriate curve is selected from the linear regression, and from the neural networks three useful neural structures are selected. We also look at the prediction of future developments while taking into account seasonal fluctuations.


Introduction
Balance of payments is the payment value of all economic transactions between the country and other countries over a period, usually a calendar year. The balance of payments is made up of export and import transactions of goods and services, the movement of investment resources, gifts and transfers of money or gold [1]. The balance of payments is in the form of an account where credit and debit items are recorded. In the case of surplus exports, the trade balance is an asset, otherwise it is a liability. This is related to the balance of payments balance, which tracks the difference between export and import on the current account [2].
China is with its GDP the second largest economic power and the key player in the field of international relations [3]. On the development of the Chinese economy we can see progress in transforming the low-cost economy into innovation and high-tech products [4]. The first trade relations of the European Union with China were established in 1975. The Trade and Economic Cooperation Agreement, which includes three basic principles of Source: [10].
Taking into account the diversity of the sector in which the European Union and China are linked, we can expect a positive development of cooperation, but we should not forget the dangerous factors [11]. These factors can be included, for example, in cybernetics, and in particular their security. Cyber security is today a concept that employs all three of the largest trading partners, China, the European Union and the United States. International trade in the future will also affect relations between China and the United States, whose relations are still not politically stable. Another risk, which could be negatively affected, is the problem of dumping. The European Union is now addressing sixteen cases of likely imports of goods below the market price. China is facing a problem of large distribution at the expense of efficiency of one industry. China's economic growth carries various risks. In addition to the internal ones, it is mainly the fact that the economies of the EU countries that have failed to adapt to the effects of the financial crisis can only keep exports, of which a significant proportion goes to China [12]. Given that Chinese quality and technical level of production are rising, commitments on the EU's current account balance of payments are deepened by mutual commercial relationships, which negatively affects the unemployment rate and government debt. Thanks to acquisitions, China is buying the know-how of EU companies, thus gradually taking over its own export markets. In this way, businesses are losing their competitiveness, and economic risk is rising [13]. The European-Chinese market can certainly offer us much more, the question is whether China will realize its priorities and effectively transform them into satisfaction for both parties.

Data and methods
Data for analysis is available on the website of the World Bank etc. For the analysis, trade balance data between the EU and the People's Republic of China (hereinafter referred to as the PRC) will be used. This will be the difference between total exports and imports between the two trading partners from the EU perspective. The time period for which the data will be available is the monthly balance starting from January 2000 and ending in July 2018. This is about 223 input data. The unit is the Euro.
The descriptive characteristics of the data are given in Table 2. Interesting, of course, is price development over time. Figure 1 therefore shows the selected statistical characteristics in graphical form, including the histogram of the input data. https://doi.org/10.1051/shsconf/20196101031 IES2018 For data processing, DELL's Statistica version 12 will be used. First, a linear regression will be performed. Afterwards, neural networks will be used for regression.
Linear regression will be performed on the monitored data sample for the following functions:  Linear,  Polynomial,  Logarithmic,  Exponential,  Multiparameter of weighed distances,  Multiparameter negative-exponential smoothing. First, the correlation coefficient, i.e. the dependence of trade balance on time, will be calculated. Next, we will work with a level of significance of 0.95. Then regression will be performed using neural structures. We will generate multilayer perceptron networks and neural networks of basic radial functions. Time will be the independent variable. We will determine the trade balance between the EU and the PRC as the dependent variable. We divide the time series into three setstraining, testing, and validation. The first group will have 70% of input data. Based on the training set of data, we generate neural structures. In the remaining two sets of data, we always leave 15% of the input information. Both groups will serve us to verify the reliability of the found neural structure, or the found model. The delay of the time series will be 1. We will generate 10,000 neural networks. We will preserve 5 of them with the best characteristics † . In the † We will be orientated using the smallest square method. We will terminate network generation if there is no improvement, i.e. to reduce the sum of squares. Thus, we will preserve those neural SHS Web of Conferences 61, 01031 (2019) https://doi.org/10.1051/shsconf/20196101031 IES2018 hidden layer, we will have at least two neurons, at most 50. In the case of the radial basic function, there will be at least 21 neurons in the hidden layer, at most 30. For the multiple perceptron network we will consider these distribution functions in the hidden layer and in the output layer:  Linear,  Logistic,  Atanh,  Exponential,  Sinus. Other settings are left by default (using the ANS toolautomated neural network).
In conclusion, we compare the results of linear regression and regression using neural networks. Comparison will not take place in the form of residue analysis (minimum, maximum values, spread of residues, etc.), but at expert level and experience of the assessor, economist.

Linear regression
The correlation coefficient is -0.7668, which represents a significant statistical indirect dependence of the trade balance on the development over time. The determination coefficient reaches 0.9001.
A point graph was constructed (see Figure 2), where the points were intersected by a regression curve, in this case linear. The line parameters are shown in the figure. The solid line represents the regression function structures whose sum of squares of residue to the actual EU and PRC trade balance will be as low as possible (ideally zero). The polynomial function better outlines the trade balance developments between the EU and the PRC than is the case with the linear function. Figure 4 shows a point graph intersected by a logarithmic function. Due to the shape of the curve and the location of individual points in the graph, it is obvious that the logarithmic function rather copies the linear function and is not suitable for the regression and will not estimate the evolution of the EU and the PRC trade balance optimally. Regression is calculated for such a curve at partial intervals. The LOWESS curve aligns the time series and monitors its trend appropriately. LOWESS curve intersection looks very interesting. It can fairly reveal the trend of the trade balance of the partner countries. Figure 6 provides a point graph of the EU and PRC trade balance, intersected by smallest squares of weighed distances function. The curve fairly well copies the development of the trade balance over its entire interval. However, we must state that in detail, the curve is less accurate than the previous LOWESS curve. Figure 7 provides the intersection of the function obtained by smallest squares of negative-exponential smoothing. Even this curve appears to be interesting and appropriate for a possible prediction. As noted above, the correlation coefficient indicates a significant statistical indirect dependence of the target variable on development over time. Nevertheless, it is very distant from the value of -1. If we only evaluated the results by comparing the development of the trade balance between the EU and the PRC and the shape of the regression curve while taking into account a simple linear regression, we could certainly say that the LOWESS curve is closest to the development. This follows curves obtained by the smallest squares method, namely negative-exponential smoothing and weighed distances. All three copy the basic development of trade balance between the EU and the PRC.

Neural structures
Based on the established procedure, 10,000 neural networks were generated. Five networks have been preserved, the ones showing the best parameters. Their overview is given in Table 3.  These are only the neural networks of the basic radial function. The input layer has only one variable -time. In the hidden layer, neural networks contain from 24 to 29 neurons. In the output layer, we have a single neuron and the only output variable is the export balance of the EU and the PRC. For all networks, the RBFT training algorithm was applied. In addition, all neural structures used the same function to activate the hidden layer of neurons, namely the Gaussian curve. They also use the same function to activate the outer layer of neurons, and this function is identity (see Table 3).
Training, testing and validation performance is also interesting. In general, we are looking for a network that has the same performance in all sets of data (we remind that the data was randomly distributed). The error should be as small as possible.
Ideally, the individual statistics of the neural network are cross-sectional in all sets (minimum, maximum, residue, etc.). However, in the case of aligned time series, the differences are minimal. Therefore, we are not able to clearly identify which of the preserved neural networks has the most appropriate results. Figure 8 is a graph showing the real trade balance between the EU and the PRC, as well as the development of predictions using individual generated and preserved networks.
The graph shows that all neural networks predict the trade balance at different intervals slightly differently. However, the similarity between predictions of individual networks is not important, but the similarity (or degree of consistency) with actual trade balance developments is. Based on the optical comparison of the curves, we can say that the RBR 1-24-1 and RBF 1-29-1 networks show at certain intervals weaker results than the remaining three preserved neural networks. The networks 2. RBF 1-29-1, 3. RBF 1-29-1, and 5. RBF 1-29-1 respects the curve guidelines that assess the development of the trade balance and at the same time tend to perceive the extremes of this curve.

Conclusion
The aim of the paper was to compare the accuracy of time series alignment using 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 prediction is given by a certain degree of probability with which it is to be fulfilled. As we predict the future development of any variable, we try to estimate the future development of this variable on the basis of previous years' data. Although we can include most of the factors influencing the target variable in the model, we always simplify reality, and we always work with a certain degree of probability that some of the predicted scenarios will be fulfilled. It is only a mathematical variable that evaluates the relationship of two or more variables that were generated in the past. And we are trying to predict future developments in accordance with past developments. As with linear regression, as well as regression using neural networks, there is simplificationand quite substantial. We only work with two variablesinput (time) and output (trade balance EU X PRC). So, we completely ignore other input variables, which often have a significant impact on the trade balance between the EU and the PRC (international political situation, taxation in both countries, production factor prices, state export support and many others). However it is still true that we estimate aggregated variables better than the partial ones. For some analyses, we can use regression results using neural networks that show a higher degree of accuracy. This may be trend-setting for estimating industry development for the need for individual business valuation, etc.
At the same time, we can state that due to the great simplification of reality, it is not possible to predict the emergence of extraordinary situations and their impact on the EU and PRC trade balance (perhaps in the short term, yes, but certainly not long term). Ideal would be a prediction for the next few days, but for such a short prediction it is currently not possible to obtain data.  The trade balance of both countries can be determined on the basis of statistical methods, causal methods and intuitive methods. In this case, we have been comparing statistical methods. However, they only gave us a possible framework for the development of the monitored variable. It is important to work with information on the possible future development of the economic, political or legal environment. If we can predict their development, we can then project it into the monitored trade balance. At the same time, however, the personality of the evaluator comes into play -an economist who, on the basis of his knowledge and experience, corrects the price determined by the statistical methods and specified on the basis of causal links.
Optically, the LOWESS curve was the best out of linear regression, followed by the smallest squares curve by negative-exponential smoothing, and the curve obtained by the smallest square-weighed distance. Of the neuronal networks, three of the five preserved neural structures proved to be usable in practice: 2. RBF 1-29-1, 3. RBF 1-29-1 and 5. RBF 1-29-1. If we look at the performance from a correlation coefficient point of view, only three of the neural networks listed here are left to be used, of which there is practically no difference.
The aim of the paper was fulfilled. Given the real trade balance between the EU and the PRC, it is advisable to predict future developments while taking into account seasonal fluctuations.