The Ukraine and EU trade balance: prediction via various models of time series

. This article is the first to study, simulate and forecast the monthly dynamics of the trade balance between Ukraine and the European Union for the period from 2005 to 2019. In the presented work, three types of models were used for modeling and forecasting: Automated Neural Networks, additive models ARIMA *ARIMAS (Autoregressive integrated moving average with season component) and Holts model with a damped trend. When modeling using the Automated Neural Networks module, various ensembles of networks and neuron activation functions in hidden layers were used. It turned out that Automated Neural Networks have poor prognostic ability (as in the case considered by us, when modeling insufficiently long series of dynamics). Therefore, when modeling and forecasting the dynamics of the Ukraine-EU trade balance, classical (so-called Box-Jenkins) time series models were used. In this case, the time series is divided into several components (in our case, terms): the main trend is the trend, the seasonal component and the random component (the so-called white noise). By smoothing the initial series, a trend was found, and an analysis of the autocorrelation functions revealed a one-year seasonality. Eliminating the trend and the seasonal component, we obtained a random component, which has a Gaussian distribution. This made it possible to apply first the ARIMA* ARIMAS additive model, and then the Holt model of exponential smoothing with a damped trend. Adequate models of Ukraine-EU trade balance dynamics have been obtained, according to which the forecast has been made. A comparative analysis of the models used. The best model was chosen for forecasting, which allowed to get a good forecast (in comparison with actual data).


Introduction
In recent years, international trade has begun to attract the close attention of many scientists. Among recent works, we note publication [1], which explores the dynamics of the trade balance between the EU and China. At the same time, Ukrainian scientists mainly investigate the international trade of Ukraine as a whole, not highlighting its export-import operations with the EU. Note article [2], in which an attempt is made on the basis of annual statistical data for the period 2010-2017 years to conduct a correlation and regression analysis of the export of goods and services of Ukraine. A factor was included as one of the predictors in the model -time, and it turned out to be the most significant. Economists around the world have always paid close attention to the study, modeling and forecasting of the dynamics of economic processes. A particularly rapid development of modeling and forecasting using time series models began after the release of the classic Box-Jenkins book [3]. Note that these methods have not lost relevance at present. So in the works [4,5], the Box-Jenkins models were used to model and predict the dynamics of unemployment. And in the work [6], Box-Jenkins models were compared with Automated Neural Networks when modeling the dynamics of Czech GDP. Examples of the application of various models of time series are described in the book [7]. The subject of this work is the study of the dynamics of trade relations between Ukraine and the EU countries. The relevance of this study is indisputable, since the EU has become the largest trading partner of Ukraine in recent years.

Materials and methods
Data for analysis is available on the website of the State Statistics Service of Ukraine [8]. The time period for which the data will be available is the monthly balance (as the difference between total export and imports between the Ukraine and the EU) starting from January 2005 and ending in March 2019. This is about 171 input data. The unit is the $ million. Preliminary data processing was carried out in MS Excel spreadsheets. When modeling and computing was used DELL STATISTICA software, version 12.

Neural networks
When searching for the best model of the neural network, the "Automated Neural Networks" program module of the DELL STATISTICA software is used.

Box-Jenkins models
We use the following Box-Jenkins additive models of time series:

Results and Discussion
The descriptive characteristics of the data are given in Table 1. Analyzing the main characteristics of the dynamic range of the trade balance, we conclude that there are no abnormal levels (the so-called "emissions"). Figure 1 therefore shows the dynamics export-import and trade balance.  Everywhere in the future, a dynamic series of the trade balance (variable TB) is used for modeling and forecasting. First, identify the trend. Note that some researchers are trying (see, for example, [1,6]) to define a trend as a regression of the levels of the time series by time,  [7]) suggest that in the case of an unobvious main trend, the trend should be selected by smoothing the initial dynamic series. Figure 3 below shows the dynamic range of the trade balance after 25-fold exponential smoothing. Analyzing the smoothed series, we conclude that the trend has the form of a third-order parabola (see Figure 2).

Neural networks
The module "Automated neural networks" DELL STATISTICA software was used. We will generate multi-layer perceptron networks, and basic radial function neural networks. SALDO will be determined as the dependent variable. Time series will be divided into training sets, testing and control sets, in the following ratio: 70%, 15% and 15%. A delay in time series will be equal to 1 and 1,000 neural networks will be generated, out of which 5, proving the best results, will be preserved. As the activation functions of neurons of the hidden layer, a set of all functions available in the module was used. Since the number of observations is small, we used the multiple subsample method. As a result, the best neural network with 30 neurons in the hidden layer and radial basis activation functions was selected. Figure 4 presents the results of modeling and forecasting.  Note that the neural network showed poor prediction results compared to the actual data for 2019. Therefore, we do not provide numerous intermediate results obtained by modeling neural networks.

Box-Jenkins models
First, we will identify the time series. Analyzing the graph of the autocorrelation ( Figure 5) and partial autocorrelation functions presented below, we conclude that there is a secondorder autocorrelation at lag 2 and annual seasonality with a lag of 12. Partial autocorrelation function is presented below (Figure 6). As it is known, for correct application of the ARIMA*ARIMAS model it is necessary that the time series be stationary. Therefore, we eliminate the trend by taking the third-order difference on lag 3. After this operation, we really get a stationary series, which is clearly shown by the following graph (Figure 7). After the analysis of the dynamics, we use an additive model ARIMA* ARIMAS with the trend and seasonal lag 12:  We are convinced of the adequacy of the obtained ARIMA*ARIMAS model by analyzing the histogram of residuals (Figure 8).  (Table 3). Source: Authors.
As we can see, the relative error of ARIMA forecasting is big enough. Therefore, an additive Holt model of exponential smoothing is applicable for prediction. The advantage of this model is that the selection of smoothing parameters can be achieved so that the most recent levels of the time series are taken into account when predicting. For example, the value of the smoothing parameter 0.1 means that 10% of the last values of the time series determine 90% of the forecast. To simulate again, we will use the "Time Series and Prediction" module of the STATISTICS program. Before building the Holt model, in order to find the optimal values of the smoothing parameters, we will conduct the so-called "Search on the grid". As a result, the following values were found: the smoothing parameter of the main process alpha = 0.4; smoothing seasonal component parameter delta = 0.1: trend damping parameter phi = 0.1. Table 4 shows the results of modeling and forecasting. We are convinced of the adequacy of the obtained the Holt model of exponential smoothing by analyzing the histogram of residuals and Normal curve (Figure 9). The following Figure 10, which shows the original and simulated time series, clearly demonstrates the quality of the constructed model. Let's compare the forecast results with the actual data of the trade balance between Ukraine and the EU for the first quarter of 2019. To do this, we calculate the relative prediction error by the formula:  (5) So, the last model showed good prediction results, since the relative error does not exceed 0.0428 or not more than 4.28%.

Conclusion
The main objective of this work was the ability to predict the dynamics of the trade balance between Ukraine and the EU using various adequate mathematical models of time series. And as a result of the research, this goal has been achieved. Note that the Ukraine-EU trade balance is consistently negative. Since January 1, 2016, Ukraine and the EU have entered into an agreement on an expanded free trade zone (Deep and Comprehensive Free Trade Area). Thanks to this agreement, the EU has become the largest trading partner for Ukraine. At the same time, quotas and the requirement to comply with European standards significantly limit the export of Ukrainian goods to the EU. This is clearly seen from the studies: only in the first month of the year is the Ukraine-EU trade balance positive. That is, Ukraine very quickly "chooses" its quotas for the supply of export goods. The Ukrainian government intends to revise the agreement Deep and Comprehensive Free Trade Area. Once again, as a result of the research conducted in this work, it can be concluded that it is possible to build models of time series that are quite acceptable for predicting the trade balance. Therefore -the goals of the work are achieved.