Diversity and Changes in the Energy Balance in EU Countries

: The main purpose of the paper was to present the energy balance in the EU countries. The speciﬁc objectives were to show the concentration and directions of changes in the demand, production, import, and export of energy in the EU countries, to determine the degree of variability (or stability) of these energy balance parameters, and to establish the correlation between the energy balance parameters and economic parameters. All members of the European Union were deter-minedly selected for research on 31 December 2018 (28 countries). The research period embraced the years 2004–2018. The sources of materials were the literature on the topic and data from Eurostat. Descriptive, tabular, and graphical methods, Gini coefﬁcient, Lorenz curve, coefﬁcient of variation, Pearson’s linear correlation coefﬁcient, and constant-based dynamics indicators were used in the analysis and presentation of materials. It was determined that only the demand for energy and its import in EU countries were nearly related to the economic situation. In turn, exports and production were medium and weakly correlated. In these parameters, economic factors had a smaller impact than other factors, such as political development or the level of energy development in the country. It was also found that the EU countries’ energy imports were characterized by lower volatility than its exports. As a rule, the most signiﬁcant stabilization in the given parameters occurred in countries with a stable economy, the so-called developed economies, while the most signiﬁcant volatility was in developing countries. Energy security is of great importance in all EU countries.


Introduction
Energy is obtained from many sources, such as crude oil, fossil fuels (hard coal, lignite, peat), and natural gas. They are conventional energy sources. In turn, renewable sources include energy obtained from wind, sun, water, biomass and biofuels, or geothermal energy. There are differences in the structure of energy sources between countries [1][2][3][4][5]. There is a common energy policy in the EU which is gradually evolving, based on three pillars: competition, security of supply, and sustainable development. Energy security includes, among other aspects, availability of supply, affordability, and sustainability [6,7]. Energy security is understood in many dimensions and takes different specifics depending on the country (or continent), time frame, or energy source. It can also be stated that the concept of energy security is very broad and is constantly evolving. Primary energy supply security and geopolitics are essential. This approach will dominate the article [8][9][10][11][12][13][14]. In this context, a balanced supply and demand for energy resources are important, as well as their high availability and relative price stability [15]. It is the availability and affordability of energy that has the greatest impact on the overall energy security of the society. In turn, the promotion of renewable energy and diversification are important national energy security strategies [16][17][18][19]. Often, separate indicators for each energy source are used to measure energy security [20]. Overall, there are many indicators that measure energy security. As examples, indicators, more or less complex, developed by Scheepers et al. [21], Löschel et al. [22], Augutis et al. [23], Sovacool [24,25], Narula et al. [26][27][28], Erahman et al. [29], Ying and Liu [30], and Stavytskyy et al. [31] can be mentioned.

1.
All the energy balance parameters in EU countries are closely related to a given country's economic situation.
Such parameters determined the economic situation as total and per capita GDP value, total and per capita household expenditure, the value of exports and imports, and added values of the economy's most critical energy-intensive sectors. T

2.
Energy imports in EU countries were less volatile than energy exports.
Thus, there is stability in the volume of energy imports.

Materials and Methods
All members of the European Union were selected for research on December 31, 2018 (28 countries). The research period covers the years 2004-2018. In 2004, the EU enlarged considerably, with ten new countries joining. This also resulted in large differences in the EU energy balance. The last year in which there were complete data needed to carry out the research using the assumed research methods at the time of the research was 2018. The sources of materials were the literature on the subject and also data from Eurostat. The use of Eurostat data made it possible to compare all EU countries. The tested parameters were calculated based on the same methodology. Descriptive, tabular, and graphical methods, Gini coefficient, coefficient of variation, Lorenz curve, constant-based dynamics indicators, and Pearson's linear correlation coefficient method were used for the analysis and presentation of materials.
In the first stage of the research, the shaping of primary production, import, export, and total energy supply in the European Union was presented. Primary production of energy is any extraction of energy products in a usable form from natural sources. Imports of energy represent all entries into the national territory excluding transit quantities. Exports of energy represent all exits from the national territory excluding transit quantities. Total energy supply is the sum of production and imports subtracting exports and storage changes.
The aim is to show the changes in these parameters of the energy balance. In the second stage, the Gini concentration coefficient was calculated. It was used to determine the concentration level of primary production, import, export, and total energy supply in European Union countries. It is measured by the amount of energy produced, consumed, or traded in the EU. If these values were related to only one country, the coefficient would be 1. If they are spread over more countries, the coefficient becomes lower. The closer it is to 0, the more it proves that the volume of a given energy balance parameter is evenly distributed among the EU countries. The Lorenz curve is a graphical presentation of the level of volume concentration of a given parameter in the EU countries.
The Gini coefficient is a measure of the unevenness of a random variable's distribution. The coefficient can be represented by the formula below when the observations are sorted in ascending order [65]: where: n-number of observations; y i -value of the "i-th" observation; y-the average value of all observations, i.e., − y = 1 n ∑ n i=1 y i The degree of concentration of a one-dimensional random variable distribution determines the Lorenz curve [66]. With sorted observations y i , which are non-negative values 0 ≤ y 1 ≤ y 2 ≤ . . . ≤ y n , ∑ n i=1 y i > 0, the Lorenz curve is a polyline which apexes (x h , z h ), for h = 0,1, . . . , n, have the following coordinates: The Gini coefficient determines the Lorenz curve area and the diagonal of a unit square multiplied by 2.
The third stage of the research presents the structure of energy imports in the EU. The energy import structure in selected EU countries was presented-two with the highest imports, one with the middle of the rate, and one with the lowest imports. It made it possible to determine trends and differences in different countries regarding the volume of energy imports. Various country models are presented.
In the fourth stage, the dynamics indicators for the parameters of the energy balance were calculated. As a result, data on the directions and strength of primary production, import, export, and total energy supply in individual EU countries were obtained. The dynamics indicators with a constant base were used. The dynamics indicators with a fixed base are determined as follows [67]: where: y n -the level of the phenomenon in a certain period; y 0 -the level of the phenomenon during the reference period.
In the fifth stage of the research, the coefficients of variation for the energy balance parameters in individual EU countries were calculated. Thanks to this, it was possible to determine whether the primary production, import, export, and total energy supply are stable or subject to very large-scale fluctuations.
The variation coefficient eliminates the unit of measurement from the standard deviation of a series of numbers. It is dividing them by the mean of series of numbers. Formally the coefficient of variation is computed as [68]: where: S-standard deviation from the sample; M-arithmetic mean from the sample.
In the sixth stage, the relationship between the value of primary production, import, export, and total energy supply in the EU countries and the economy's parameters was examined. The parameters used for the analysis were selected on purpose and were selected based on a literature review. Parameters highlight the most important aspects related to the economy of the studied country. Thanks to this research, it was possible to determine which parameters are significant and the strength of their relationship with the energy balance parameters.
The strength of a straight-line relationship between two measurable features is a measure of Pearson's linear correlation coefficient, and it is expressed through the formula [69]: where: C(X,Y)-covariance between the X and Y; S X 2 -X feature variance; S X -X feature's standard deviation; The linear correlation coefficient is considered as the normalized covariance. The correlation takes values from the range (−1, 1).

Concentration and Directions of Changes in the Demand, Production, Import, and Export of Energy in EU Countries
The energy demand in the EU-28 countries was not covered by production ( Figure 1). In 2004-2018, the energy deficit increased from 48% in 2004 to 53% in 2018. Therefore, it was necessary to import energy and energy resources. There was also export, which is the domain of the free market. However, the fact is that this market is not entirely free because high tariffs and non-tariff barriers partially limit it. Some countries produced more of a given type of energy and sold the surplus. In the years 2004-2018, energy production in the EU decreased by 19%, and its consumption by 10%. Nevertheless, the import of energy resources was still needed. In 2004-2018 it remained at a relatively similar level and increased slightly by 6%. On the other hand, exports of energy resources increased by 15%. Therefore, changes in the parameters of the energy balance in the entire EU were small. In individual EU countries, however, they could take place, mainly due to energy sources. In 2018, energy supply in the EU countries was mainly based on crude oil (29%), natural gas (22%), renewable energy sources (14%), solid fuels, and nuclear energy (12% each). The remaining energy sources were of little importance. In 2004-2018, the energy supply increased the most using renewable energy sources and non-renewable waste (109% each). The dynamics were slightly lower in the case of oil shale (increase by 43%). The supply of energy from solid fuels decreased the most (a decrease by 32%), followed by peat and peat products (by 21%), crude oil and nuclear energy (19% each), and natural gas (by 10%). The energy in the EU was produced from various sources. In 2018, renewable energy sources accounted for 31% of the total energy produced. It was followed by nuclear energy (28%), reliable fossil fuels (16%), natural gas (12%), and oil (10%). The production structure did not correspond to the consumption structure. Individual countries used their natural resources or opportunities to produce renewable energy. Trends in the dynamics of changes in internal energy production were quite similar to those in energy demand. However, much larger declines can be noticed in the case of energy production from natural gas (down 54%), crude oil (47%), and solid fuels (40%). In the case of exports, the dominant source of energy resources was crude oil. In 2018 it was accounted for 77% of all energy exports. Natural gas accounted for 12% and electricity 6% of exports. It should also be emphasized that energy trade often took place between individual EU countries located in close neighborhood. The Gini coefficient determined the concentration level of primary production, import, export, and total energy supply in the European Union. This coefficient is a commonly used measure of inequality, as it meets the postulated axioms in this respect [70]. It always takes values from 0 to 1. A result close to 1 means a very high concentration of one energy value, and a result close to 0 means a dispersion of these values. The data accepted for the study related to 2018 and covered all EU countries. The Gini coefficient calculated z for energy production in the EU was 0.62. The estimated coefficient for the population was 0.65. It suggests a high concentration of one or more countries in energy production. Gini coefficients were also calculated for the other energy parameters. Additionally, the differentiation was presented using the Lorenz concentration curve [71] (Figure 2). In 2018, there was a high concentration of energy imports in the EU countries (the sample coefficient was 0.60 and the estimated 0.63), as well as exports (from the sample 0.63, estimated 0.65) and energy consumption (respectively 0.62 and 0.64). Concentration coefficients were also calculated for 2004. There has been a significant reduction in energy production and exports in the EU from one or more sources towards diversification. The Gini coefficients for energy production in 2004 were 0.67 from the sample and 0.69 estimated. In the case of exports, it was 0.69 and 0.71, respectively. In the case of energy imports and consumption, there were virtually no changes. The concentration level did not change. For energy imports, the Gini coefficient from the sample was 0.62, and the estimated one was 0.64. For energy consumption, it was 0.62 and 0.65, respectively. Therefore, it can be concluded that there was a high concentration concerning individual elements of the energy balance in the EU. The changes did not occur at all or were very slow. The high concentration of production, import, export, and energy consumption in several countries is also due to several countries with high economic potential and large population populations. Additionally, there were many smaller countries in the EU reporting less energy demand. Changes in the future will not happen quickly. Different countries have access to quite similar technologies, so their energy efficiency differences are usually not very large. Therefore, it can be said with a high probability that the high level of concentration of production, trade, and energy consumption in the EU will be maintained for many years. Energy security depends to a large extent on access to energy resources. It is important to be slightly dependent on one or more suppliers. It is also advisable to diversify energy supply sources, improving energy security, and not using energy supplies as a political instrument. Import is a vital element of the energy balance of the EU countries. In 2018, mainly crude oil was imported (64% of all energy imports), but also natural gas (25%) and solid fuels (7%) (Figure 3). The share of other energy sources was 4%. Imports of other energy resources, such as those from non-renewable waste and renewable energy sources, grew the fastest. However, the scale of these imports was small. In the years 2004-2018, the import of natural gas (by 23%) and crude oil (by 2%) increased, while the import of solid fuels (by 26%) decreased. In the case of the energy balance parameters, slight changes in the energy volume can be noticed. However, there were changes in the structure concerning energy sources. Renewable energy sources were introduced. However, it was impossible to abandon crude oil, especially in transport, and natural gas, for use in households and industrial plants.

Case Studies in the Field of Energy Balance in Selected EU Countries
The situation in individual countries in terms of energy balance was diversified. Malta, Luxembourg, and Cyprus were almost entirely dependent on external energy sources. Theoretically, energy production covered the reported demand only in Denmark in 2004-2012, Estonia in 2015 and 2017-2018, and Great Britain in 2004. However, there was practically no country that was self-sufficient in energy and did not need imports. The reason was the large variety of energy sources and the strict allocation of the raw materials to specific needs. For example, electricity used to power electric cars could be an alternative to crude oil in transport. However, the use of electric cars is low, so there is practically no alternative to oil. To select countries' representatives for a more detailed analysis compared investments received by individual countries regarding energy imports. Germany imported the most energy resources. Some justification may be the country's size and the degree of economic development, and the resulting needs. The country's energy self-sufficiency in 2018 was only 37%. The Netherlands took second place. It is also economically developed, but much smaller in terms of area and population. Energy self-sufficiency in 2018 amounted to 50%. Hungary (14th position) was in the middle to import energy resources in the EU. It was an economically developing country. The country's energy self-sufficiency in 2018 was 41%. Cyprus was last. However, it was a tiny country with little diversification of energy sources. Estonia was selected for the analysis. In terms of the volume of energy, imports was in the penultimate place. It was an economically developing country with an extensive diversification of energy sources. In 2018, this country was self-sufficient because production accounted for 106% of the energy supply. However, it must be taken into account that some energy sources have not been widely replaced, e.g., crude oil.
In the years 2004-2018 in Germany, the energy demand decreased (by 11%), its production (by 18%), export (by 11%), and import (by 9%). In the case of imports, crude oil dominated in the structure in 2018 (54% of total imports), while natural gas (30%) and solid fuels (13%) were of less importance. This structure did not change significantly ( Figure 4). In the years 2004-2018, the fastest in relative terms was importing energy from renewable sources (an increase by 365%). Imports of solid fuels also increased slightly (by 9%). However, less crude oil (by 14%) and natural gas (by 7%). In the Netherlands, between 2004 and 2018, energy demand decreased by 9% and its production by 46%. Interestingly, both exports (by 38%) and imports of energy resources (by 45%) increased during this period. The Netherlands is one of the countries that trade in energy resources. Some of the purchased raw materials were subject to foreign trade, making it possible to earn money on this type of activity. In 2018, crude oil dominated in energy imports (73%). Natural gas (21%) and solid fuels (4%) were of less importance ( Figure 5). In the years 2004-2018, natural gas imports increased the fastest in relative terms (by 223%). Growth was also recorded in renewable energy (81%), electricity (25%), and oil (28%). Substantial fuel imports fell by 6%. Hungary was in the middle in terms of energy imports. In 2004-2018, the demand for energy in this country increased by 1%, and domestic production by 6%. Much more significant increases were recorded in energy imports (an increase by 28%) and its exports (by 194%). Two sources dominated the import structure in 2018, i.e., crude oil and natural gas ( Figure 6). They accounted for 43% of imported energy each. The imports of electricity (7%) and solid fuels (5%) were much lower. In Hungary, in the analyzed period, the import of electricity (77%) and crude oil (38%) were increasing the fastest, and imports of natural gas (14%) and solid fuels (3%) the slowest. A separate category is an energy from renewable sources, which has been imported only since 2009. In 2009-2018, the growth dynamics for this type of energy was 435%. Still, the importance of renewable energy was low. Hungary is one of the economically developing countries with a high demand for imported energy. The lowest energy import was recorded in Estonia. In the years 2004-2018, all parameters of the energy balance in this country increased, i.e., energy demand (by 18%), its production (by 78%), export (by 399%), and imports (by 26%). The import structure was dominated by crude oil, as it accounted for as much as 73% of total energy imports in 2018. Natural gas (15%), electricity (9%), and renewable energy sources (1%) were of less importance (Figure 7). In the years 2004-2018, the imports of crude oil (an increase by 77%) and electricity (by 780%) increased, while the imports of solid fuels (by 19%) and natural gas (by 47%) decreased. In the case of other energy sources, the import of energy from renewable sources is growing rapidly. Such imports appeared only in 2009. In 2004, the import of bituminous shale was of great importance, but this source of energy was abandoned in the following years. The regularities in Estonia were quite similar to those in Hungary. It was different, among others structure of imported energy. The presented examples of countries show some models concerning external energy sources and ensuring energy security. The countries differed in the size of imports, but also the degree of economic development. There have not been many changes in economicallydeveloped countries, but, as a rule, energy production and consumption were reduced. Examples of such countries are Germany and the Netherlands, where many energy efficiency projects were implemented. In economically developing countries, all parameters of the energy balance tended to increase. This is due to the enormous economic needs of these countries and higher energy demand. Additionally, these countries, as a rule, used less efficient technologies in terms of energy efficiency. A common feature of all countries is the growing importance of renewable energies. Moreover, since 2009, this source of energy has become a relatively common subject of international trade. Renewable energy imports in all countries have grown tremendously. Of course, the scale of this energy import was still much smaller than conventional energy sources.

Degree of Variability (or Stability) of Energy Balance Parameters in EU Countries
In the next stage, the dynamics indices were calculated for the energy balance parameters, i.e., energy supply, production, export, and import. The level from 2004 was adopted as the basis ( Table 1). The results were ordered in descending order due to the dynamics of energy imports. Energy imports have increased in most EU countries over the fourteen years. The decreases concerned nine countries, but they did not exceed 22%. The largest increase in energy imports was recorded in Poland. Imports almost doubled there. There were also high dynamics in Malta, the Netherlands, and Slovenia. Changes in imports may result from policies implemented at the country level. Due to the existing economic and social conditions, each country should be analyzed separately. In most EU countries, the energy demand has decreased. The changes were not significant. Much greater fluctuations occurred in the case of exports and energy production. Some countries increased energy sales several times, for example, Estonia, the Netherlands, Hungary, Denmark, the Czech Republic, and Germany. The explanation is that energy is increasingly being traded as a commodity. More and more energy is purchased to meet one's own energy needs and for speculative purposes. Additionally, a considerable diversification of energy sources and the inability to use a given source for all purposes causes the exchange to occur. Countries that specialize in producing given energy, or have considerable energy resources, sell energy to other countries. In turn, they buy energy and the necessary raw materials that are in shortage on their market. In energy production, one-half of the countries recorded declines, and the other half increases. The scale of the changes varied. In general, the largest increases in energy production occurred in small countries with low production. In larger countries, the scale of changes was not so significant. Then, the coefficients of variation for the parameters related to the energy balance were calculated. The results refer to the years 2004-2018 and have been ordered in ascending order according to energy imports' variability ( Table 2). The variation in energy demand was not very large, which means no sharp changes in energy consumption. The most significant fluctuations in energy demand occurred in Lithuania, Malta, and Greece. Austria and France were among the most stable countries in terms of energy demand. In the case of energy imports, the most significant variability was in Malta, Romania, Poland and Estonia. In turn, energy imports were the most stable in Belgium, Germany, and Austria. There was high variability in the production and export of energy. There was very high variability in energy production in Malta and Ireland, Lithuania, and Cyprus. Energy production was stable in France, Slovenia, and Slovakia. Energy exports were generally highly volatile, with the highest volatility in Cyprus, Malta, and Estonia. The smallest fluctuations in energy exports occurred in the Czech Republic, France and Slovakia. As a rule, in countries with a stable economy, the so-called economically-developed, there was better stability in energy consumption, production, and import. In turn, in developing countries, this variability was generally much higher. In addition to other economic development and applied government policies, there was also a different energy development level in individual EU countries.

Correlation between the Energy Balance Parameters and Economic Parameters in EU Countries
To establish the relationship between the parameters related to the energy balance in the EU countries and economic parameters, Pearson's linear correlation coefficients were calculated (Table 3). p = 0.05 was adopted as the border value of the significance level. Irrelevant results are marked with red font color in the table. Correlation coefficients have been calculated for all EU countries for the entire 2004-2018 period. The study examined a correlation that does not indicate that a given factor affects another but indicates a strong or weak relationship. All parameters related to the energy balance were adopted for the research: primary production, import, export, and total energy supply [32]. It was essential to determine the relationship of these parameters with the relevant economic parameters. The research also used economic parameters that testify to the economic situation and situation. The parameters also referred to the results per capita, which indicated the country's economic development level. Parameters relating to individual sectors of the economy were also adopted. Virtually all departments are energy-dependent, so these departments' situations could be correlated with the energy balance parameters. Solid positive relationships were found between the demand for energy and its import and economy parameters. Only in the case of economic parameters related to per capita were these relationships were fragile. The expected results have been achieved as the economic situation has a strong influence on energy needs. When production increases, practically all sectors of the economy report a greater energy demand. Besides, energy consumption also results from consumption in households. In the case of energy exports, the relationships were also positive, but their strength was smaller. Similarly, per capita parameters showed less correlation with energy exports. One explanation for the observed regularities is the greater tendency to trade in energy. More and more countries are exporting energy or trading in energy resources. In the case of energy production, the dependencies with the economy were weak and negative. This means that the economic situation does not affect production decisions. European countries mainly produce energy from their resources, such as solid fuels, renewable sources, and gas. There is much pressure to abandon coal mining and replace this source with renewable energy. Hence, the achieved results are not surprising. In the absence of social and environmental pressure, the likely correlation would be high and positive. The general climate policy in contemporary realities more influences governments' decisions regarding the use of non-renewable energy sources than the economic situation.

Discussion
In Matsumoto et al. [72] studies, it was found that the level of energy security improved in most EU countries between 1978 and 2014. The most remarkable improvement was recorded in Denmark and the Czech Republic. This was due to the increase in the diversification of primary energy sources and the diversification of imports, particularly the diversification of energy import sources. In the studies by Dudin et al. [73] it was found that, in a shorter period, in the years 1990-2018, the dependence on total energy imports increased. Such trends were observed for all energy sources. The given dependencies are consistent with the results obtained by the authors of this article. In studies by Augutis et al. [74], based on the example of the Baltic states, it was found that the level of energy security depended on their energy resources. Jonek-Kowalska [75] investigated the reasons for the transformation of energy balances in selected EU countries dominated by hard coal. It determined that these fuels are being replaced by other non-renewable energy sources or renewable energy sources, or nuclear energy. EU countries are most often compensated for the decreasing share of coal with the growing share of gas. The share of nuclear energy increased in France, the Czech Republic, and Great Britain. The research of other authors found that the share of renewable energy sources in the energy mix significantly depended on the economic condition of the EU countries. Countries without their fossil fuel sources invested in renewable energy to the greatest extent [76][77][78][79].
Bluszcz's [80] research showed similar results as authors of this article in terms of the dependence of the EU countries on imports. Dependence on oil, gas, and imported coal was highest in 2013 in Malta, Luxembourg, and Cyprus, and lowest in Estonia and Denmark. Many EU countries were utterly dependent on oil imports. Only Denmark and the United Kingdom had a positive balance sheet and were oil exporters. The member states were also highly dependent on imported natural gas. Only Denmark and the Netherlands had a positive balance sheet. In the case of hard coal, the dependence was smaller. Only Poland, the Czech Republic, and Estonia had a positive balance. Imports of energy in countries dependent on it and its export in the case of producers can significantly impact the country's balance of payments. Additionally, the costs of energy acquisition significantly affect the competitive position of the economy of the country [81][82][83][84].
Some studies show that energy consumption contributes to economic growth. Some studies show that energy consumption has little or no impact on economic growth that can be ignored. Many authors viewed energy as a critical resource used in all production phases and consumed as a product, increasing the welfare level [85][86][87][88][89][90][91][92]. This hypothesis is called the growth hypothesis in the literature. It assumes that energy is one of the critical indicators of economic growth. Opponents of this hypothesis argue that energy plays a minimal or neutral role in economic growth and proposes their assumption as the neutrality hypothesis. Many studies support the neutrality hypothesis [93][94][95][96][97][98]. In line with these assumptions, policies to reduce energy consumption do not affect economic growth. In their research, the article's authors confirmed the hypothesis about an enormous impact of energy on economic growth. However, it should be noted that this influence depended on a given parameter of the energy balance. The most significant dependence was found in the case of total energy supply, and a very weak one in the primary production of energy.
Many studies have found a positive relationship between economic growth and energy use. However, energy matters less at low levels of economic growth. The weak impact of economic growth on energy consumption also occurs in countries with the highest GDP. Economically developed countries have lower energy needs because they use more energy-saving technologies. In developing countries, there is a close link between energy consumption and economic growth [99][100][101][102][103][104][105][106][107]. Additionally, countries have to balance between economic growth and energy transformation. There are differences on this issue between economically developed and developing countries. However, all of them must strive to develop with the use of sustainable energy sources [108][109][110].
The increase in energy security and reducing the risk of dependence on imports can be influenced by using different tools. It is important to support the development of new technologies, renewable energy sources, and diversification of energy carriers. These elements are reflected in the provisions of the energy and climate package and the Energy Roadmap 2050 [111]. The increase in energy security is to be ensured by the Energy Union. However, there are differences between countries as regards the competences of the EU and individual countries in the field of energy policy [112,113]. The problems of energy balance and energy security are very important for the socio-economic development of EU countries. These problems cannot be solved quickly, they require an energy transformation of the country's economy. Such processes are spread over several decades.

Conclusions
Energy security is understood in many ways. In the simplest sense, it concerns the stability of supplies and the diversification of energy sources. Important parameters in the energy balance are production, import, export, and energy supply. In the EU, the demand for energy was not covered by production. The energy deficit was about 50% and did not change significantly from year to year. Energy has become a larger subject of trade, as evidenced by the growing share of exports. EU countries buy energy not only with their own supply in mind, but also with trade. Additionally, the surplus of energy generated from a given source is exported. This is especially the case with renewable energy.
In the EU, oil and natural gas were used as main energy sources. Subsequently, renewable energy, nuclear energy, and fossil energy were used. In the case of in-house production, the order was different, as energy generated from renewable sources and nuclear energy dominated. Other sources of energy were followed (solid fuels, natural gas, and crude oil each accounted for several percent of energy production in the EU). The production structure was different from the demand. The imports concerned mainly crude oil, which accounted for 64% of all energy imports in 2018. Natural gas accounted for 25%, and solid fuels for 7%. This structure is understandable. Crude oil is mainly consumed by transport, and European countries do not have large resources of this energy resource. Natural gas is increasingly imported in the EU. It should also be emphasized that in individual EU countries the situation in terms of the energy balance was varied. The largest energy imports were in Germany and the Netherlands. Germany was quite stable in terms of the volume of energy imports, which was also caused by the stabilization of the economy. This country has achieved a high level of economic development and introduced energy-efficient technologies. In the Netherlands, there were large increases in imports, mainly due to energy trade and its export. In both countries, the structure of imports was slightly different, but crude oil predominated, followed by natural gas and solid fuels. Hungary and Estonia are among the developing countries. Hungary found itself in the middle of the stakes in terms of energy imports, and Estonia at the bottom of it. In both countries, the demand for energy increased. More and more imports were necessary. The structure of imports was different. In Hungary, crude oil and natural gas had an equally high share, while oil was clearly dominant in Estonia. In all the countries analyzed in detail, renewable energy has become increasingly important in terms of production, trade and consumption. For example, in Estonia and Hungary, the import of renewable energy started in 2009 and was increasing very quickly.
In half of the EU countries, energy imports increased. These were developing countries like Poland, but also developed countries like the Netherlands. In Poland, the purchased energy was used for its own needs, while in the Netherlands it was traded. Each country had a separate energy policy. Overall, EU energy demand has fallen, but the changes have not been rapid. In the case of exports and production, these changes were very large. Energy has become a commodity subject to trade. There is also a diversification of energy sources. Energy production has declined in most countries, although there have also been some that have recorded increases. The presented regularities were also confirmed in regression models for individual parameters of the energy balance.
The volatility of energy demand and its import was insignificant. Much greater variability occurred in the case of energy exports and production. Thus, the second hypothesis was confirmed. As a rule, the greatest stabilization in the given parameters occurred in countries with a stable economy, the so-called economically developed, while the greatest variability was in developing countries. The energy policy and the level of energy development of each country had an impact on the achieved results. There was a very strong correlation between the demand for energy and its import, and the parameters of the economy. This result was expected. Only in the case of per capita parameters the strength of the relationship was small. In the case of energy exports, the strength of the relationship with the parameters was smaller, which also results from the increasingly common treatment of energy as an object of trade. The relationships between energy production and economic parameters were weak and negative, which results from the withdrawal of countries from, for example, hard coal mining and social pressure related to reducing the emission of pollutants into the environment. The first hypothesis was only partially confirmed with regard to energy demand and its import. For these parameters, there was a strong correlation with the parameters of the economy. The strength of the relationship was medium or weak for exports and energy production.