A Novel Harmony Search Algorithm for One-Year-Ahead Energy ...

0 downloads 0 Views 166KB Size Report
Sancho Salcedo-Sanz1, José Antonio Portilla-Figueras1, Jesús Mu˜noz-Bulnes1,. Javier del Ser2 ... In this paper we tackle a problem of one-year ahead energy.
A Novel Harmony Search Algorithm for One-Year-Ahead Energy Demand Estimation Using Macroeconomic Variables Sancho Salcedo-Sanz1 , Jos´e Antonio Portilla-Figueras1, Jes´ us Mu˜ noz-Bulnes1 , 2 3 Javier del Ser , and Miren Nekane Bilbao 1

Universidad de Alcal´ a, Alcal´ a de Henares, Madrid, Spain 2 Tecnalia Research & Innovation, Bilbao, Spain 3 Universidad del Pa´ıs Vasco, Bilbao, Spain

Abstract. In this paper we tackle a problem of one-year ahead energy demand estimation from macroeconomic variables. A modified Harmony Search (HS) algorithm is proposed to this end, as one of the novelties of the paper. The modifications on the proposed HS include a hybrid encoding, with a binary part to carry out a feature selection, and a real part, to select the parameter of a given prediction model. Some other adaptation focussed on the HS operators are also introduced. We study the performance of the proposed approach in a real problem of Energy demand estimation in Spain, from 14 macroeconomic variables with values for the last 30 years, including years of the crisis, from 2008. The performance of the proposed HS with feature selection is excellent, providing an accurate one year ahead prediction that improves previous proposals in the literature.

1

Introduction

Energy demand has increased exponentially worldwide in the last decades, pushed by globalization, rapid population growth, aggressive industrialization of developing countries and high standard of life in developed countries [1]. It is well known that, as the economy grows, the energy demand increases exponentially, what brings important environmental issues that may compromise the future of new generations. Currently, 80% of the energy demand in the world is covered with non-renewable sources of energy, such as coal or petroleum, and this figure is even more dramatic in developing countries. Another thing to be taken into account is that industry is the responsible for over 50% of energy demand in the world, so countries expanding their industrial sector are more energy demanding than other with economies based on other sectors. Managing medium and long-term energy demand has become an important problem in all countries in the world, with impact in countries’ economies and nations’ development. Note that some years ago, different studies forecasted an increasing in energy demand over 50% in the next 20 years, in what it seemed and unstoppable process [2–6]. However, all these forecasting and future projections completely failed after the deep world crisis that started in 2008, and we are still living. J.G. de la Puerta et al. (eds.), International Joint Conference SOCO’14-CISIS’14ICEUTE’14, Advances in Intelligent Systems and Computing 299, c Springer International Publishing Switzerland 2014 DOI: 10.1007/978-3-319-07995-0_25, 

251

252

S. Salcedo-Sanz et al.

The main problem with energy demand estimation problems at a national level is that they depend on macroeconomic variables, that are calculated annually in the majority of cases. Thus, there are not many available data to construct prediction models for energy demand estimation (it is straightforward that the economies of the world 30 years ago were completely different to the current ones, so we cannot going much further than that in order to consider macroeconomic data for energy demand estimation). The first work to tackle this problem was [3], where a genetic algorithm (GA) was used to obtain the parameters of the prediction model. The model proposed in [3] is based on four input macroeconomic variables (GDP, population, import size and export size for Turkey), with data from the early 80’s to the first years of 2000. The prediction of the energy demand at the same year that the input variables is considered (affecting factors are studied for the same year, instead of considering the prediction at a given time horizon). Two different models (linear and exponential), where considered. The GA was a basic binary algorithm, with standard crossover and flip mutation, and a tournament selection. The objective function to be optimized was a measure of mean quadratic error between the real data and the result given by the model, in a training set (part of the available data). With the models obtained, it is possible to obtain projection of energy demand in the future, by projecting variations in the affecting factors (input variables). In this case, future projections forecasted a continuous increasing of the energy demand in Turkey in the next 20 years. To the best of our knowledge, alternative approaches to this problem follow the same methodology, and only consider affecting factors for the energy demand estimation, without tackling a real prediction problem (with a given time horizon prediction, 1 year ahead for example). The majority of works are focused on improving the methodology used, such as several works where Particle Swarm Optimization is applied [4, 5], or a hybrid approach based on PSO and Ant Colony Optimization (ACO) [7]. Another hybrid approach mixing PSO and GAs has been proposed in some recent papers [6, 8, 9] for energy demand estimation in the special case of China. Other approaches have been focussed on looking for different prediction models, different from the linear and exponential ones used in [3]. Thus, in [10] several new models based on logarithmic and alternative exponential functions are used, optimized by a real encoding genetic algorithm. All these previous approaches consider a reduced number of affecting factors (input variables), and the projections obtained show a continuous increasing of the energy demand in the next years. In all cases the training years do not include data beyond 2005, so all the years after the 2008 crisis are missing. In this paper we tackle the problem of energy demand estimation from a new perspective. First, we focus on a prediction problem: one year ahead energy demand prediction. This is a major difference with previous approaches. In addition, we consider a larger number of predictive (input) variables than previous approaches, with a procedure of feature selection to obtain the best set of input variables that can be considered. We propose the use of a Harmony Search (HS) algorithm [11], a new evolutionary-type approach based on music

Harmony Search for Energy Demand Estimation

253

generation and improvisation, which has obtained very good results in a good number of applications [12]. We fully describe the approach proposed and we test its performance in a real problem of one year ahead energy demand prediction in Spain. The rest of the paper has been structured as follows: next section introduces the problem tackled and describes the basics of the HS algorithm, giving details on the specific encoding and objective function used. Section 3 shows the performance of the proposed algorithm in a real case of energy demand prediction in Spain. Section 4 closes the paper with some final conclusions and remarks.

2

Energy Demand Estimation with the HS Algorithm

This section introduces the HS we propose to tackle the problem of one year ahead energy demand estimation. First, we state the problem definition, and then we present the modified HS proposed in this paper. 2.1

Problem Definition

Let us considered a time series of past energy demands for a given country, with n discrete values (corresponding to different years) E = [E(t)], t = 1, . . . , n, and a set of m predictive variables X = [X1 (t), · · · , Xm (t)], t = 1, . . . , n. Consider a given estimation model for E, in this case an exponential-based one with one year ahead prediction: ˆ + 1) = E(t

T 

wi Xi (t)wi+T + w0

(1)

i=1

where T is the number of input variables (T ≤ m), and W = {w0 , w1 , . . . , w2T } is a vector of 2T + 1 weights that describe the model. The problem consists in choosing the best set of T variables out of the m possible in X , and the optimal values for the components of W that minimizes a given objective function, related to the similarity of the model to the real energy demand values. In this case, we consider a mean squared error to be minimized: n∗ 2 1  ˆ E(j) − E(j) f (X , W) = ∗ n j=1

(2)

where n∗ is a the size of a reduced training sample (n∗ < n). 2.2

HS Basics

The Harmony Search (HS) algorithm, firstly proposed by Geem et al. in [11], is a metaheuristic approach, derivative-free, that has shown very good performance in different optimization problems [12]. It mimics the behavior of a music orchestra in the process of music composition, so it borrows concepts from that

254

S. Salcedo-Sanz et al.

field, such as harmony, notes, pitch, improvisation, etc. [13, 14]. In essence, this technique iterates on a set of ϕ possible solutions or harmonies commonly denoted as Harmony Memory (HM), which are evaluated at each iteration under an aesthetic point of view. The Harmony Memory is updated whenever any of the ϕ improvised harmonies at a given iteration sounds better (under a certain fitness criterion) than any of the ϕ harmonies kept from the previous iteration. This procedure is repeated until a maximum number of iterations I is reached. At each iteration of the algorithm, the improvisation process is applied sequentially to each note of the total set of melodies. The harmony improvisation process of the HS algorithm is driven by two probabilistic parameters: 1) Harmony Memory Considering Rate, HMCR; and 2) Pitch Adjusting Rate, PAR. 1. The Harmony Memory Considering Rate, HMCR ∈ [0, 1], sets the probability that the new value for a certain note is drawn uniformly from the values of this same note in the other ϕ − 1 harmonies. 2. The Pitch Adjusting Rate, PAR ∈ [0, 1], executes subtle adjustments in the chosen harmony. This parameter operates note-wise as follows: the note to which the parameter is being applied will be reassigned to the null group with a probability of 50%. Otherwise (remaining 50%), the new note value is picked from its neighbor value (upper or lower, with equal probability) in the range {1, . . . , n}. 2.3

Problem Encoding and HS Specific Adaptations

We consider a hybrid encoding for the problem in the HS, consisting of a binary part for feature selection, and a weights part, which encodes the weights to be used in Equation (1). Note that the number of 1s in the binary part of the encoding, conditions the number of weights to be optimized in the weights part. In order to avoid an encoding with variable length, we keep constant the number of 1s in the binary part, by applying a restricted search operator [15], which sets the number of 1s in the binary part to be constant, by adding or removing 1s when this number is different from the defined one. Another important point is that the input variables X are considered to be normalized in the interval [0, 1] (just dividing its actual value by a power of 10). This step avoid having problems of scale with the regression model given by Equation (1). With this in mind, the weights in Equation (1) are considered to be in the interval [-1,1], but the bias, that we have considered to be in [-5,5], for it to provide some margin for a better fit. An example of the encoding of a given harmony in the algorithm is the following (15 possible input variables are available, 4 of them are selected): [1 0 0 0 1 0 0 0 0 0 0 1 0 1 0 | −3.4 0.8 −0.13 0.54 0.83 −0.64 0.41 0.02 − 0.19] Regarding the HS adaptations to tackle this problem, we have considered an adaptive value of the HMCR parameter, linearly increasing from 0.7 to 0.95 with generations. The PAR parameter is also linearly increased with generations from 0.1 to 0.5. In the binary part of each harmony, we consider a different PAR

Harmony Search for Energy Demand Estimation

255

adjustment: instead of implementing a random mutation with a bandwidth, we substitute each bit by the corresponding one in the best solution obtained to this moment by the algorithm, as suggested in [16].

3

Experimental Part

In order to test the performance of the proposed approach, we have tackled a real problem of energy demand estimation in Spain. Data from 1980 to 2011 are available, with a total of 14 predictive variables, described in Table 1. A partition of these data into train and test sets is carried out, in such a way that 15 data (years) are selected for training and 16 data for test, we have kept values of years 2010 and 2011 within the test set for checking out the performance of the approach in year of crisis, and the rest of data have been randomly chosen to belong to the test or train sets. Table 1. Variables considered in this problem of energy demand estimation. The first 4 variables correspond to the study in [3]. # 1 2 3 4 5 6 7 8 9 10 11 12 13 14

variable GDP Population Export Import Energy Production (kTOE) Electricity power transport (kWh) Electricity production(kWh) GDP per unit of energy use Energy imports net (% of use) Fossil fuel consumption (% of total) Electric power consumption (kWh) CO2 emissions total (Mtons) Unemployment rate Diesel consumption in road (kTOE)

Table 2 shows a comparison of the relative MAE (in %) obtained with the proposed HS with feature selection, and the result of the GA proposed in [3], in which the fist 4 variables in Table 1 are considered, for this problem in Spain. In order to compare both approaches, we have set the number of variables (number of 1s in the binary part of the HS) to 4. Ten runs of each algorithm has been launched, keeping the best and average values of the MAE for the prediction in the test set. As can be seen, the performance of the proposed HS is better than the algorithm in [3], both in the average of the 10 runs and in the best result obtained. Figure 1 shows the energy demand prediction versus the real values, in the test set considered, for the algorithms compared. Recall that the

256

S. Salcedo-Sanz et al.

Table 2. Comparison of the relative error (%) obtained with the proposed HS and the algorithm in [3] for the problem of energy demand estimation in Spain Algorithm

Relative error Relative error variables selected best in (%) average of 10 runs in (%) (best run) HS with FSP 2.60 4.03 1, 3, 7, 10 GA [3] 2.89 4.43 1, 2, 3, 4 4

11

x 10

10 Real Predicted Energy demand (kTOE)

9

8

7

6

5

4 1.981

1.986

1.991

1996 Test samples

2001

2006

2011

2001

2006

2011

(a) 4

11

x 10

10 Real Predicted Energy demand (kTOE)

9

8

7

6

5

4 1981

1986

1991

1996 Test samples

(b) Fig. 1. Real energy consumption versus prediction in the test set considered; (a) HS with FSP; (b) GA [3]

energy demand is predicted for t + 1, from input variables measured in t. As can be seen, the prediction fits really well with the real curve, even in the crisis years (from 2008). It is easy to see how the proposed HS approach improves the GA performance in the years near the crisis (from 2008). Another interesting analysis point are the 4 variables selected in this study with the HS (1, 3, 7 and 10). Variable 1 is the GDP of the country the year before the energy estimation is considered (t). Variable 3 is the export figure of the country in t,

Harmony Search for Energy Demand Estimation

257

7 is the electricity production in t, and finally variable 10 stands for the fossil fuel consumption in t. It seems that these 4 variables are better inputs than the variables proposed in [3] (export, import, GDP and population) to solve this problem of one-year-ahead energy demand estimation. In fact, it seems quite reasonable the presence of variables such as energy and fossil fuel consumption in the estimation of the total energy demand for next year.

4

Conclusions

In this paper we have presented a novel approach to estimate one-year ahead energy demand in Spain from Macroeconomic predictive. We propose the use of a modified Harmony Search (HS) algorithm in which we have incorporated several improvements to enhance its performance. Unlike previous approaches to the same application, we consider a large number of predictive variables, and we incorporate a mechanism of feature selection in the HS, by including a binary part in the problem’s encoding. We have analyzed the performance of the proposed approach in a real problem of energy demand in Spain, considering data from the last 30 years. The comparison is carried out against an existing approach with four fixed predictive variables (without feature selection). We have shown that the proposed approach is able to obtain better predictions in energy demand estimation than this previous proposal to the problem. Acknowledgements. This work has been partially supported by Spanish Ministry of Science and Innovation, under project number ECO2010-22065-C03-02.

References 1. Suganthi, L., Samuel, A.A.: Energy models for demand forecasting – A review. Renewable and Sustainable Energy Reviews 16, 1223–1240 (2012) 2. CSIRO and the Natural Edge Project. Energy Transformed: sustainable energy solutions for climate change mitigation, p. 6 (2007) 3. Ceylan, H., Ozturk, H.K.: Estimating energy demand of Turkey based on economic indicators using genetic algorithm approach. Energy Conversion and Management 45, 2525–2537 (2004) ¨ 4. Unler, A.: Improvement of energy demand forecasts using swarm intelligence: The case of Turkey with projections to 2025. Energy Policy 36, 1937–1944 (2008) ¨ 5. Kiran, M.S., Ozceylan, E., G¨ und¨ uz, M., Paksoy, T.: Swarm intelligence approaches to estimate electricity energy demand in Turkey. Knowledge-Based Systems 36, 93– 103 (2012) 6. Yu, S., Zhu, K.J.: A hybrid procedure for energy demand forecasting in China. Energy 37, 396–404 (2012) ¨ 7. Kiran, M.S., Ozceylan, E., G¨ und¨ uz, M., Paksoy, T.: A novel hybrid approach based on Particle Swarm Optimization and Ant Colony Optimization to forecast energy demand of Turkey. Energy Conversion and Management 53, 75–83 (2012) 8. Yu, S., Wei, Y.M., Wang, K.: A PSO-GA optimal model to estimate primary energy demand of China. Energy Policy 42, 329–340 (2012)

258

S. Salcedo-Sanz et al.

9. Yu, S., Zhu, K., Zhang, X.: Energy demand projection of China using a pathcoefficient analysis and PSO-GA approach. Energy Conversion and Management 53, 142–153 (2012) 10. Piltan, M., Shiri, H., Ghaderi, S.F.: Energy demand forecasting in Iranian metal industry using linear and nonlinear models based on evolutionary algorithms. Energy Conversion and Management 58, 1–9 (2012) 11. Geem, Z.W., Hoon Kim, J., Loganathan, G.V.: A New Heuristic Optimization Algorithm: Harmony Search. Simulation 76(2), 60–68 (2001) 12. Manjarres, D., Landa-Torres, I., Gil-Lopez, S., Del Ser, J., Bilbao, M.N., SalcedoSanz, S., Geem, Z.W.: A survey on applications of the harmony search algorithm. Engineering Applications of Artificial Intelligence 26, 1818–1831 (2013) 13. Geem, Z.W.: Novel derivative of harmony search algorithm for discrete design variables. Applied Mathematics and Computation 199(1), 223–230 (2008) 14. Geem, Z.W., Sim, K.B.: Parameter-setting-free harmony search algorithm. Applied Mathematics and Computation 217(8), 3881–3889 (2010) 15. Salcedo-Sanz, S., Camps-Valls, G., P´erez-Cruz, F., Sep´ ulveda-Sanchis, J., Bouso˜ noCalz´ on, C.: Enhancing genetic feature selection through restricted search and Walsh analysis. IEEE Transactions on Systems, Man and Cyberntics–Part C 34(4) (2004) 16. Wang, L., Yang, R., Xu, Y., Niu, Q., Pardalos, P.M., Fei, M.: An improved adaptive binary Harmony Search algorithm. Information Sciences 232, 58–87 (2013)