Forecasting trade balance of Czech Republic and People ́s Republic of China in equalizing time series and considering seasonal fluctuations

The objective of the contribution is to introduce a methodology for considering seasonal fluctuations in equalizing time series using artificial neural networks on the example of the Czech Republic and the People ́s Republic of China trade balance. The data available is the data on monthly balance for the period between January 2000 and July 2018, that is, 223 input data. The unit is Euro. The data for the analysis are available on the World Bank web pages etc. Regression analysis is carried out using artificial neural networks. There are two types on neural networks generated, multilayer perceptron networks (MLP) and radial basis function networks (RBF). In order to achieve the optimal result, two sets of neural structures are generated. There are generated a total of 10,000 neural structures, out of which only 5 with the best characteristics are retained. Finally, the results of both groups of retained neural networks are compared. The contribution this paper brings is the involvement of variables that are able to forecast a possible seasonal fluctuation in the time series development when using artificial neural networks. Moreover, neural networks have been identified that achieve slightly better results than other networks, specifically these are the neural networks 1. MLP 13-6-1 and 3. MLP 13-8-1.


Introduction
Exchange equalization of a nation is the net whole of a nation's exports and imports of products without considering every single budgetary exchange, ventures and other money related parts. On one hand, when a nation's exchange equalization is in positive implies that it enlists an excess if the estimation of export surpasses the estimation of imports. On the other hand, a nation's exchange parity is negative, or registers a shortfall, if the estimation of imports surpasses that of exports. Hence the term trade balance is the official term that is realistic for net exports in the account record.
Czech Republic (CR) and the People's Republic of China (PRC) are seriously involved in international trade. According to Koszek [1], Chinese trade relation is at highest level in Czech Republic. CR exports mainly manufactured goods that are used in production of furniture, electrical appliances, and automobiles and imports raw materials, fuel and chemicals, and machinery and transportation equipment.
The big question to ask is the trade between CR and PRC healthy? This review hopes to answer the research question and to pinpoint trade balance prediction methods while equalizing time series and taking into account seasonal fluctuation.

Review of related literature
Rowland, Šuleř and Vochozka [2], compared accuracy of time series by means of regression analysis and neural networks using trade balance data between CR and PRC in a certain period. They used statistical methods which gave them a basis to determine trade balance of the two countries. Although their findings cannot be generalized due to the fact that the ignore variables which often have important effect on trade balance forecasting, their findings are applicable in forecasting short term trade balance. Vrbka, Rowland and Šuleř [3] again explored the topic from a broader perspective and put forward that China´s focal business partner is the EU and CR is a member country of the union, which means that China import in the union is large. Export and import data between the two business partners have been utilized by researchers using regression and neural network models to predict future development of trade balance while taking into account seasonal fluctuation. The outcome evidently shows that trade balance between the two partners have amplified over the years.
Evans [4] projected that variations in external positions of most countries reflect changing expectations about trade conditions far into the future. Established is that the changing forecast for the future path of the world stochastic markdown factor are mirrored in the dynamics of the U.S. external position.
Garlick [5], recommended that regardless of diversities in Central and East European (CEE) countries, there is a need to coordinate instead of contend concerning trade with China because they are all struggling with trade balance shortfalls with the Chinese. Matura [6], lamented on China-CEE investment goals and stated that China is using the CEE countries to gain political influence in the EU for economic reliefs. The rising collaboration of the Chinese and CEE nations including CR has spawned far-reaching criticism by other western nations who thinks that it not a healthy relation. However, Šteinbuka, Muravska and Kuznieks [7] concluded that China-CEE cooperation does not contradict the EU investment plan, and that none of the two parties is aiming to abate the union. They believed that the EU to which CR belong and China have a great interest in each other's top development plans. The Silk Road Economic Belt and 21st-Century Maritime Silk Road Initiatives and the Investment Plan for EU are complementing each other.
CR has prevailed regards to building its economy by maintaining the Czech Koruna (CZK). Nonetheless, PRC runs a big trade surplus with CR. Chinese imports into the CR are large and over the years, there is a drop in Czech companies with comparative benefit [8].
From the literature reviewed it can be perceived that CR will undoubtable experience proceeding trade imbalance with China. However, geographical trade concentration in China is expected to relax in the future. Rapid economic growth and trade surpluses enables China to amass capital and prompted expanding capital streams abroad from Chinese firms [9]. Chinese investment increase greatly in the EU during the economic crisis in 2008. During this period, Chinese investors invested heavily in the member countries thereby helping to savage the economic gap, which was as a result of a decrease in domestic investment [10]. The 2008 crunch help widened the trade balance between CR and PRC. Pikhart [11], Patterned change of external balance of trade give a valuable device for assessment of the sustainability of trade development and subsequently help to analyze time series and predict future advancement.
Bayesian method has been used by other researchers to estimate a sign restricted structural vector autoregressive model with quarterly time series data. Updating is particularly important for dynamic analysis. Result from such research demonstrate that asset prices have direct impact on trade balance. It is confirmed so far when exchange rate appreciate trade balance depreciates [12].
While there are a wide range of trade balance prediction methods; autoregressive moving average (ARMA), autoregressive integrated moving average (ARIMA), multiple linear regression (MLR), and artificial neural network (ANN) are frequently used tools in predicting trade balance. In recent years, ANN have proven to be more accurate because it can deal with non-linear problems and has higher prediction accuracy rate in empirical research [13]. Similarly, time series data can effectively increase the accuracy of trade balance prediction. However, the accuracy of prediction methods depends on design of the method itself [14].
CR-PRC trade has tremendously grown to the detriment of CR. Czech local firms export to China is very low while imports from PRC is at a record high.
China had been adopting a conservative policy toward trade balance. China have accumulated surplus in many periods while CR ran a deficit. This is as a result of China exporting more to CR instead of the other way round.
Nowadays, the modernization of china means more imports from developed countries, which tends to widen the trade gap. Due to its location and moderately cheap and high quality work force, economic growth and political stability CR has a benefiting advantage over the other EU countries, especially in the most recent two decades. Chinese value added goods are process in CR in other to easily reach EU western market. China´s economy is the second largest in the world which makes them significant actors in economic global relations [15].
CR and PRC have benefited from a well-established formal relation. The long time relations have led to the signing of trade agreement in 2010 for thorough economic improvement between the two allies. CR has an open economy framework and it fused into the EU financial outline. CR economy is strongly influenced by innovation and for the most part relies on remote capital joined with a defenseless capacity to hold it and the low conveyed cost [16].
Seasonal fluctuation of time series data enhance researchers to understand trade balance behavior in the past so that the patterns could be helpful for future predictions. However, conclusions made from analyzing time series is not always perfect, and factors that affect seasonal fluctuations of a time series cannot be fully adjusted by the time series analysis [17].
ARMA, ARIMA, MLR, ANN are trade balance prediction methods. Although, ANN is proven to be more suitable and accurate for predicting trade balance using time series data.
The need for a healthier reciprocated balance economic cooperation can be beneficial for the two sides as long as the two allies stop misappropriation of public funds, offset unfortunate behavior in property rights, link social vacancies and manage turn over [18].
The need for further research on the topic is essential. Forecast of trade balance of the Czech Republic and the People's Republic of China while equalizing time series and taking into account seasonal fluctuation can be used to understand the past as well as predict the future trade balance of the two parties.

Data and methods
For the purposes of the contribution, the data on the trade balance between the Czech Republic and the People´s Republic of China. The focus will be on the difference between the overall export and import between both countries from the point of view of the Czech Republic. The data available will be the data on monthly balance for the period between January 2000 and July 2018, that is, 223 input data. The unit will be Euro. The data for the analysis are available on the World Bank web pages [19], etc.  Table 1 shows descriptive characteristics of the data. Source: Own processing.
The development of the trade balance over time is very interesting. Therefore, Figure 1 is used to show selected statistical characteristics in a graphical form including the histogram of the input data.  The histogram corresponds to normal division. The data will be processed using DELL´s Statistica software, version 12. Regression analysis will be carried out using artificial neural networks. There will be two types on neural networks generated, multilayer perceptron networks (MLP) and radial basis function networks (RBF). In order to achieve the optimal result, two sets of neural structures will be generated: 1. The dependent variable will be trade balance of the Czech Republic and the People´s Republic of China, while the independent variable will be time. 2. The dependent variable will be trade balance of the Czech Republic and the People´s Republic of China. The categorical variable will be represented by a seasonal fluctuation in the form of the month in which the value was measured. The continuous variable will be time. Within this approach, it will be possible to work with a monthly seasonality of the time series. Working with data sets will be analogous. The time series will be divided into three sets: training, which will be used for generating neural networks and will contain 70 % of the input data; testing, which will be used to verify the reliability of the neural network (model) found and it will contain 15 % of the input data; validation, which will be used for the same purpose as the testing data set and will also contain 15 of the input data. The delay of the time series will be 1. There will be generated a total of 10,000 neural structures, out of which only 5 with the best characteristics will be retained. For this purpose, the least squares method will be used. Networks generating will be finished when there is no improvement, that is, if the value of the sum of the squares does not decrease. Only the neural networks whose sum of the squares to the actual development of the Czech Republic and the People´s Republic of China trade balance is as low as possible (zero in ideal case) will be retained. The hidden layer of the MLP networks will contain not fewer than 2 and not more than 50 neurons. The RBF networks will contain at least 21 and a maximum of 30 neurons in the hidden layer. In the hidden and output layers, the following distribution functions will be considered: linear, logistic, atanh, exponential, and sinus. Other settings will remain according to the setting of the ANN (automated neural networks) tool. Finally, the results of both groups of retained neural networks will be compared.

Neural networks A
In accordance with the methodology, a total of 10,000 neural networks will be generated, out of which 5 with the best parameters will be retained. Table 2 shows the overview of the retained neural networks including their performance and further information. As the table clearly shows, only the RBF contain one variable (time) in the input layer. The hidden layers contain between 22 and 30 neurons, while the output layers contain only one variable, the Czech Republic and the People´s Republic of China trade balance. For all retained networks, the same RBFT training algorithm was used, as well as the same error function (the sum of the least squares). Similarly, as the output layer activation function, the Gaussian curve was used. The output activation function was also the same for all retained network, it was the Identity function.
Generally, the focus shall be on the training, testing and validation performance of the individual retained networks. We are looking for a network whose performance in all data sets is ideally the same, and the error is as small as possible. It shall be noted that the division of the data into data sets was random. The performance of these data sets is given in the form of the correlation coefficient. Therefore, Table 3 shows the values of the individual data sets by the specific retained neural networks. Source: Own processing.
The table indicates that the performance of all retained neural networks is very similar. The slight differences do not have any significant influence on the networks performance. In the case of the training data set, the correlation coefficients values are between 0.89 and 0.94, in the case of testing data set, the range is slightly wider, with networks achieving the values between 0.85 and 0.94. The coefficients of the validation data set have the smallest range, achieving the values of about 0.95. However, it is clear that the second retained neural network, RBF 1-24-1, achieve the worst correlation coefficients. The best and constant results in all data sets are achieved in the case of the first retained network, RBF 1-22-1. However, in order to choose the most suitable retained network, it is necessary to carry out a more detailed analysis of the results obtained. The basic statistical characteristics of the individual data sets for all retained neural networks are listed in Table 4.  Source: Own processing.
In ideal case, the individual characteristics of the neural network should be horizontally the same in all data sets. This refers to the minimal and maximal forecasts, minimal and maximal residuals, and minimal and maximal standard residuals. As for the equalized time series, there are minimal differences only. The differences are bigger in the case of the residuals characteristics. However, even based on this information, it is not possible to determine unambiguously which of the retained structures achieves the best results. Therefore, Figure 2 was used to show a line graph representing the actual development of the Czech Republic and the People´s Republic of China trade balance and also the forecasts made using individual generated and retained networks.  As can be seen from the graph, the retained neural networks forecasts of the trade balance development are partially different at the individual intervals. However, what is important at the moment is not the similarity between the individual networks forecasts but their similarity (consistency) with the actual development of the Czech Republic and People´s Republic of China trade balance. In this respect, all networks appear to be interesting, following the curve assessing the trade balance development, but at the same time they are often able to capture the local minimum and maximum, that is, the extremes of the curve. The best neural network appears to be the first retained network, RBF 1-22-1.

Neural networks B
Based on the methodology mentioned above, the second set of 10,000 neural networks was generated, out of which 5 with the best characteristics were retained. Table 5 shows the overview of the retained networks. As the table clearly shows, the networks are only multilayer perceptron networks. The input layer contains only two variables -continuous variable (time) and categorical variable (the month of measurement). The continuous variable is represented by one neuron, while the categorical variable by twelve neurons. Logically, the input layer of all networks contains 13 neurons. The hidden layer of each retained network contains a different number of neurons -between 3 and 9 neurons. The output layer of all retained networks contains one neuron, that is, one output variable -the Czech Republic and the People´s Republic of China trade balance. All retained networks use the same alternative of the Quasi-Newton training algorithm. All networks also use the same error function -the sum of the least squares. For the activation of the hidden layers, the retained networks use the Identity function in 4 cases, and the sinus function in one case. As the output activation function, three networks used the function of hyperbolic tangent, one the sinus function and one the logistic function. The values of the individual data sets, that is, the correlation coefficient by the specific neural networks are given in Table 6. Source: Own processing.
The table indicates that the performance of all retained networks is very similar. The differences are not big, and therefore do not have any influence on the retained networks performance. In the case of the training data set, the value of the correlation coefficient ranges between 0.87-0.88, as in the case of the validation data set. The correlation coefficients of the testing data set achieve the value of up to 0.948. All correlation coefficients achieve relatively high values and are similar to each other in the individual data sets. Next step can thus follow, that is, selection of the most suitable neural structure. In order to find the most suitable one, it is necessary to carry out a detailed analysis of the results obtained. Table 7 shows the basic statistical characteristics of the data sets for all retained neural structures.  Source: Own processing.
As for the individual data sets statistics, it is desirable that the individual statistics conformed to each other in all data sets (minimum, maximum, residuals, etc.). In the case of equalized time series, there have been minimal differences detected in minimal and maximal forecasts, minimal and maximal residuals, and standard residuals. Despite this detailed specification, it is not possible to determine unambiguously, which of the retained networks achieves the best results.
For illustrative purposes and determining which of the retained networks shows the best results, Figure 3 shows a line graph representing the actual development of the Czech Republic and the People´s Republic of China trade balance, together with the development of forecasts using individual retained neural networks.  However, what is important is not the similarity of the individual forecasts but the extent to which they correspond with the actual development of the trade balance (represented by blue curve). Even in this case, it can be stated that the retained networks appear to be interesting. They are able to forecast the basic trend of the trade balance development very well, but very often, they are also able to capture the local extremes -minimum and maximum. A closer look indicates that mainly two networks are applicable: the 1st retained network 1. MLP 13-6-1 and the 3rd retained network 3. MLP 13-8-1. Nevertheless, as it has already been mentioned, all networks performance and forecasting ability are very similar and can be used in practice.

Comparison of results of neural networks A and B
The examined time series, the Czech Republic and the People´s Republic of China trade balance, could be equalized by all generated and retained neural networks.
The results are very interesting. Based on the individual networks performance, it shall be stated that the RBF networks show significantly better results than the MLP networks. Specifically, it is the training and validation data sets performance. The performance of both neural networks data sets are the same in terms of the testing data set. However, the values do not clearly correspond to the graphical representation of the equalized time series course. From the course of the actual time series (marked blue in Figure 2 and Figure 3)  balance quite well. However, they achieve worse performance in the training and validation data sets, at least in terms of the correlation coefficient. Basically, there are two reasons identified. Firstly, it can be due to inappropriate division of the original data set into the training, testing and validation data sets in the case of the MLP networks. Secondly, it can be due to distortion caused by division of the residuals of both data sets. As for dividing the data into the individual data sets, it shall be noted that the division was random -as a random sample. Although the author´s conscious or unconscious preferences were not reflected in the division, there is still a possibility that the data set used for the training of the MLP networks had been created incorrectly, unbalanced. All RBF networks were generated on the same data sets -training, testing, and validation. Thus, they show approximately the same results (at a large number of iterations). The MLP networks were also generated on the same data sets, but different from the data sets used for the RBF networks.
Regarding the division of the residuals, this could also be caused accidentally. However, even such a situation may occur.
On the other hand, it is obvious that the MLP networks capture the course of the time series better. Therefore, it must be concluded that the MLP networks captured the seasonal fluctuations of the time series (which are obvious), thus actually achieving much better results that the RBF networks. The most suitable structure is therefore supposed to be found among the MLP networks according to the performance and errors of the individual neural networks. As stated above, two retained MLP networks show slightly better performance than the others -1. MLP 13-6-1 and 3. MLP 13-8-1.

Conclusion
The objective of the contribution was to introduce a methodology for considering seasonal fluctuations in equalizing time series using artificial neural networks on the example of the Czech Republic and the People´s Republic of China trade balance.
Forecasting based on the past data always means understanding past events, their simplification and subsequent application of the simplified model for the purpose of future development. This means the view to the future is also simplified. However, it is essential in many cases to be able to forecast at least the approximate development trend [20]. This way it is possible to make plans, to implement business plans at reduced risk.
Forecasting definitely does not offer an opportunity to forecast the occurrence of extraordinary situations. The method is therefore suitable for planning for days. The contribution this paper brings is the involvement of variables that are able to forecast a possible seasonal fluctuation in the time series development when using artificial neural networks. It was involvement of the variables at the level of time, which was not seen as a continuous but categorical variable, specifically year, month, and day when we tried to identify seasonal fluctuations in the individual years and months. In this case, the classification was sufficient to capture the development of the time series examined -the CR and the PRC trade balance. The analysis can be simple explained by the fact that the continuous variable "date" was able to equalize time series, while the categorical variables corrected this time series according to the seasonal fluctuations identified. For future forecasts it is therefore very important to work with the time series delay. This way we would be able to find out the network optimal performance for future period -the network predictive power would increase. However, it should be noted that in such a case, the demand for computing performance in neural network training would be higher. Each delay means several extra neurons in the input layer for each variable (one in the case of continuous variable, in the case of categorical variable up to the maximum values possible). However, this is a subject of possible further investigation. In any case, there have been obtained neural networks which are able to "understand" the seasonal fluctuations in equalizing time series. Moreover, neural networks have been identified that achieve slightly better results than other networks, specifically these are the neural networks 1. MLP 13-6-1 and 3. MLP 13-8-1.
The objective of the contribution has been achieved.