# Short-Term Load Forecasting Based on Wavelet Transform and Least Squares Support Vector Machine Optimized by Fruit Fly Optimization Algorithm

Authors: Wei Sun; Minquan Ye
Journal: Journal of Electrical and Computer Engineering
 (2015)

---

## Abstract

Electric power is a kind of unstorable energy concerning the national welfare and the people’s livelihood, the stability of which is attracting more and more attention. Because the short-term power load is always interfered by various external factors with the characteristics like high volatility and instability, a single model is not suitable for short-term load forecasting due to low accuracy. In order to solve this problem, this paper proposes a new model based on wavelet transform and the least squares support vector machine (LSSVM) which is optimized by fruit fly algorithm (FOA) for short-term load forecasting. Wavelet transform is used to remove error points and enhance the stability of the data. Fruit fly algorithm is applied to optimize the parameters of LSSVM, avoiding the randomness and inaccuracy to parameters setting. The result of implementation of short-term load forecasting demonstrates that the hybrid model can be used in the short-term forecasting of the power system.


---

## Body

## 1. Introduction

Power load forecasting is an important part of management modernization of electric power systems, which has attracted more and more attentions from the academic circle and the practice. Power load forecast with high precision can ease the contradiction between power supply and demand, providing a solid foundation for the stability and reliability of the power grid. It can avoid the waste of resources in the process of grid scheduling and improve the economic benefit. Thus, improving load forecasting methods and the accuracy of prediction constantly is of great important significance to formulate the economic and better power generation plan, reduce spinning reserve capacity, analyse power market demand, and so forth. However, the power load will be influenced by many factors, so features like irregularity and linear independence do exist, which result in the difficulty in making accurate predictions to the power load.At present, the methods for load forecasting can be divided into two parts: classical mathematical statistical methods and approaches based on artificial intelligence. Most load forecasting theories are based on time series analysis and autoregression models, including vector autoregression model (VAR) and autoregressive moving average model (ARMA) [1–5]. Time series smoothness prediction methods are criticized by researchers for their weakness of nonlinear fitting capability. With the development of the electricity market, the requirement of high accuracy load forecasting is more strict and efficient. So artificial intelligence, which includes neural network [6–8], grey model [9, 10], and support vector machine [11], gains more and more attention from scholars. Due to the strong self-learning, self-adapting ability, and nonlinear change character, artificial neural network is widely used in prediction field. Kandil et al. [12] applied artificial neural network (ANN) for short-term load forecasting without the use of load history and only temperature was used, and it was proved to be effective. After that, BPNN [13] and GRNN [14] are used in improving ANN model for excellent predictive abilities. The shortcomings of neural networks are the requirement of a large amount of data, a long time solving which may cause easily falling into local optimum.Support vector machine (SVM) is a new statistical learning method [15]. Compared with other machine learning methods, SVM implement the structural risk minimization principle to minimize an upper bound on the generalization error, rather than employing the empirical risk minimization principle to minimize the training error, and it gives SVMs better generative performance. As an extension of SVM, least squares support vector machine (LSSVM) transforms the second optimal inequality constraints problem in original space into equality constraints’ linear system in feature space through nonlinear mapping [16], which improved the speed and accuracy of convergence. Different parameters selection in LSSVM (Kernel parameter and penalty factor) would have big influences on the fitting accuracy and generalization ability; inappropriate parameter selection may lead to the limitation of the performance of LSSVM. However, it is possible to employ an optimization algorithm to obtain an appropriate parameter combination. Particle swarm optimization model [17], genetic algorithm model [18], and Firefly Algorithm [19] model are all proposed in parameter optimization for LSSVM; for example, particle swarm optimization finds overall optimal value by following the currently found optimal values. But premature convergence and easily falling into local optimum restrict the application of the particle swarm optimization. Thus, this paper puts forward fruit fly optimization model to optimize the parameters of LSSVM. Fruit fly optimization algorithm was proposed by Pro. Pan [20] in Taiwan in 2012. The FOA has the advantages of being easy to understand due to the shorter program code compared with other optimization algorithms and reaching a better global optimal solution. Li et al. [21] applied the FOA to optimize the parameters of GRNN in order to forecast the annual power load. Zheng et al. [22] proposed a novel fruit fly algorithm for the semiconductor final testing scheduling problem. Pan et al. [23] developed an improved FOA algorithm for continuous function optimization problems.The wavelet transform (WT) is a recently developed mathematical tool for signal analysis. It has been applied successfully in astronomy, data compression, signal and image processing, earthquake prediction, and so on [12]. The combination of WT and LSSVM is widely used in forecasting fields [24, 25]. This paper proposes WT to reprocess the data and improve its reliability. In order to enhance the accuracy of load forecasting, WT-FOA-LSSVM is put up with, and the examples demonstrate the effectiveness of the model.The rest of the paper is organized as follows: Section2 provides some basic theoretical aspects of WT, LSSVM, and FOA and gives a brief description about WT-FOA-LSSVM model; in Section 3, an experiment study is put forward to prove the efficiency of the proposed model; Section 4 is the conclusion of this paper.


## 2. WT-FOA-LSSVM Model

### 2.1. Wavelet Transform

Wavelet transform is a mathematical tool for signal analysis which developed in recent decades. It can capture the frequency and location information of the input signal. The basic concept in wavelet transform is to decompose a signal into an approximation component and detail components, in which approximation component is the low-frequency information and contains the important information of the signal. The details are the high-frequency components which are related to the small-scale space in the signal. Figure1 is a wavelet decomposition tree showing the decomposition process.Figure 1
Wavelet decomposition.In order to overcome the high redundancy situation which exists in continuous wavelet transform, it captures both frequency and location information in temporal resolution. We propose the discrete wavelet transform (DWT) in this paper, and it is defined as follows:(1)
ψ
a
,
b
t
=
ψ
1
/
2
j
,
k
/
2
j
t
=
2
j
/
2
ψ
2
j
t
-
k
,where the scale factor a
=
1
/
2
j, j
∈
Z, and the displacement factor b
=
k
/
2
j, j
∈
Z. In general, ψ
j
,
k
(
t
) represents the discrete transform. Using DWT in the signal f
(
x
), the formula can be shown as(2)
W
ψ
f
j
,
k
=
f
,
ψ
j
,
k
t
=
∫
-
∞
+
∞
f
t
ψ
j
,
k
t
¯
d
t
.In this paper, the original load signal is proposed to be decomposed into an approximation component and some detail components. The approximation presents the main fluctuation of the load and the details to contain the spikes and stochastic volatilities. A suitable number of levels can be decided by comparing the similarity between the approximation and the original signal.


### 2.2. Least Squares Support Vector Machine

LSSVM is an extension of the standard support vector machine (SVM), proposed by Suykens and Vandewalle [26]. It transforms the inequality constraints of traditional SVM into equality constraints and considers sum squares error loss function as the loss experience of the training set, which transforms solving quadratic programming problems into solving linear equations problems [27]. The training set is set as {
(
x
k
,
y
k
)
∣
k
=
1,2
,
…
,
n
}, in which x
k
∈
R
n is the input data and y
k
∈
R
n is the output data. φ
(
·
) is the nonlinear mapping function which transfers the samples into a much higher dimensional feature space ϕ
(
x
k
). Establish the optimal decision function in the high-dimensional feature space:(3)
y
x
=
ω
T
·
φ
x
+
b
,where φ
x is mapping function; ω is weight vector; b is constant.Using the principle of structural risk minimization, the objective optimization function is as follows:(4)
min
ω
,
b
,
e
⁡
ω
,
e
=
1
2
ω
T
ω
+
1
2
γ
∑
k
=
1
n
e
k
2
.Its constraint condition is(5)
y
k
=
ω
T
φ
x
k
+
b
+
e
k
,
k
=
1,2
,
…
,
n
,in which γ is the penalty coefficient and e
k is slack variable.Define the Lagrange function to solve the problem:(6)
L
ω
,
b
,
e
,
α
=
ϕ
ω
,
e
-
∑
k
=
1
n
α
k
ω
T
φ
x
k
+
b
+
e
k
-
y
k
,where Lagrange multiplier α
k
∈
R. According to the Karush-Kuhn-Tucker (KKT) conditions, ω
,
b
,
e
k
,
α
k are taken as partial derivatives and required as zero. Consider(7)
ω
=
∑
k
=
1
n
α
k
φ
x
k
,
∑
k
=
1
n
α
k
=
0
,
α
k
=
e
k
γ
,
ω
T
φ
x
k
+
b
+
e
k
-
y
k
=
0
.According to (7), the optimization problem can be transformed into solving linear problem, which is shown as follows:(8)
0
1
⋯
1
1
K
x
1
,
x
1
+
1
γ
⋯
K
x
1
,
x
l
⋮
⋮
⋮
⋮
1
K
x
l
,
x
1
⋯
K
x
l
,
x
l
+
1
γ
b
α
1
⋮
α
l
=
0
y
1
⋮
y
l
.Solve formula (8) to get α and b; then the LSSVM optimal linear regression function is(9)
f
x
=
∑
k
=
1
l
α
k
K
x
,
x
k
+
b
.According to Mercer condition,K
(
x
,
x
i
)
=
φ
(
x
)
T
·
φ
(
x
l
) is kernel function. In this paper, set radial basis function (RBF) as kernel function which is shown in the following equation: (10)
K
x
,
x
k
=
exp
⁡
-
x
-
x
k
2
2
σ
2
,where σ
2 is the width of kernel function.From the problems of training LSSVM, kernel parameterσ
2 and penalty parameter γ are generally set based on experience, which leads to the existence of randomness and inaccuracy in the application of the LSSVM algorithm. To solve the problem, the paper uses fruit fly optimization algorithm to optimize these two parameters to improve the prediction accuracy of LSSVM.


### 2.3. Fruit Fly Optimization Algorithm

Fruit fly optimization algorithm is a kind of intelligent optimization algorithms based on fruit fly foraging behaviours proposed by Pan [20] in 2012. The basic concept of FOA is that fruit fly perceives food concentration according to its position, and then it will move to the site of maximum or minimum concentration by comparing flavor concentration; finally the objective function extreme value can be obtained through repeated iterations of food concentration. Food finding iterative process of fruit fly swarm is shown in Figure 2.Figure 2
Food finding iterative process of a fruit fly swarm.According to the food finding characteristics of fruit fly swarm, the fruit fly optimization algorithm can be divided into following steps:(1) Randomly initialize the fruit fly swarm location(
x
_
a
x
i
s
,
y
_
a
x
i
s
).(2) Give the random flight direction and the distance for food finding of an individual fruit fly by using olfactory:(11)
X
i
=
x
_
axis
+
Random Value
Y
i
=
y
_
axis
+
Random Value
.(3) Calculate the distance between the origin and each individual fruit fly position (Dist), and then calculate the value of flavor concentration (S); it is the reciprocal of distance: (12)
Dist
=
X
i
2
+
Y
i
2
(13)
S
=
1
Dist
.(4) Put the value of flavor concentrationS into its fitness function, and then get the flavor concentration of the individual fruit fly location (Smell).(5) Find out the individual fruit fly with minimal smell concentration among the fruit fly swarm:(14)
best Smell
,
best index
=
max
⁡
Smell
.(6) Retain the best flavor concentration and itsX, Y coordinates, and then the fruit flies fly to the position by using vision. Enter iterative optimization to repeat steps (2)–(5). When the fitness value reaches target set, or the iterative number reaches the maximal iterative number, the circulation stops. Update the information as follows:(15)
Smell best
=
best Smell
x
_
axis
=
X
best index
y
_
axis
=
Y
best index
.


### 2.4. The Introduction of WT-FOA-LSSVM

Flowchart of the WT-FOA-LSSVM model is shown in Figure3, and the detailed processes are as follows.Figure 3
Flowchart of the WT-FOA-LSSVM modeling.(1
) Data Preprocessing Using DWT. Decompose the load signal into the approximation A1 and the details D1, and select A1 as the training data and testing data.(2
) Initialization of the Fruit Fly Optimization Algorithm Parameters. Fruit fly optimization algorithm parameters contain the initial fruit fly swarm location (
x
_
a
x
i
s
,
y
_
a
x
i
s
), the random flight distant range F
R, the population size s
i
z
e
p
o
p, and the maximum iterative number N
m
a
x. In this paper, we set x
_
a
x
i
s
=
r
a
n
d
s
(
1,2
), y
_
a
x
i
s
=
r
a
n
d
s
(
1,2
), where r
a
n
d
s
(
) represents the random number generation function in MATLAB program. In addition, we suppose F
R
⊂
[
-
10,10
], s
i
z
e
p
o
p
=
50, and N
m
a
x
=
100.(3
) LSSVM Optimized by Fruit Fly Optimization Algorithm. Calculate the distance D
i between the origin and each individual fruit fly i according to formulas (11) and (12) and the smell concentration judgment value S
i according to formula (13). In the FOA-LSSVM program, the parameters [
C
,
σ
2
] of LSSVM model are represented by [
S
(
i
,
1
)
,
S
(
i
,
2
)
], and we set C
=
20
∗
S
(
i
,
1
) and σ
2
=
S
(
i
,
2
) for LSSVM model training. According to the electric load forecasting result, the value of fitness function can be calculated. In this paper, we employ the mean absolute percentage error (MAPE) as the fitness function, and the formula is as follows:(16)
MAPE
=
1
n
∑
i
=
1
n
y
^
i
-
y
i
y
i
,where y
i represents the actual value at period i; y
^
i is the forecasting value at period i and n is the number of forecasting periods.If the maximum iterative numberN
m
a
x
=
100 or M
A
P
E
<
0.01
%, stop the iterative process and output the best values of C and σ
2.(4
) Forecast Using Least Squares Support Vector Machine. Put the optimal parameter value obtained from step (3) in the least squares support vector machine and do the forecast. Finally, get the forecasting load value.


## 2.1. Wavelet Transform

Wavelet transform is a mathematical tool for signal analysis which developed in recent decades. It can capture the frequency and location information of the input signal. The basic concept in wavelet transform is to decompose a signal into an approximation component and detail components, in which approximation component is the low-frequency information and contains the important information of the signal. The details are the high-frequency components which are related to the small-scale space in the signal. Figure1 is a wavelet decomposition tree showing the decomposition process.Figure 1
Wavelet decomposition.In order to overcome the high redundancy situation which exists in continuous wavelet transform, it captures both frequency and location information in temporal resolution. We propose the discrete wavelet transform (DWT) in this paper, and it is defined as follows:(1)
ψ
a
,
b
t
=
ψ
1
/
2
j
,
k
/
2
j
t
=
2
j
/
2
ψ
2
j
t
-
k
,where the scale factor a
=
1
/
2
j, j
∈
Z, and the displacement factor b
=
k
/
2
j, j
∈
Z. In general, ψ
j
,
k
(
t
) represents the discrete transform. Using DWT in the signal f
(
x
), the formula can be shown as(2)
W
ψ
f
j
,
k
=
f
,
ψ
j
,
k
t
=
∫
-
∞
+
∞
f
t
ψ
j
,
k
t
¯
d
t
.In this paper, the original load signal is proposed to be decomposed into an approximation component and some detail components. The approximation presents the main fluctuation of the load and the details to contain the spikes and stochastic volatilities. A suitable number of levels can be decided by comparing the similarity between the approximation and the original signal.


## 2.2. Least Squares Support Vector Machine

LSSVM is an extension of the standard support vector machine (SVM), proposed by Suykens and Vandewalle [26]. It transforms the inequality constraints of traditional SVM into equality constraints and considers sum squares error loss function as the loss experience of the training set, which transforms solving quadratic programming problems into solving linear equations problems [27]. The training set is set as {
(
x
k
,
y
k
)
∣
k
=
1,2
,
…
,
n
}, in which x
k
∈
R
n is the input data and y
k
∈
R
n is the output data. φ
(
·
) is the nonlinear mapping function which transfers the samples into a much higher dimensional feature space ϕ
(
x
k
). Establish the optimal decision function in the high-dimensional feature space:(3)
y
x
=
ω
T
·
φ
x
+
b
,where φ
x is mapping function; ω is weight vector; b is constant.Using the principle of structural risk minimization, the objective optimization function is as follows:(4)
min
ω
,
b
,
e
⁡
ω
,
e
=
1
2
ω
T
ω
+
1
2
γ
∑
k
=
1
n
e
k
2
.Its constraint condition is(5)
y
k
=
ω
T
φ
x
k
+
b
+
e
k
,
k
=
1,2
,
…
,
n
,in which γ is the penalty coefficient and e
k is slack variable.Define the Lagrange function to solve the problem:(6)
L
ω
,
b
,
e
,
α
=
ϕ
ω
,
e
-
∑
k
=
1
n
α
k
ω
T
φ
x
k
+
b
+
e
k
-
y
k
,where Lagrange multiplier α
k
∈
R. According to the Karush-Kuhn-Tucker (KKT) conditions, ω
,
b
,
e
k
,
α
k are taken as partial derivatives and required as zero. Consider(7)
ω
=
∑
k
=
1
n
α
k
φ
x
k
,
∑
k
=
1
n
α
k
=
0
,
α
k
=
e
k
γ
,
ω
T
φ
x
k
+
b
+
e
k
-
y
k
=
0
.According to (7), the optimization problem can be transformed into solving linear problem, which is shown as follows:(8)
0
1
⋯
1
1
K
x
1
,
x
1
+
1
γ
⋯
K
x
1
,
x
l
⋮
⋮
⋮
⋮
1
K
x
l
,
x
1
⋯
K
x
l
,
x
l
+
1
γ
b
α
1
⋮
α
l
=
0
y
1
⋮
y
l
.Solve formula (8) to get α and b; then the LSSVM optimal linear regression function is(9)
f
x
=
∑
k
=
1
l
α
k
K
x
,
x
k
+
b
.According to Mercer condition,K
(
x
,
x
i
)
=
φ
(
x
)
T
·
φ
(
x
l
) is kernel function. In this paper, set radial basis function (RBF) as kernel function which is shown in the following equation: (10)
K
x
,
x
k
=
exp
⁡
-
x
-
x
k
2
2
σ
2
,where σ
2 is the width of kernel function.From the problems of training LSSVM, kernel parameterσ
2 and penalty parameter γ are generally set based on experience, which leads to the existence of randomness and inaccuracy in the application of the LSSVM algorithm. To solve the problem, the paper uses fruit fly optimization algorithm to optimize these two parameters to improve the prediction accuracy of LSSVM.


## 2.3. Fruit Fly Optimization Algorithm

Fruit fly optimization algorithm is a kind of intelligent optimization algorithms based on fruit fly foraging behaviours proposed by Pan [20] in 2012. The basic concept of FOA is that fruit fly perceives food concentration according to its position, and then it will move to the site of maximum or minimum concentration by comparing flavor concentration; finally the objective function extreme value can be obtained through repeated iterations of food concentration. Food finding iterative process of fruit fly swarm is shown in Figure 2.Figure 2
Food finding iterative process of a fruit fly swarm.According to the food finding characteristics of fruit fly swarm, the fruit fly optimization algorithm can be divided into following steps:(1) Randomly initialize the fruit fly swarm location(
x
_
a
x
i
s
,
y
_
a
x
i
s
).(2) Give the random flight direction and the distance for food finding of an individual fruit fly by using olfactory:(11)
X
i
=
x
_
axis
+
Random Value
Y
i
=
y
_
axis
+
Random Value
.(3) Calculate the distance between the origin and each individual fruit fly position (Dist), and then calculate the value of flavor concentration (S); it is the reciprocal of distance: (12)
Dist
=
X
i
2
+
Y
i
2
(13)
S
=
1
Dist
.(4) Put the value of flavor concentrationS into its fitness function, and then get the flavor concentration of the individual fruit fly location (Smell).(5) Find out the individual fruit fly with minimal smell concentration among the fruit fly swarm:(14)
best Smell
,
best index
=
max
⁡
Smell
.(6) Retain the best flavor concentration and itsX, Y coordinates, and then the fruit flies fly to the position by using vision. Enter iterative optimization to repeat steps (2)–(5). When the fitness value reaches target set, or the iterative number reaches the maximal iterative number, the circulation stops. Update the information as follows:(15)
Smell best
=
best Smell
x
_
axis
=
X
best index
y
_
axis
=
Y
best index
.


## 2.4. The Introduction of WT-FOA-LSSVM

Flowchart of the WT-FOA-LSSVM model is shown in Figure3, and the detailed processes are as follows.Figure 3
Flowchart of the WT-FOA-LSSVM modeling.(1
) Data Preprocessing Using DWT. Decompose the load signal into the approximation A1 and the details D1, and select A1 as the training data and testing data.(2
) Initialization of the Fruit Fly Optimization Algorithm Parameters. Fruit fly optimization algorithm parameters contain the initial fruit fly swarm location (
x
_
a
x
i
s
,
y
_
a
x
i
s
), the random flight distant range F
R, the population size s
i
z
e
p
o
p, and the maximum iterative number N
m
a
x. In this paper, we set x
_
a
x
i
s
=
r
a
n
d
s
(
1,2
), y
_
a
x
i
s
=
r
a
n
d
s
(
1,2
), where r
a
n
d
s
(
) represents the random number generation function in MATLAB program. In addition, we suppose F
R
⊂
[
-
10,10
], s
i
z
e
p
o
p
=
50, and N
m
a
x
=
100.(3
) LSSVM Optimized by Fruit Fly Optimization Algorithm. Calculate the distance D
i between the origin and each individual fruit fly i according to formulas (11) and (12) and the smell concentration judgment value S
i according to formula (13). In the FOA-LSSVM program, the parameters [
C
,
σ
2
] of LSSVM model are represented by [
S
(
i
,
1
)
,
S
(
i
,
2
)
], and we set C
=
20
∗
S
(
i
,
1
) and σ
2
=
S
(
i
,
2
) for LSSVM model training. According to the electric load forecasting result, the value of fitness function can be calculated. In this paper, we employ the mean absolute percentage error (MAPE) as the fitness function, and the formula is as follows:(16)
MAPE
=
1
n
∑
i
=
1
n
y
^
i
-
y
i
y
i
,where y
i represents the actual value at period i; y
^
i is the forecasting value at period i and n is the number of forecasting periods.If the maximum iterative numberN
m
a
x
=
100 or M
A
P
E
<
0.01
%, stop the iterative process and output the best values of C and σ
2.(4
) Forecast Using Least Squares Support Vector Machine. Put the optimal parameter value obtained from step (3) in the least squares support vector machine and do the forecast. Finally, get the forecasting load value.


## 3. Case Studies

### 3.1. Data Preprocessing

This paper chooses the 24-hour power load data from May 1, 2013, to July 23, 2013, in Shanxi province for model checking. In this paper, we select 1986 pieces of load data from May 1 to July 22 as training set and 24 pieces of load data of July 23 as testing set. In order to eliminate the effects of random fluctuations of load data, we decompose the original load data S into the approximation component A1 and detail component D1 through one-level DWT, as shown in Figure4.Figure 4
Original load signal and its approximation component and detail component decomposed by DWT.From Figure4, it is clear that the major fluctuation of A1 shows high similarity to the original load data S. The detail component D1 is excluded from the original data to ensure the stability of the input data. So, A1 is selected as the input in proposed model.


### 3.2. Selection of Input

Human activities are always disturbed by many external factors and then the power load is affected. So, some effective features are considered as input features. In this paper, the input features are discussed as follows. The first feature is the highest temperature and the lowest temperature. Temperature is one of these effective features. In [27–29], temperature was considered as an essential input feature and the forecasting results were accurate enough. So, the highest and lowest temperatures are taken into consideration. The second feature is weather conditions. The weather conditions are divided into four types: sunny, cloudy, overcast, and rainy. For different weather conditions, we set different weights: sunny, cloudy, overcast, and rainy=
{
0.9,0.7,0.5,0.2
}. The third feature is days type. For different days type, the electric power consumption is different. Figure 5 shows the load data from June 10, 2013, to June 16, 2013, among which Wednesday is dragon festival in China. From Figure 5, we can see that the mean power load of Wednesday is higher than other days and different days type has different curve features. So, we assign values to days type in Table 1.Table 1
The weights of days type.
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday
Holiday
Weights
1
2
3
4
5
6
7
8Figure 5
Weekly load curve.


### 3.3. Parameters Setting of Comparison Models

In this paper, we introduce five other models, WT-LSSVM, least squares support vector machine optimized by fruit fly optimization algorithm (FOA-LSSVM), least squares support vector machine optimized by particle swarm optimization algorithm (PSO-LSSVM), least squares support vector machine, and the BP neural network, to make a comparison with the proposed model. Referring to some of the relative literature [21, 27], the parameters of the comparison models are set as shown in Table 2.Table 2
Parameters of models mentioned in the paper.
Model
Parameters
WT-LSSVM
γ
=
40; σ
2
=
5
FOA-LSSVM
Initial-location[
rands
(
1,2
)
,
rands
(
1,2
)
]; FR
=
[
-
10,10
]; sizepop = 50; N
m
a
x
=
100
PSO-LSSVM
C
1
=
C
2
=
2; N
m
a
x
=
100; sizepop = 20; w
0
=
0.8; w
n
=
0.3
LSSVM
γ
=
40; σ
2
=
5
BPNN
N
m
a
x
=
100; hidden-layer-node = [
5,5
]; learning-rate = 0.1; g
o
a
l
=
0.00004


### 3.4. Model Performance Evaluation

To examine the performance of model, the relative error (RE), the mean absolute percentage error (MAPE), the mean square error (MSE), and the mean absolute error (MAE) are proposed to measure the forecast accuracy. The formulas are as follows:(17)
RE
i
=
y
^
i
-
y
i
y
i
×
100
%
,
MAPE
=
1
n
∑
i
=
1
n
y
^
i
-
y
i
y
i
,
MSE
=
1
n
∑
i
=
1
n
y
^
i
-
y
i
2
,
MAE
=
∑
i
=
1
n
y
^
i
-
y
i
n
,where y
i represents the actual value at period i; y
^
i is the forecasting value at period i and n is the number of forecasting periods.


### 3.5. Analysis of Forecasting Results

The program in this paper is run in MATLAB R2011b under the XP system. Table3 shows the short-term electric load forecasting results of the WT-FOA-LSSVM, WT-LSSVM, FOA-LSSVM, PSO-LSSVM, LSSVM, and BPNN models. Figures 6, 7, and 8 present the comparisons of the forecasting results between the proposed model and the others. Figures 9, 10, and 11 show the comparisons of relative errors between the proposed model and the others. The relative error ranges [
-
3
%
,
3
%
] and [
-
1
%
,
1
%
] are always considered as a standard to assess the performance of a forecasting model [30]. First, based on Table 2 and Figures 9, 10, and 11, the relative errors of short-term load forecasting of WT-FOA-LSSVM are all in the range of [
-
3
%
,
3
%
], and the maximum relative error is 2.6096% at 7:00 and the minimum relative error is −2.991% at 19:00. There exist fourteen points that are in the scope of [
-
1
%
,
1
%
]. Second, the WT-LSSVM has two forecasting points that exceed the relative error range [
-
3
%
,
3
%
], which are 3.1121% at 7:00 and 3.006% at 19:00, and there are fifteen forecasting points in the range of [
-
1
%
,
1
%
]. Third, the FOA-LSSVM has two forecasting points that exceed the relative error range [
-
3
%
,
3
%
], which are 3.1225% at 8:00 and 3.1429% at 22:00, and there are eight forecasting points in the range of [
-
1
%
,
1
%
]. Fourth, the PSO-LSSVM has one forecasting point that exceeds the relative error range [
-
3
%
,
3
%
], which is 3.0743% at 9:00, and there are eight forecasting points in the range of [
-
1
%
,
1
%
]. Fifth, the single LSSVM has three forecasting points that exceed the relative error range [
-
3
%
,
3
%
], which are 3.6484% at 8:00, 3.4946% at 21:00, and 3.627% at 22:00, and there are three forecasting points in the range of [
-
1
%
,
1
%
]. Sixth, the BPNN has three forecasting points that exceed the relative error range [
-
3
%
,
3
%
], which are 3.0755% at 7:00, 3.2531% at 13:00, and 4.209% at 22:00, and there are seven forecasting points in the range of [
-
1
%
,
1
%
]. However, the comparison models also predict more accurately than the proposed model at some points, such as 7:00 and 19:00.Table 3
Actual load and forecasting results.
Time/h
Actual value/MW
WT-FOA-LSSVM
WT-LSSVM
FOA-LSSVM
PSO-LSSVM
LSSVM
BPNN
1:00
802
794.57
794.48
811.09
817.87
813.47
811.50
2:00
789.71
786.76
787.26
796.86
804.78
798.72
800.40
3:00
786.59
778.32
778.41
790.53
764.12
792.73
785.70
4:00
786.82
782.07
781.90
791.48
768.02
792.93
782.74
5:00
784.16
783.38
783.36
784.04
795.92
796.98
801.99
6:00
785.28
792.11
791.62
798.36
773.31
799.73
790.22
7:00
787.18
807.72
811.68
803.65
798.63
810.33
811.39
8:00
801.29
819.94
819.71
826.31
816.22
830.52
817.20
9:00
801.71
816.90
816.87
819.94
804.59
822.10
812.74
10:00
826.78
824.57
824.37
839.52
819.02
842.58
838.74
11:00
834.31
845.44
844.48
854.89
828.72
857.19
850.32
12:00
858.62
862.27
862.07
875.15
849.75
874.93
873.86
13:00
852.87
844.17
844.70
859.51
854.92
871.70
880.61
14:00
813.21
819.19
819.59
831.13
825.04
829.22
830.73
15:00
818.59
820.88
820.84
827.56
827.45
828.01
825.97
16:00
839.14
837.15
836.17
847.18
848.92
849.39
853.78
17:00
853.36
859.53
858.90
854.69
861.14
868.99
878.91
18:00
877.21
869.92
869.73
887.87
862.37
889.47
899.97
19:00
899.76
872.85
872.72
898.40
927.42
900.42
902.82
20:00
869.36
883.01
882.77
881.83
868.06
888.95
877.78
21:00
886.74
903.93
903.35
903.41
893.90
917.73
897.03
22:00
887.77
890.44
890.68
915.67
889.76
919.97
925.14
23:00
873.6
854.58
847.88
882.64
896.88
884.27
866.82
24:00
834.67
834.29
834.34
836.32
856.53
839.34
846.50Figure 6
Actual load and forecasting results of WT-FOA-LSSVM and WT-LSSVM.Figure 7
Actual load and forecasting results of WT-FOA-LSSVM, FOA-LSSVM, and PSO-LSSVM.Figure 8
Actual load and forecasting results of WT-FOA-LSSVM, LSSVM, and BPNN.Figure 9
Relative errors of WT-FOA-LSSVM and WT-LSSVM.Figure 10
Relative errors of WT-FOA-LSSVM, FOA-LSSVM, and PSO-LSSVM.Figure 11
Relative errors of WT-FOA-LSSVM, LSSVM, and BPNN.The mean absolute percentage errors, mean square errors, and mean absolute errors of WT-FOA-LSSVM, WT-LSSVM, FOA-LSSVM, PSO-LSSVM, LSSVM, and BPNN are listed in Table4. From Table 4, we can conclude that the MAPE of the proposed model is 1.068%, which is smaller than the MAPE of WT-LSSVM, FOA-LSSVM, PSO-LSSVM, LSSVM, and BPNN (which are 1.111%, 1.3534%, 1.414%, 1.8457%, and 1.674%). Additionally, the MSE of the proposed model is 130.4913, which is smaller than the MSE of the comparison models (which are 147.9492, 181.4398, 191.3687, 300.9418, and 268.3937). The MAE of the proposed model is 8.9425, which is smaller than the MAE of the comparison models (which are 9.297083, 11.26083, 11.90875, 15.3725, and 13.98458). As a result, the MAPE, MSE, and MAE of the WT-FOA-LSSVM are all smaller than those of the WT-LSSVM, so we can conclude that the parameter optimization to LSSVM is essential in the forecasting model. Besides, the MAPE, MSE, and MAE of the WT-LSSVM are all smaller than those of FOA-LSSVM, PSO-LSSVM, LSSVM, and BPNN, indicating the preprocessing of load data is useful for a better performance and higher forecasting accuracy. At the same time, the MAPE, MSE, and MAE of the FOA-LSSVM are all smaller than those of PSO-LSSVM, LSSVM, and BPNN, and it is presented that the optimization result of the fruit fly optimization algorithm is efficient. So, we can conclude that the stability and forecasting accuracy of the proposed model is better than the comparison models, and it is worth of being widely used in the short-term load forecasting.Table 4
Models performance evaluations.
Index
Model
WT-FOA-LSSVM
WT-LSSVM
FOA-LSSVM
PSO-LSSVM
LSSVM
BPNN
MAPE (%)
1.068
1.111
1.3534
1.414
1.8457
1.674
MSE (MW2)
130.4913
147.9492
181.4398
191.3687
300.9418
268.3937
MAE (MW)
8.9425
9.297083
11.26083
11.90875
15.3725
13.98458


## 3.1. Data Preprocessing

This paper chooses the 24-hour power load data from May 1, 2013, to July 23, 2013, in Shanxi province for model checking. In this paper, we select 1986 pieces of load data from May 1 to July 22 as training set and 24 pieces of load data of July 23 as testing set. In order to eliminate the effects of random fluctuations of load data, we decompose the original load data S into the approximation component A1 and detail component D1 through one-level DWT, as shown in Figure4.Figure 4
Original load signal and its approximation component and detail component decomposed by DWT.From Figure4, it is clear that the major fluctuation of A1 shows high similarity to the original load data S. The detail component D1 is excluded from the original data to ensure the stability of the input data. So, A1 is selected as the input in proposed model.


## 3.2. Selection of Input

Human activities are always disturbed by many external factors and then the power load is affected. So, some effective features are considered as input features. In this paper, the input features are discussed as follows. The first feature is the highest temperature and the lowest temperature. Temperature is one of these effective features. In [27–29], temperature was considered as an essential input feature and the forecasting results were accurate enough. So, the highest and lowest temperatures are taken into consideration. The second feature is weather conditions. The weather conditions are divided into four types: sunny, cloudy, overcast, and rainy. For different weather conditions, we set different weights: sunny, cloudy, overcast, and rainy=
{
0.9,0.7,0.5,0.2
}. The third feature is days type. For different days type, the electric power consumption is different. Figure 5 shows the load data from June 10, 2013, to June 16, 2013, among which Wednesday is dragon festival in China. From Figure 5, we can see that the mean power load of Wednesday is higher than other days and different days type has different curve features. So, we assign values to days type in Table 1.Table 1
The weights of days type.
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday
Holiday
Weights
1
2
3
4
5
6
7
8Figure 5
Weekly load curve.


## 3.3. Parameters Setting of Comparison Models

In this paper, we introduce five other models, WT-LSSVM, least squares support vector machine optimized by fruit fly optimization algorithm (FOA-LSSVM), least squares support vector machine optimized by particle swarm optimization algorithm (PSO-LSSVM), least squares support vector machine, and the BP neural network, to make a comparison with the proposed model. Referring to some of the relative literature [21, 27], the parameters of the comparison models are set as shown in Table 2.Table 2
Parameters of models mentioned in the paper.
Model
Parameters
WT-LSSVM
γ
=
40; σ
2
=
5
FOA-LSSVM
Initial-location[
rands
(
1,2
)
,
rands
(
1,2
)
]; FR
=
[
-
10,10
]; sizepop = 50; N
m
a
x
=
100
PSO-LSSVM
C
1
=
C
2
=
2; N
m
a
x
=
100; sizepop = 20; w
0
=
0.8; w
n
=
0.3
LSSVM
γ
=
40; σ
2
=
5
BPNN
N
m
a
x
=
100; hidden-layer-node = [
5,5
]; learning-rate = 0.1; g
o
a
l
=
0.00004


## 3.4. Model Performance Evaluation

To examine the performance of model, the relative error (RE), the mean absolute percentage error (MAPE), the mean square error (MSE), and the mean absolute error (MAE) are proposed to measure the forecast accuracy. The formulas are as follows:(17)
RE
i
=
y
^
i
-
y
i
y
i
×
100
%
,
MAPE
=
1
n
∑
i
=
1
n
y
^
i
-
y
i
y
i
,
MSE
=
1
n
∑
i
=
1
n
y
^
i
-
y
i
2
,
MAE
=
∑
i
=
1
n
y
^
i
-
y
i
n
,where y
i represents the actual value at period i; y
^
i is the forecasting value at period i and n is the number of forecasting periods.


## 3.5. Analysis of Forecasting Results

The program in this paper is run in MATLAB R2011b under the XP system. Table3 shows the short-term electric load forecasting results of the WT-FOA-LSSVM, WT-LSSVM, FOA-LSSVM, PSO-LSSVM, LSSVM, and BPNN models. Figures 6, 7, and 8 present the comparisons of the forecasting results between the proposed model and the others. Figures 9, 10, and 11 show the comparisons of relative errors between the proposed model and the others. The relative error ranges [
-
3
%
,
3
%
] and [
-
1
%
,
1
%
] are always considered as a standard to assess the performance of a forecasting model [30]. First, based on Table 2 and Figures 9, 10, and 11, the relative errors of short-term load forecasting of WT-FOA-LSSVM are all in the range of [
-
3
%
,
3
%
], and the maximum relative error is 2.6096% at 7:00 and the minimum relative error is −2.991% at 19:00. There exist fourteen points that are in the scope of [
-
1
%
,
1
%
]. Second, the WT-LSSVM has two forecasting points that exceed the relative error range [
-
3
%
,
3
%
], which are 3.1121% at 7:00 and 3.006% at 19:00, and there are fifteen forecasting points in the range of [
-
1
%
,
1
%
]. Third, the FOA-LSSVM has two forecasting points that exceed the relative error range [
-
3
%
,
3
%
], which are 3.1225% at 8:00 and 3.1429% at 22:00, and there are eight forecasting points in the range of [
-
1
%
,
1
%
]. Fourth, the PSO-LSSVM has one forecasting point that exceeds the relative error range [
-
3
%
,
3
%
], which is 3.0743% at 9:00, and there are eight forecasting points in the range of [
-
1
%
,
1
%
]. Fifth, the single LSSVM has three forecasting points that exceed the relative error range [
-
3
%
,
3
%
], which are 3.6484% at 8:00, 3.4946% at 21:00, and 3.627% at 22:00, and there are three forecasting points in the range of [
-
1
%
,
1
%
]. Sixth, the BPNN has three forecasting points that exceed the relative error range [
-
3
%
,
3
%
], which are 3.0755% at 7:00, 3.2531% at 13:00, and 4.209% at 22:00, and there are seven forecasting points in the range of [
-
1
%
,
1
%
]. However, the comparison models also predict more accurately than the proposed model at some points, such as 7:00 and 19:00.Table 3
Actual load and forecasting results.
Time/h
Actual value/MW
WT-FOA-LSSVM
WT-LSSVM
FOA-LSSVM
PSO-LSSVM
LSSVM
BPNN
1:00
802
794.57
794.48
811.09
817.87
813.47
811.50
2:00
789.71
786.76
787.26
796.86
804.78
798.72
800.40
3:00
786.59
778.32
778.41
790.53
764.12
792.73
785.70
4:00
786.82
782.07
781.90
791.48
768.02
792.93
782.74
5:00
784.16
783.38
783.36
784.04
795.92
796.98
801.99
6:00
785.28
792.11
791.62
798.36
773.31
799.73
790.22
7:00
787.18
807.72
811.68
803.65
798.63
810.33
811.39
8:00
801.29
819.94
819.71
826.31
816.22
830.52
817.20
9:00
801.71
816.90
816.87
819.94
804.59
822.10
812.74
10:00
826.78
824.57
824.37
839.52
819.02
842.58
838.74
11:00
834.31
845.44
844.48
854.89
828.72
857.19
850.32
12:00
858.62
862.27
862.07
875.15
849.75
874.93
873.86
13:00
852.87
844.17
844.70
859.51
854.92
871.70
880.61
14:00
813.21
819.19
819.59
831.13
825.04
829.22
830.73
15:00
818.59
820.88
820.84
827.56
827.45
828.01
825.97
16:00
839.14
837.15
836.17
847.18
848.92
849.39
853.78
17:00
853.36
859.53
858.90
854.69
861.14
868.99
878.91
18:00
877.21
869.92
869.73
887.87
862.37
889.47
899.97
19:00
899.76
872.85
872.72
898.40
927.42
900.42
902.82
20:00
869.36
883.01
882.77
881.83
868.06
888.95
877.78
21:00
886.74
903.93
903.35
903.41
893.90
917.73
897.03
22:00
887.77
890.44
890.68
915.67
889.76
919.97
925.14
23:00
873.6
854.58
847.88
882.64
896.88
884.27
866.82
24:00
834.67
834.29
834.34
836.32
856.53
839.34
846.50Figure 6
Actual load and forecasting results of WT-FOA-LSSVM and WT-LSSVM.Figure 7
Actual load and forecasting results of WT-FOA-LSSVM, FOA-LSSVM, and PSO-LSSVM.Figure 8
Actual load and forecasting results of WT-FOA-LSSVM, LSSVM, and BPNN.Figure 9
Relative errors of WT-FOA-LSSVM and WT-LSSVM.Figure 10
Relative errors of WT-FOA-LSSVM, FOA-LSSVM, and PSO-LSSVM.Figure 11
Relative errors of WT-FOA-LSSVM, LSSVM, and BPNN.The mean absolute percentage errors, mean square errors, and mean absolute errors of WT-FOA-LSSVM, WT-LSSVM, FOA-LSSVM, PSO-LSSVM, LSSVM, and BPNN are listed in Table4. From Table 4, we can conclude that the MAPE of the proposed model is 1.068%, which is smaller than the MAPE of WT-LSSVM, FOA-LSSVM, PSO-LSSVM, LSSVM, and BPNN (which are 1.111%, 1.3534%, 1.414%, 1.8457%, and 1.674%). Additionally, the MSE of the proposed model is 130.4913, which is smaller than the MSE of the comparison models (which are 147.9492, 181.4398, 191.3687, 300.9418, and 268.3937). The MAE of the proposed model is 8.9425, which is smaller than the MAE of the comparison models (which are 9.297083, 11.26083, 11.90875, 15.3725, and 13.98458). As a result, the MAPE, MSE, and MAE of the WT-FOA-LSSVM are all smaller than those of the WT-LSSVM, so we can conclude that the parameter optimization to LSSVM is essential in the forecasting model. Besides, the MAPE, MSE, and MAE of the WT-LSSVM are all smaller than those of FOA-LSSVM, PSO-LSSVM, LSSVM, and BPNN, indicating the preprocessing of load data is useful for a better performance and higher forecasting accuracy. At the same time, the MAPE, MSE, and MAE of the FOA-LSSVM are all smaller than those of PSO-LSSVM, LSSVM, and BPNN, and it is presented that the optimization result of the fruit fly optimization algorithm is efficient. So, we can conclude that the stability and forecasting accuracy of the proposed model is better than the comparison models, and it is worth of being widely used in the short-term load forecasting.Table 4
Models performance evaluations.
Index
Model
WT-FOA-LSSVM
WT-LSSVM
FOA-LSSVM
PSO-LSSVM
LSSVM
BPNN
MAPE (%)
1.068
1.111
1.3534
1.414
1.8457
1.674
MSE (MW2)
130.4913
147.9492
181.4398
191.3687
300.9418
268.3937
MAE (MW)
8.9425
9.297083
11.26083
11.90875
15.3725
13.98458


## 4. Conclusion

To strengthen the stability and economy of the grid and avoid the waste in grid scheduling, it is essential to improve the forecasting accuracy. Because the short-term power load is always interfered by various external factors with the characteristics like high volatility and instability, the high accuracy of load forecasting should be taken into consideration. Based on the features of load data and the randomness of the LSSVM parameters setting, we propose the model based on wavelet transform and least squares support vector machine optimized by fruit fly optimization algorithm. To validate the proposed model, four other comparison models (FOA-LSSVM, PSO-LSSVM, LSSVM, and BPNN) are employed to compare the forecasting results. Example computation results show that the relative errors of WT-FOA-LSSVM model are all in the range[
-
3
%
,
3
%
], and the MAPE, MSE, and MAE are all smaller than the others. In addition, the fruit fly optimization algorithm is easy to understand and operate, so it is applied widely in parameters optimization. The hybrid model can be effectively used in the short-term load forecasting on power system.



---

*Source: 862185-2015-12-16.xml*