Long-Term Demand Forecasting in a Scenario of Energy Transition

: The energy transition from fossil fuels to carbon-free sources will be a big challenge in the coming decades. In this context, the long-term prediction of energy demand plays a key role in planning energy infrastructures and in adopting economic and energy policies. In this article, we aimed to forecast energy demand for Spain, mainly employing econometrics techniques. From information obtained from institutional databases, energy demand was decomposed into many factors and economy-related activity sectors, obtaining a set of disaggregated sequences of time-dependent values. Using time-series techniques, a long-term prediction was then obtained for each component. Finally, every element was aggregated to obtain the ﬁnal long-term energy demand forecast. For the year 2030, an energy demand equivalent to 82 million tons of oil was forecast. Due to improvements in energy e ﬃ ciency in the post-crisis period, a decoupling of economy and energy demand was obtained, with a 30% decrease in energy intensity for the period 2005–2030. World future scenarios show a signiﬁcant increase in energy demand due to human development of less developed economies. For Spain, our research concluded that energy demand will remain stable in the next decade, despite the foreseen 2% annual growth of the nation’s economy. Despite the enormous energy concentration and density of fossil fuels, it will not be a ﬀ ordable to use them to supply energy demand in the future. The consolidation of renewable energies and increasing energy e ﬃ ciency is the only way to satisfy the planet’s energy needs.


Introduction
Modern societies face the challenge of transitioning to a new energy model that permits continuing fulfilment of increasing energy demand while meeting the requirements presented for climate change and sustainability, which can be summarized in the so-called energy trilemma [1] depicted in Figure 1. Industry and governments have to simultaneously pursue energy security (reliability of energy infrastructure, and ability of energy providers to meet current and future demand), energy equity (accessibility and affordability of energy supply across the population), and environmental sustainability (energy efficiency and the development of energy supplies from renewable and other low-carbon sources).
The commitments of the European Union, derived from the Paris Agreement, established a goal of reducing emissions between 80% and 95% by 2050, compared to 1990 levels [2]. This necessarily leads to the electrification of most of the energy demand, which would cause the demand for electricity to approximately double what it is currently before the year 2060 [3].
In this context, the prediction of energy demand plays a key role in planning energy infrastructures and in adopting economic and energy policies. Besides institutional and national studies, many studies, many academic works have addressed this problem, adopting global [4], regional [5], national [6,7], or even local [8] perspectives.
Energy forecasting has been addressed in the literature, mainly considering three different prediction horizons: short-term (an hour to a week) [9,10], mid-term (a month to 5 years) [11], and long-term (5 to 20 years) [12]. Prediction methods can be additionally categorized into two types: data-driven methods, where the relationship between the energy demand and its causal variables is automatically discovered using statistical procedures [13]; and model-driven, where this relationship has been previously established [14].
Data-driven methods can be classified as autoregressive (those using only historical data to make predictions) and causal (those which also consider external variables influencing energy demand, such as temperature, economy, etc.).
Once the variables used to make predictions (either only past values or past and external values) have been established, different data-driven forecasting techniques have also been suggested in the literature, such as artificial neural networks [10], fuzzy logic [15], time-series analysis [16], regression models [6], support vector machines [17], or genetic algorithms [18]. By contrast, model-driven predictions can be made using system dynamics [19], or, more often, econometric models [20,21]. For large horizons (long-term predictions), data-driven methods are more likely to fail, as the forecasting error usually increases with the length of the prediction horizon. Thus, econometric models are the most commonly employed technique [22]. Ghalehkhondabi et al. [23] have made an overview of general energy demand forecasting methods.
Some other works have also addressed long-term energy demand prediction for Spain, as it is an active country in the renewable energy market [31]. Most of them have addressed partial aspects [32][33][34][35][36][37], although research from a more general perspective can be found in References [38,39]. However, these two general approaches focus only on electricity demand and not overall energy consumption, which is the key factor determining CO2 emissions. In our research, the goal was to obtain a long-term forecast (year 2030) of the Spanish total energy demand. As was suggested by the literature review described in the previous paragraphs, the approach of this paper used econometrics techniques. From information obtained in institutional databases, energy demand was decomposed into many factors and economy-related activity sectors, obtaining a set of disaggregated sequences of time-dependent values. Using time-series techniques, a long-term prediction was then obtained for each component. Finally, every element was aggregated to obtain the final long-term energy demand forecast. In our research, the goal was to obtain a long-term forecast (year 2030) of the Spanish total energy demand. As was suggested by the literature review described in the previous paragraphs, the approach of this paper used econometrics techniques. From information obtained in institutional databases, energy demand was decomposed into many factors and economy-related activity sectors, obtaining a set of disaggregated sequences of time-dependent values. Using time-series techniques, a long-term prediction was then obtained for each component. Finally, every element was aggregated to obtain the final long-term energy demand forecast.

Data Sources
The data used in this paper can be found in the Eurostat (European Statistical Office) databases [40]. More specifically, for this research, population [41], economic [42], energy [43], and climate change [44] magnitudes were considered for Spain for the period 1990-2015.
The energy magnitudes have been disaggregated into n = 30 activity sectors (level 1), as it is detailed in Table 1. Some medium (level 2) or coarse (level 3) partial disaggregation has also been employed in some representations through the article. The structure of energy demand disaggregation is depicted in Figure 2.

The Kaya Identity
In energy transition scenarios, the emission of the greenhouse gas carbon dioxide is one of the most relevant variables to be considered. For that reason, in the last decade of the 20th century, the Kaya identity [45] was proposed as a method to decompose the influence of different elements on CO2 emissions. This identity can be formulated as: where is the global CO2 emissions due to human activities; is the world's total population; is defined as / , that is, the world's gross domestic product (GDP: ) per person ( ); is the energy intensity, defined as / , with being the global energy consumption; and is the carbon footprint of energy, defined as / . Substituting these definitions into Equation (1), the Kaya identity can also be formulated as: The increase of the population ( ) and the development of the economy ( ) are the main elements that identify the energy needs of a society. Following the Kaya identity, future increase of population and economic growth can be compensated through an improvement in energy efficiency (lower values of ) and the decarbonization of the energy consumed (lower values of ). The reduction of greenhouse gas emissions justifies actions aimed at reducing these two factors. In the context of this paper, aimed at energy demand forecasting, only the first three factors of the Kaya identity were considered, while the fourth ( ) should play a key role in energy production policies.

Laspeyres Decomposition
Most of the member countries of the OECD (Organisation for Economic Co-operation and Development) have established energy saving and efficiency objectives in their energy and environmental policies. However, there is a big challenge in measuring these values and their progress over the time. The problem becomes even more complex if there are economic changes and, jointly, improvements in energy efficiency. To tackle this issue, several decomposition methods have been proposed [46]. By far the most employed techniques in energy studies are the Laspeyres method [47][48][49] and the logarithmic mean Divisia index (LMDI) [50,51], due to their ease of understanding and their advantages over other competing indices (Fischer [52] or Paasche [53]).
To obtain the energy demand forecast, the following procedure (as depicted in Figure 3) was employed: 1. Using a decomposition method, the raw economic data  were disaggregated into several economic sectors and, for every sector, into three factors (activity, structure, and intensity), which will be defined below. 2. The time-series obtained for every sector and factor was used to forecast its values (2030). The forecasted values were then aggregated to obtain a prediction of the energy demand.

The Kaya Identity
In energy transition scenarios, the emission of the greenhouse gas carbon dioxide is one of the most relevant variables to be considered. For that reason, in the last decade of the 20th century, the Kaya identity [45] was proposed as a method to decompose the influence of different elements on CO 2 emissions. This identity can be formulated as: where C is the global CO 2 emissions due to human activities; P is the world's total population; G p is defined as G/P, that is, the world's gross domestic product (GDP: G) per person (P); I e is the energy intensity, defined as E/G, with E being the global energy consumption; and F e is the carbon footprint of energy, defined as F/E. Substituting these definitions into Equation (1), the Kaya identity can also be formulated as: The increase of the population (P) and the development of the economy (G p ) are the main elements that identify the energy needs of a society. Following the Kaya identity, future increase of population and economic growth can be compensated through an improvement in energy efficiency (lower values of I e ) and the decarbonization of the energy consumed (lower values of F e ). The reduction of greenhouse gas emissions justifies actions aimed at reducing these two factors. In the context of this paper, aimed at energy demand forecasting, only the first three factors of the Kaya identity were considered, while the fourth (F e ) should play a key role in energy production policies.

Laspeyres Decomposition
Most of the member countries of the OECD (Organisation for Economic Co-operation and Development) have established energy saving and efficiency objectives in their energy and environmental policies. However, there is a big challenge in measuring these values and their progress over the time. The problem becomes even more complex if there are economic changes and, jointly, improvements in energy efficiency. To tackle this issue, several decomposition methods have been proposed [46]. By far the most employed techniques in energy studies are the Laspeyres method [47][48][49] and the logarithmic mean Divisia index (LMDI) [50,51], due to their ease of understanding and their advantages over other competing indices (Fischer [52] or Paasche [53]).
To obtain the energy demand forecast, the following procedure (as depicted in Figure 3) was employed: 1.
Using a decomposition method, the raw economic data  were disaggregated into several economic sectors and, for every sector, into three factors (activity, structure, and intensity), which will be defined below.  Let us call the number of economic sectors of a certain economy. At a given time, , we will use the following definitions: • ( ) ( ): level of activity of the -th sector, which is measured by the gross value added for the industry and services sectors, by population for residential consumption, and by passengerkilometers and ton-kilometers for the sectors of passenger and freight transport, respectively; Based on these definitions, it can be written that: The change of energy consumption due to a change in the total level of activity for a period of time between 0 and can be expressed, as shown in Appendix A, as: Analogously, the other two components are defined as: Considering now the n sectors of the economy, we obtain: For the activity component, it can be written, as shown in Appendix A, that: Analogously, the other two components are: Finally, the increasing energy demand is decomposed as: Let us call n the number of economic sectors of a certain economy. At a given time, t, we will use the following definitions: • A (i) (t): level of activity of the i-th sector, which is measured by the gross value added for the industry and services sectors, by population for residential consumption, and by passenger-kilometers and ton-kilometers for the sectors of passenger and freight transport, respectively; Based on these definitions, it can be written that: The change of energy consumption due to a change in the total level of activity for a period of time between t 0 and T can be expressed, as shown in Appendix A, as: Analogously, the other two components are defined as: Considering now the n sectors of the economy, we obtain: For the activity component, it can be written, as shown in Appendix A, that: Energies 2019, 12, 3095 6 of 23 Analogously, the other two components are: Finally, the increasing energy demand is decomposed as: This expression is called the additive decomposition. It is sometimes preferred to use the ratio of increasing energy demand, R E , instead of the direct value of this increase (∆E).
In the common case where ∆E A , ∆E S , ∆E I E 0 , the increase of energy demand is multiplicatively decomposed, as shown in Appendix A, as:

LMDI Decomposition
In logarithmic mean Divisia index (LMDI) decomposition, the change of energy consumption due to a change in the total level of activity, for a period of time between t 0 and T, can be expressed, as detailed in Appendix B, as: . LMDI decomposition uses for the approximation the logarithmic mean, which is: Thus, as shown in Appendix B: Analogously, the other two components are: LMDI decomposition can also be expressed in the multiplicative form as: Laspeyres and LDMI factorial decomposition methods are summarized in Table 2.

Component Symbol Laspeyres LMDI
Activity

Time-Series Forecasting
To predict future values of a time-dependent magnitude (activity, structure, or intensity for a certain sector), time-series forecasting models were employed. Some authors [54] have classified these models according to the estimation period: short-, medium-, or long-term.
In shorter terms, prediction of seasonal behaviors, such as climate or labor market variations, has to be considered. However, for long-term forecasting, only time-series trends are really relevant. For this reason, linear regression (or linear trend) [55] is one of the most employed forecasting techniques.
Let us denote x i the i-th value of a certain variable (or magnitude) x. This value has been obtained at time t i , so N pairs (t i , x i ) are available. The linear regression method obtains a straight line in the (t, x) plane, defined as x = m t + b, where m is the slope of the line and b is the interception point with the vertical line. The values ofm andb are estimated to minimize the root mean squared error (RMSE), defined as: The resulting line parameters are: A more advanced prediction technique is exponential smoothing [56], where, to forecast new values, the more recent data have greater weight than the older ones. In this method, the predictionx t at a certain time t is obtained as:x where 0 ≤ α ≤ 1.
If the time series has a trend, a double exponential smoothing (Holt-Winters model) is usually preferred [57], which is formulated as: where α is the data smoothing constant, 0 ≤ α ≤ 1, and β is the trend smoothing constant, 0 ≤ β ≤ 1. These parameters are also estimated, minimizing the RMSE, defined now as: As this paper was focused on long-term prediction, there was no need for seasonal or short-term details. Moreover, as complex models tend to overfit available data, more sophisticated predictors were avoided.

Evolution of Main Carbon-Related Magnitudes
Human and economic activity is related to energy consumption and carbon dioxide emissions. In Figure 4, we see the evolution of four key parameters for the period 1990-2015: population, gross domestic product (GDP), primary energy demand, and CO 2 emissions. When energy comes from different sources (not just electricity) it is usually expressed in tons of oil equivalent (toe; 1 toe = 11.63 MWh).   These values can be expressed in terms of the Kaya identity factors (Equation (1)), as seen in Table 3. The emissions produced between 1990 and 2015 grew by 20%, mainly due to the growth of the Taking values in 1990 as the baseline, the evolution of the four previous magnitudes can be compared in Figure 5 Between 1990 and 2005, a high rate of economic growth (GDP) can be seen: 2.7% in Spain vs. 3.1% in the European Union (EU). By contrast, in the period 2005-2015, the years of crisis and subsequent recovery can clearly be observed, with a GDP increase of 0.5% in Spain vs. 1% in EU). The impact on primary energy consumption was 3.2% and −1.7% in each period. All these percentage values correspond to the compound annual growth rate (CAGR).   These values can be expressed in terms of the Kaya identity factors (Equation (1)), as seen in Table 3.   During these 25 years, the population in Europe grew at 0.3% (CAGR), whereas Spain presented a strong growth of 0.7%. While the population of Europe grew 7% in this period in accumulated terms, Spain reached an almost 20% increase, a value consistent with other not fully-developed countries and, therefore, with greater energy requirements.
These values can be expressed in terms of the Kaya identity factors (Equation (1)), as seen in Table 3. The emissions produced between 1990 and 2015 grew by 20%, mainly due to the growth of the population by the same proportion, 20%, in addition to an increase of the GDP per person of 32%, which was compensated with improvements in the energy intensity by 15% and in the carbon intensity by 11%.
The process of tertiarization describes the phenomenon of evolving from an economy centered on agriculture, livestock, and fisheries to an economy in which the services sector has the greatest role. Every society begins first with a process of urbanization and industrialization, which is followed by the development of tourism and public services, as well as the incorporation of women into the labor market. This presence of the service sector in the economy translates into jobs, reaching 76% of the active population in Spain.
The relative weight of this sector in GDP, measured through gross value added (GVA) at basic prices, also reached a similar proportion, as depicted in Figure 6. By 2015, at 2015's prices, the industrial sector represented 33.2% of the GVA, compared to 64.6% for the services sector and 2.2% for agriculture. by the development of tourism and public services, as well as the incorporation of women into the labor market. This presence of the service sector in the economy translates into jobs, reaching 76% of the active population in Spain.
The relative weight of this sector in GDP, measured through gross value added (GVA) at basic prices, also reached a similar proportion, as depicted in Figure 6. By 2015, at 2015's prices, the industrial sector represented 33.2% of the GVA, compared to 64.6% for the services sector and 2.2% for agriculture. The energy consumed by sector is depicted in Figure 7. In this graph, only the energy demand directly related to the economy has been included, that is, the activity sectors 1 to 20, as they are identified in Table 1.
Relating the energy consumed by sector, shown in Figure 7, to its economic contribution, shown in Figure 6, shows that the tertiary sector is less intensive in energy consumption (measured in Mtoe per billion of euro in 2015): 13.9 for services vs. 51.1 for the industry sector and 92.0 for the agricultural and forestry sector. The energy consumed by sector is depicted in Figure 7. In this graph, only the energy demand directly related to the economy has been included, that is, the activity sectors 1 to 20, as they are identified in Table 1.
Relating the energy consumed by sector, shown in Figure 7, to its economic contribution, shown in Figure 6, shows that the tertiary sector is less intensive in energy consumption (measured in Mtoe per billion of euro in 2015): 13.9 for services vs. 51.1 for the industry sector and 92.0 for the agricultural and forestry sector. directly related to the economy has been included, that is, the activity sectors 1 to 20, as they are identified in Table 1.
Relating the energy consumed by sector, shown in Figure 7, to its economic contribution, shown in Figure 6, shows that the tertiary sector is less intensive in energy consumption (measured in Mtoe per billion of euro in 2015): 13.9 for services vs. 51.1 for the industry sector and 92.0 for the agricultural and forestry sector.

Energy Demand Decomposition
We next applied the Laspeyres and LDMI factorial decomposition methods (summarized in Table 2) to the data depicted in Figure 5 (energy) and Figure 6 (activity). The results are shown in Figure 8.
It can be seen that both methods offered quite similar results. As the Laspeyres decomposition is easier to understand, it has been used in the rest of the paper. A more detailed analysis of the results obtained employing the Laspeyres method is depicted in Figure 9.

Energy Demand Decomposition
We next applied the Laspeyres and LDMI factorial decomposition methods (summarized in Table 2) to the data depicted in Figure 5 (energy) and Figure 6 (activity). The results are shown in Figure 8. Following techno-economic factors, it was possible to make an analysis of the past variation in Spain. Following the Annex XIV, part 1 of the Energy Efficiency Directive [58]: "In sectors where energy consumption remains stable or is growing, Member States shall analyze the reasons for it and attach their appraisal to the estimates".
The activity effect is the measure of value added variation, very much linked to the economic setting. Since 1990, it has been the main effect that explains the variation, shown in Figure 9, of final energy growth. The economic activity trend was linked to the energy demand with a positive elasticity until the appearance of the recession period. Structural changes represent internal evolution with different energy intensities; the evolution of individual branches represents different global energy needs, and they did not grow at the same rate. The energy efficiency depended on technological improvements, fuel substitution, and highest output per unit. It can be seen that both methods offered quite similar results. As the Laspeyres decomposition is easier to understand, it has been used in the rest of the paper. A more detailed analysis of the results obtained employing the Laspeyres method is depicted in Figure 9. Following techno-economic factors, it was possible to make an analysis of the past variation in Spain. Following the Annex XIV, part 1 of the Energy Efficiency Directive [58]: "In sectors where energy consumption remains stable or is growing, Member States shall analyze the reasons for it and attach their appraisal to the estimates".
The activity effect is the measure of value added variation, very much linked to the economic setting. Since 1990, it has been the main effect that explains the variation, shown in Figure 9, of final energy growth. The economic activity trend was linked to the energy demand with a positive elasticity until the appearance of the recession period. Structural changes represent internal evolution with different energy intensities; the evolution of individual branches represents different global energy needs, and they did not grow at the same rate. The energy efficiency depended on technological improvements, fuel substitution, and highest output per unit. Let us now consider the Laspeyres multiplicative decomposition of energy demand, as depicted in Figure 8. A demand growth of 23% over 1990 was justified by a 50% growth in gross value added (GVA), a −10% reduction due to a structural change in economy (variations of weights between industry, services, and agriculture), and a −10% improvement in energy efficiency or energy use per  Following techno-economic factors, it was possible to make an analysis of the past variation in Spain. Following the Annex XIV, part 1 of the Energy Efficiency Directive [58]: "In sectors where energy consumption remains stable or is growing, Member States shall analyze the reasons for it and attach their appraisal to the estimates".
The activity effect is the measure of value added variation, very much linked to the economic setting. Since 1990, it has been the main effect that explains the variation, shown in Figure 9, of final energy growth. The economic activity trend was linked to the energy demand with a positive elasticity until the appearance of the recession period. Structural changes represent internal evolution with different energy intensities; the evolution of individual branches represents different global energy needs, and they did not grow at the same rate. The energy efficiency depended on technological improvements, fuel substitution, and highest output per unit.
Let us now consider the Laspeyres multiplicative decomposition of energy demand, as depicted in Figure 8. A demand growth of 23% over 1990 was justified by a 50% growth in gross value added (GVA), a −10% reduction due to a structural change in economy (variations of weights between industry, services, and agriculture), and a −10% improvement in energy efficiency or energy use per economic unit.
Around the year 2005, with the economic crisis, an inflection point was seen that invited a more detailed analysis considering two periods: pre-crisis (1990-2005) and post-crisis (2005)(2006)(2007)(2008)(2009)(2010)(2011)(2012)(2013)(2014)(2015). Figure 10 shows the results of that analysis, where a pre-crisis growth of energy demand can be seen, mainly based on the positive economic evolution of the country, followed by a post-crisis energy demand decrease, based primarily on a higher energy efficiency (intensity), and secondarily on the tertiarization of the economy (change of economy structure).   Figure 10 shows a different decomposition in both periods. In the second one, due to the crisis, there was a lower demand for energy in all branches of activity, but the contribution of the construction sector was particularly negative. After the crisis, Spain significantly reduced its energy requirements with an improvement of energy efficiency, reinforced by variation in structure branches with different energy intensity compositions, also reducing energy needs.

Population and Aggregated GDP Forecasting
Projections of the United Nations [59,60] estimate for Spain in the year 2030 a low scenario of 44.80 million inhabitants (−0.24%) against a high scenario of 47.37 million inhabitants (+0.18%), as depicted in Figure 11, similar predictions to those of the Spanish National Institute of Statistics [61], which forecast 45.89 million inhabitants, and which could be taken as a central and flat value used to compute the evolution of future energy demand.  Figure 10 shows a different decomposition in both periods. In the second one, due to the crisis, there was a lower demand for energy in all branches of activity, but the contribution of the construction sector was particularly negative. After the crisis, Spain significantly reduced its energy requirements with an improvement of energy efficiency, reinforced by variation in structure branches with different energy intensity compositions, also reducing energy needs.

Population and Aggregated GDP Forecasting
Projections of the United Nations [59,60] estimate for Spain in the year 2030 a low scenario of 44.80 million inhabitants (−0.24%) against a high scenario of 47.37 million inhabitants (+0.18%), as depicted in Figure 11, similar predictions to those of the Spanish National Institute of Statistics [61], which forecast 45.89 million inhabitants, and which could be taken as a central and flat value used to compute the evolution of future energy demand. Figure 10 shows a different decomposition in both periods. In the second one, due to the crisis, there was a lower demand for energy in all branches of activity, but the contribution of the construction sector was particularly negative. After the crisis, Spain significantly reduced its energy requirements with an improvement of energy efficiency, reinforced by variation in structure branches with different energy intensity compositions, also reducing energy needs.

Population and Aggregated GDP Forecasting
Projections of the United Nations [59,60] estimate for Spain in the year 2030 a low scenario of 44.80 million inhabitants (−0.24%) against a high scenario of 47.37 million inhabitants (+0.18%), as depicted in Figure 11, similar predictions to those of the Spanish National Institute of Statistics [61], which forecast 45.89 million inhabitants, and which could be taken as a central and flat value used to compute the evolution of future energy demand. Along with population forecasts, to make a projection of long-term energy demand, it is also essential to analyze the growth of the economy. As shown in Table 3, these two magnitudes (population and economy) have been the determining factors in the growth of CO2 emissions in Spain, having to be compensated with the improvement of energy and carbon intensity.
Regarding GDP growth, projections by the European Commission to 2030 [62] and the OECD [63] forecast the GDP growth of Spain at a 1.9% compound annual growth rate (CAGR). On the other hand, similar results (depicted in Figure 12) were obtained using the previously described time-series models. Along with population forecasts, to make a projection of long-term energy demand, it is also essential to analyze the growth of the economy. As shown in Table 3, these two magnitudes (population and economy) have been the determining factors in the growth of CO 2 emissions in Spain, having to be compensated with the improvement of energy and carbon intensity.
Regarding GDP growth, projections by the European Commission to 2030 [62] and the OECD [63] forecast the GDP growth of Spain at a 1.9% compound annual growth rate (CAGR). On the other hand, similar results (depicted in Figure 12) were obtained using the previously described time-series models.  Table 4. summarizes the total growth (% Δ) and the CAGR predicted using three time-series forecasting methods. The 2% GDP growth (CAGR) obtained using a linear regression time-series predictor was the same as the forecast published in a recent report driven by the Spanish Government [1]. This value is also very similar to the 1.9% EU and OECD predictions. For these reasons, linear regression was employed to make time-series predictions in the following sections of the paper.   Table 4 summarizes the total growth (% ∆) and the CAGR predicted using three time-series forecasting methods. The 2% GDP growth (CAGR) obtained using a linear regression time-series predictor was the same as the forecast published in a recent report driven by the Spanish Government [1]. This value is also very similar to the 1.9% EU and OECD predictions. For these reasons, linear regression was employed to make time-series predictions in the following sections of the paper.

Energy Demand Forecasting
To forecast the energy demand, the procedure described in Figure 3 was followed. The final energy demand was disaggregated into the n = 30 level-1 components described in Figure 2 and Table 1. Later, for the sake of representation, sectors 1 to 20 have been grouped into level-2 components (agriculture and forestry, industry and services).
The results are shown in Figure 13, where it can be seen that the energy demand of the activities related to transport represented the largest share of 2015 (42%), while the energy supplied to Industry, Services, and Agriculture represented 39%, and residential activities accounted for 18%. For factor decomposition, the Laspeyres method (Equations (9) and (11)) was employed because, as was shown earlier, it offered very similar results to LMDI and it is easier to understand. Thus, each of the n = 30 activity sectors was decomposed into f = 3 factors, obtaining a total of m = n· f = 30·3 = 90 time-series.
To obtain the 2030 horizon forecast for any of the m = 90 disaggregated time series, a linear regression method was then employed, because, as shown previously, it offered the most accurate predictions in population and GDP forecasts.
The results for the five most energy-demanding level-2 components (as described in Figure 2) are summarized in Figure 14.  Finally, in the third and last step of the proposed methodology (Figure 3), the m = 90 forecasted values were aggregated to obtain a prediction of the final energy demand. The results are depicted in Figure 15, where the level-2 components are also shown. Finally, in the third and last step of the proposed methodology (Figure 3), the = 90 forecasted values were aggregated to obtain a prediction of the final energy demand. The results are depicted in Figure 15, where the level-2 components are also shown.

Discussion
In Figure 16, the final energy demand (red line) and GDP (blue line) are compared. They show a coupled evolution in the pre-crisis period (1990)(1991)(1992)(1993)(1994)(1995)(1996)(1997)(1998)(1999)(2000)(2001)(2002)(2003)(2004)(2005). However, in the post-crisis scenario (2005-2030), they behave in an uncoupled way due to increasing energy efficiency, depicted in the graph by decreasing energy intensity (green line). Some other works have also addressed long-term energy demand prediction for Spain. The results of the present paper were compatible with the findings in Reference [38], which used a similar methodological approach. However, our approach had three main improvements: (a) it employed data spans to 2015 (instead of 2012), gaining a more precise overlook of the post-crisis period; (b) predictions involved the whole energy demand (and not only electricity), obtaining a more comprehensive view; and (c) through the Kaya identity, it was easier to obtain CO2 emissions, as they depend on the total energy demand.

Discussion
In Figure 16, the final energy demand (red line) and GDP (blue line) are compared. They show a coupled evolution in the pre-crisis period (1990)(1991)(1992)(1993)(1994)(1995)(1996)(1997)(1998)(1999)(2000)(2001)(2002)(2003)(2004)(2005). However, in the post-crisis scenario (2005-2030), they behave in an uncoupled way due to increasing energy efficiency, depicted in the graph by decreasing energy intensity (green line). Finally, in the third and last step of the proposed methodology (Figure 3), the = 90 forecasted values were aggregated to obtain a prediction of the final energy demand. The results are depicted in Figure 15, where the level-2 components are also shown.

Discussion
In Figure 16, the final energy demand (red line) and GDP (blue line) are compared. They show a coupled evolution in the pre-crisis period (1990)(1991)(1992)(1993)(1994)(1995)(1996)(1997)(1998)(1999)(2000)(2001)(2002)(2003)(2004)(2005). However, in the post-crisis scenario (2005-2030), they behave in an uncoupled way due to increasing energy efficiency, depicted in the graph by decreasing energy intensity (green line). Some other works have also addressed long-term energy demand prediction for Spain. The results of the present paper were compatible with the findings in Reference [38], which used a similar methodological approach. However, our approach had three main improvements: (a) it employed data spans to 2015 (instead of 2012), gaining a more precise overlook of the post-crisis period; (b) predictions involved the whole energy demand (and not only electricity), obtaining a more comprehensive view; and (c) through the Kaya identity, it was easier to obtain CO2 emissions, as they depend on the total energy demand. Some other works have also addressed long-term energy demand prediction for Spain. The results of the present paper were compatible with the findings in Reference [38], which used a similar methodological approach. However, our approach had three main improvements: (a) it employed data spans to 2015 (instead of 2012), gaining a more precise overlook of the post-crisis period; (b) predictions involved the whole energy demand (and not only electricity), obtaining a more comprehensive view; and (c) through the Kaya identity, it was easier to obtain CO 2 emissions, as they depend on the total energy demand.
The results presented in Reference [39], using an econometric model similar to our approach, were also compatible with our findings, confirming the post-crisis decoupling of economy and energy demand due to improvements in energy efficiency. However, our research presented three advantages: (a) it used a more detailed and precise disaggregation; (b) predictions involved the whole energy demand (and not only electricity); and (c) CO 2 emissions were more easily derived.
Energy is essential for the normal functioning of modern societies, although excessive energy consumption becomes a major problem. The energy resources of the planet have to be consumed in a rational way. Energy industry planners and policy makers need accurate tools for prediction.
The world needs energy to keep developing, with more people accessing better life conditions. Energy demand is closely related to the prosperity of people and the competitiveness of economies, which can be measured by the Human Development Index (HDI) [64]. Their relationship is plotted in Figure 17. The results presented in Reference [39], using an econometric model similar to our approach, were also compatible with our findings, confirming the post-crisis decoupling of economy and energy demand due to improvements in energy efficiency. However, our research presented three advantages: (a) it used a more detailed and precise disaggregation; (b) predictions involved the whole energy demand (and not only electricity); and (c) CO2 emissions were more easily derived.
Energy is essential for the normal functioning of modern societies, although excessive energy consumption becomes a major problem. The energy resources of the planet have to be consumed in a rational way. Energy industry planners and policy makers need accurate tools for prediction.
The world needs energy to keep developing, with more people accessing better life conditions. Energy demand is closely related to the prosperity of people and the competitiveness of economies, which can be measured by the Human Development Index (HDI) [64]. Their relationship is plotted in Figure 17.

Conclusions
The forecasting of energy demand is a key issue for making decisions on future investment needs, and also for monitoring energy policy objectives, both for the reduction of CO2 emissions and the improvement of energy efficiency. Knowledge of the evolution of demand is also the appropriate way to establish alternative plans to correct our course towards our goals and to carry out permanent monitoring.
Our methodological contribution offers a complement to both traditional and data-driven prediction techniques. The possibility of making an individualized projection for each explanatory key parameter separately improves the observability of each effect and trend in a method of "energy forecast by factorial decomposition." To the extent that each effect maintains its own trends of activity, efficiency, and structural changes separately, different forecasting techniques have been applied and more accurate predictions have been obtained.
The results found in this paper forecast an energy demand in Spain of 82 millions of tons of oil equivalent for the year 2030. Due to improvements in energy efficiency in the post-crisis period, a decoupling of economy and energy demand has been obtained, with a 30% decrease in energy intensity for the period 2005-2030.
In the coming years, energy demand will continue to grow due to the increasing population and economic development. World future scenarios show a significant increase in energy demand due to the human development of less developed economies. For Spain, our research concluded that energy demand will remain stable in the next decade, despite the foreseen 2% annual growth of its economy. The factorial decomposition methodology used through the paper showed that it is possible to decouple economic growth and energy demand via improved energy efficiency.
Finally, from the energy offer perspective, in the future it will not be affordable to supply energy demand using fossil fuels. Despite their enormous energy concentration and density, they represent

Conclusions
The forecasting of energy demand is a key issue for making decisions on future investment needs, and also for monitoring energy policy objectives, both for the reduction of CO 2 emissions and the improvement of energy efficiency. Knowledge of the evolution of demand is also the appropriate way to establish alternative plans to correct our course towards our goals and to carry out permanent monitoring.
Our methodological contribution offers a complement to both traditional and data-driven prediction techniques. The possibility of making an individualized projection for each explanatory key parameter separately improves the observability of each effect and trend in a method of "energy forecast by factorial decomposition." To the extent that each effect maintains its own trends of activity, efficiency, and structural changes separately, different forecasting techniques have been applied and more accurate predictions have been obtained.
The results found in this paper forecast an energy demand in Spain of 82 millions of tons of oil equivalent for the year 2030. Due to improvements in energy efficiency in the post-crisis period, a decoupling of economy and energy demand has been obtained, with a 30% decrease in energy intensity for the period 2005-2030.
In the coming years, energy demand will continue to grow due to the increasing population and economic development. World future scenarios show a significant increase in energy demand due to the human development of less developed economies. For Spain, our research concluded that energy demand will remain stable in the next decade, despite the foreseen 2% annual growth of its economy. The factorial decomposition methodology used through the paper showed that it is possible to decouple economic growth and energy demand via improved energy efficiency.
Finally, from the energy offer perspective, in the future it will not be affordable to supply energy demand using fossil fuels. Despite their enormous energy concentration and density, they represent the waste of a stored energy reservoir to supply the needs of a few moments in humankind history. The consolidation of renewable energies and increasing energy efficiency will reduce future need of fossil fuels.

Conflicts of Interest:
The authors declare no conflict of interest.

Appendix A
The equations defining Laspeyres decomposition can be obtained from (3). Taking derivatives, That is, the change of energy consumption is due to three components: change in the total level of activity; change in the structure of the economy; and change in the energy intensity. This result can be written as: Let us now consider any of these components, for instance the activity component. In this case: The change of energy consumption due to a change in the total level of activity, for a period of time between t 0 and T, can be expressed as: where ε

(i)
A summarizes the approximation errors for the total level of activity of the i-th sector; and t * is an approximate intermediate time in the interval [t 0 , T]. Laspeyres Decomposition uses the approximation t * = t 0 , so Analogously, the other two components are defined as: For the activity component in (6) it can be written that (A11) Calling it can be written that or more compactly, Analogously, the other two components are Finally, the increasing of energy demand is decomposed as Let us now consider the ratio of energy increasing demand R E as it is expressed in (1010). For a change in the activity component it can be written that Analogously, the other two components are The product of the three decomposed factors is In the common case where ∆E A , ∆E S , ∆E I E 0 Recalling Equation (9) it can be written that For the activity component, let us substitute Equation (7) in Equation (A18) Analogously, the other two components are Finally, the increasing of energy demand is multiplicatively decomposed as

Appendix B
To derive the Logarithmic Mean Divisia Index (LMDI) decomposition, let us first consider the energy consumption of the i-th sector, which can be written as The change of energy consumption due to a change in the total level of activity, for a period of time between t 0 and T, can be expressed as where E (i) (t * ) is an approximate intermediate value of E (i) in the interval [t 0 , T]. LMDI decomposition uses for the approximation the logarithmic mean, that is, So, It can be shown that the value of the logarithmic mean is between the arithmetic and geometric means, that is, Considering now the activity component of the n sectors of the economy, we obtain (A37) or more compactly, Analogously, the other two components are