Short-Term Forecasting of Electricity Supply and Demand by Using the Wavelet-PSO-NNs-SO Technique for Searching in Big Data of Iran ’ s Electricity Market

Mesbaholdin Salami 1, Farzad Movahedi Sobhani 2,* and Mohammad Sadegh Ghazizadeh 3 1 Department of Industrial Engineering, Central Tehran Branch, Islamic Azad University, Tehran 009821, Iran; Mes.salami.eng@iauctb.ac.ir 2 Department of Industrial Engineering, Science and Research Branch, Islamic Azad University, Tehran 009821, Iran 3 Department of Electrical Engineering, Abbaspour School of Engineering, Shahid Beheshti University, Tehran 009821, Iran; ghazizadeh.ms@gmail.com * Correspondence: farzadmovahedi@gmail.com


Introduction
In energy planning, variables such as wind power, solar radiation, CO 2 emissions, electricity prices, etc., are predicted [1].One of the most important variables of energy planning that needs to be predicted is load demand forecasting.In this way, the electricity market is a system for buying and selling electricity.Such a market is established in the form of supply and demand to determine the price of electricity.Generation, distribution, and transfer management systems were integrated in the old structure of the electric power industry.However, such systems operate independently now in the new structure.Accordingly, the electricity market serves as an interface between the aforesaid systems.In the competitive electricity market, the market manager is mainly responsible for determining the electricity price for the future periods.Given the process of creating smart grids where retailers and retailers will be present, the volume of data generation is greater than ever, and the speed and precision of data analysis is more important.The electricity supply and demand are among the most important variables determining the electricity price for the future.The electricity market manager can predict the electricity supply and demand for the upcoming periods by considering data obtained from the stored parameters of the electricity market.The sizes of the electricity market data, stored in short intervals, developed a concept named Big Data characterized by four vastness features, discussed in Section 2. Machine learning is an analytical approach to Big Data problems.Therefore, machine-learning methods were used in this paper to search in Big Data of the electricity market with the purpose of developing forecasting techniques.The importance of electricity demand forecasting has been pointed out by many studies of the electricity market, Such forecasting are categorized as very short-term, short-term, mid-term, and long-term classes.The proceedings [2][3][4][5] pointed out the electricity forecasting methods for very short-term intervals (shorter than an hour).The proceedings [6][7][8][9][10] introduced the forecasting methods for mid-term intervals (ranging from one month to one year), and the proceedings [11][12][13][14][15][16] pointed out the long-term intervals (longer than one year).In this paper, a new technique was introduced for the forecasting of short-term demands (ranging from one hour to one month).In another division, the short-term forecasting papers are divided into two groups, based on either time series or neural networks.References [17][18][19][20][21][22] include the papers on the use of time series in the short-term forecasting of electricity demand.Such forecasting was not discussed in this paper.Instead, neural networks were employed along with other methods for forecasting.In this category, articles are presented like BPNN (Li et al. [23]), WTBPNN (Changhao et al. [24]), GNBPNN (Irani et al. [25]), NNPSO (Zhaoyu et al. [26]), WT-ANFIS (Karthika et al. [27]), ADE-BPNN (Wang et al. [28]), Wavelet-PSO-ANFIS,) Catalao et al. [29]), and WT-PSO-BPNN (Mandel et al. [30]) whose goal is to arrive at the highest accuracy in forecasting.Some other research are found in [10,[31][32][33][34][35][36][37][38][39][40][41][42][43][44][45][46][47][48][49][50]. Figure 1 shows the development of the new technique.
In this paper, it is assumed that if the electricity market manager can search in a large size of previous data by using intelligent methods, it will be possible to improve the forecasting accuracy of electrical load supply and demand.It will also be possible to reduce the data analysis time.There are various Big Data analysis methods, introduced thoroughly in [47].Accordingly, machine-learning algorithms are also used for Big Data analysis.In this paper, available strategies were developed for forecasting target variables based on neural networks.Then a new strategy was introduced for preprocessing Big Data to select appropriate initial solutions as the inputs of the neural network.In fact, the preprocessing strategy results from the proper search conducted on a big size of previous data.As a result, the neural network weighting time decreased, and the accuracy increased.In other words, the metaheuristic PSO was used to generate the values of previous data, closest to the current input data, through searching in Big Data.Then the predicted values of supply and demand were calculated along with the Monte Carlo fitness function to improve data.After that, the data were entered into a neural network to weight the input parameters of the neural network.In this study, the three-step Haar wavelet transform was employed for high-accuracy forecasting in order to separate high and low frequencies of real input data of electrical load supply and demand.Therefore, the Wavelet-Neural Networks-Particle Swarm Optimization-Simulation-Optimization (WT-NNPSO-SO) technique was formed.In fact, it is a developed version of previous techniques.It was proposed for forecasting the electrical load demand or other variables such as the wind power.This technique maintains the improved in accuracy and speed by increasing the length of training data (LOTD).It is also appropriate for search in Big Data stored previously in databases.In this paper, the data analysis speed was considerably important.It was pointed out in the Results section (because it will be necessary to predict variables in the shortest possible intervals in smart grids in the electricity market in the foreseeable future).In addition to load forecasting, the proposed method predicts the electricity load and supply values with the same technique.In the following, the article is divided into sections titled: 2. Iran's Electricity Market's Big Data; 3. Components of the Algorithm; 4. The Wavelet-NNPSO Algorithm; 5. Numerical Results and Discussion; and 6.Conclusion and Suggestions.

Current Situation
Since the establishment of Iran's electricity market (IEM) in Iran (2002), databases of the electricity market have been storing data at the same time as when electricity is bought and sold.Such data are based on the activities of sellers and buyers in a certain field.The electricity market manager acts as an interface to receive data from buyers and sellers with the purpose of predicting and approving the fair price of electricity for the following day after electric load supply and demand forecasting.By 2017, There were over 25 parameters stored in databases of the electricity market for electricity price forecasting.The stored data indicate the actions of buyers and sellers, summarized in Table 1.

Current Situation
Since the establishment of Iran's electricity market (IEM) in Iran (2002), databases of the electricity market have been storing data at the same time as when electricity is bought and sold.Such data are based on the activities of sellers and buyers in a certain field.The electricity market manager acts as an interface to receive data from buyers and sellers with the purpose of predicting and approving the fair price of electricity for the following day after electric load supply and demand forecasting.By 2017, There were over 25 parameters stored in databases of the electricity market for electricity price forecasting.The stored data indicate the actions of buyers and sellers, summarized in Table 1.The total size of generated data has been 10,158 GB since the establishment of the electricity market (up to 2017).It is predicted that 21,116 GB of data will be generated until 2022 (without considering the implementation of the smart grid).Moreover, the data generation rate of Iran's electricity market is so high that the data of every parameter are stored in every minute.Regarding Big Data, validity and variety are important in addition to the size and rate of data generation.According to the data verification at different levels of power supply chain compared with previously real and estimated data on average, the generated data indicated uncertainty.Data uncertainty is a feature of Big Data [51].In the next step, the data of electricity market and varied data are searched.Such a variety includes nominal, ordinal, and numeral data in addition to dates and time.Figure 2 indicates the four features.
Big Data, validity and variety are important in addition to the size and rate of data generation.According to the data verification at different levels of power supply chain compared with previously real and estimated data on average, the generated data indicated uncertainty.Data uncertainty is a feature of Big Data [51].In the next step, the data of electricity market and varied data are searched.Such a variety includes nominal, ordinal, and numeral data in addition to dates and time.Figure 2 indicates the four features.

State of the Future
Given the changes in the electricity market to create smart grids and welcome retail buyers and retailers in the market, data generation rate has greatly increased so much that data will be recorded instantly [14].Therefore, if the smart grid is implemented thoroughly across Iran (from 2018 to 2025) to gradually cover over 33,689,000 home and industrial electricity subscribers, it is predicted that 2.5 terabytes of data will be generated daily.As a result, there will be unbelievably numerous sources of data generation.In fact, every home or building will turn into a data generation source in the market (Figure 3) [52].Therefore, Iran's electricity market will include a very great amount of data, and the daily-generated data of the smart grid may amount to the monthly-generated data of the ordinary market.Thus, the structures of data storage and analysis should be prepared for great developments of data generation in the foreseeable future.Certain methods should also be proposed to exploit the potential of previous Big Data, indicating the performance of relevant actors and different states of the market with the purpose of predicting the important variables more accurately.

State of the Future
Given the changes in the electricity market to create smart grids and welcome retail buyers and retailers in the market, data generation rate has greatly increased so much that data will be recorded instantly [14].Therefore, if the smart grid is implemented thoroughly across Iran (from 2018 to 2025) to gradually cover over 33,689,000 home and industrial electricity subscribers, it is predicted that 2.5 terabytes of data will be generated daily.As a result, there will be unbelievably numerous sources of data generation.In fact, every home or building will turn into a data generation source in the market (Figure 3) [52].Therefore, Iran's electricity market will include a very great amount of data, and the daily-generated data of the smart grid may amount to the monthly-generated data of the ordinary market.Thus, the structures of data storage and analysis should be prepared for great developments of data generation in the foreseeable future.Certain methods should also be proposed to exploit the potential of previous Big Data, indicating the performance of relevant actors and different states of the market with the purpose of predicting the important variables more accurately.

Wavelet
A wavelet is a series of mathematical functions used to decompose a continuous signal into frequency components.The resolution of each component is equal to its scale.The decomposition wavelet transform is a function based on wavelet functions.Wavelets (also known as daughter wavelets) are the samples transferred and scaled from a function (a mother wavelet) [24].They are characterized by finite lengths and highly mortal oscillations.The following figure shows a few mother wavelets.The continuous wavelet transform converts a continuous function of time into the time-frequency space.The bases of the new space are wavelet functions.In mathematics, a continuous wavelet transform is defined as a continuous function like x(t), the squared version of which is integrable (a > 0,  ϵ ).Equation ( 1) shows such a wavelet:

Wavelet
A wavelet is a series of mathematical functions used to decompose a continuous signal into frequency components.The resolution of each component is equal to its scale.The decomposition wavelet transform is a function based on wavelet functions.Wavelets (also known as daughter wavelets) are the samples transferred and scaled from a function (a mother wavelet) [24].They are characterized by finite lengths and highly mortal oscillations.The following figure shows a few mother wavelets.The continuous wavelet transform converts a continuous function of time into the time-frequency space.The bases of the new space are wavelet functions.In mathematics, a continuous wavelet transform is defined as a continuous function like x(t), the squared version of which is integrable (a > 0, R b).Equation ( 1) shows such a wavelet: In this equation, Ψ is a continuous function in time and frequency, t shows the signal length of x(t).The transfer and scale parameters include the continuous values of m and n, for which a = 2 m and a = 2 n .It is known as the mother wavelet, defined as Equation ( 2): In a discrete wavelet transform, a signal is passed through a series of overpass filters for high-frequency analysis and a series of underpass filters for low-frequency analysis.A signal is divided into two parts, one of which results from the passage of signal through the overpass filter including high-frequency information (such as noise).It is called the details.The other part results from the passage of signal through an underpass filter including low-frequency information and the identity properties of the signal.The second part is called generalities and shown as Equation (3): The Haar wavelet is a specific series of functions known as the first wavelet.There are several methods of wavelet transforms, the simplest of which is the Haar wavelet.In this paper, it was used in three steps.There are also other methods such as db2 and db4, used in other papers.The Haar mother wavelet is defined as Equation (4): The comparing function is shown by Equation (5): The decomposition steps are shown in Figure 4. Equation ( 6) indicates the stepwise decomposition equations.In this equation,  ́ is a continuous function in time and frequency, t shows the signal length of x(t).The transfer and scale parameters include the continuous values of m and n, for which a = 2 m and a = 2 n .It is known as the mother wavelet, defined as Equation ( 2): In a discrete wavelet transform, a signal is passed through a series of overpass filters for highfrequency analysis and a series of underpass filters for low-frequency analysis.A signal is divided into two parts, one of which results from the passage of signal through the overpass filter including high-frequency information (such as noise).It is called the details.The other part results from the passage of signal through an underpass filter including low-frequency information and the identity properties of the signal.The second part is called generalities and shown as Equation ( 3): The Haar wavelet is a specific series of functions known as the first wavelet.There are several methods of wavelet transforms, the simplest of which is the Haar wavelet.In this paper, it was used in three steps.There are also other methods such as db2 and db4, used in other papers.The Haar mother wavelet is defined as Equation (4): The comparing function is shown by Equation ( 5): The decomposition steps are shown in Figure 4. Equation ( 6) indicates the stepwise decomposition equations.After applying the neural network to the set of problem inputs, As and Ds were combined with each other to calculate and predict supply (S) and demand (D). Figure 5 shows the combination these After applying the neural network to the set of problem inputs, As and Ds were combined with each other to calculate and predict supply (S) and demand (D). Figure 5 shows the combination these components.In other words, they result from the inversed version of Equation ( 6).

Neural Network Particle Swarm Optimization (NNPSO)
The Back-propagation neural network (BPNN) is a kind of multilayer neural network with a nonlinear transfer function and Widrow-Hoff learning rules.The input and target vectors are used to train this type of the network for estimating a function, finding a relationship between inputs and outputs, and classifying inputs.A BP network has a bias to estimate every function with the limited number of discontinuities.BP is a standard algorithm characterized by reduced gradient.In BP, network weights move in the opposite direction of the efficiency function gradient.The term backpropagation refers to the behavior of a BP network in gradient calculation for multilayer nonlinear networks.There are different algorithms operating based on the standard BP algorithm such as the conjugate gradient algorithm and Newton's method.The most common BP network architecture is the feed forward network [23].Figure 6 shows a simple neuron with R inputs: The tansig function can be used to generate inputs ranging between −1 and 1.If the last layer of a multilayer network has sigmoid neurons, the output is limited to a shorter range.However, if linear neurons are used, the output can have any value.
The feed forward networks often have one or several hidden layers of sigmoid neurons by using a linear terminal layer.The presence of several layers of neurons and a nonlinear tansig function enables the network to learn about linear and nonlinear relationships between inputs and outputs.The linear output layer enables the network to have inputs outside the expected range.However, if the output exists in the expected range, the logsig function is used in the linear layer.In the example of this article, Figure 7 indicates the structure of a feed forward network with tansig functions and two layers of 40 neurons.Table 2 indicates the implementation parameters of the neural network.

Neural Network Particle Swarm Optimization (NNPSO)
The Back-propagation neural network (BPNN) is a kind of multilayer neural network with a nonlinear transfer function and Widrow-Hoff learning rules.The input and target vectors are used to train this type of the network for estimating a function, finding a relationship between inputs and outputs, and classifying inputs.A BP network has a bias to estimate every function with the limited number of discontinuities.BP is a standard algorithm characterized by reduced gradient.In BP, network weights move in the opposite direction of the efficiency function gradient.The term back-propagation refers to the behavior of a BP network in gradient calculation for multilayer nonlinear networks.There are different algorithms operating based on the standard BP algorithm such as the conjugate gradient algorithm and Newton's method.The most common BP network architecture is the feed forward network [23].Figure 6 shows a simple neuron with R inputs:

Neural Network Particle Swarm Optimization (NNPSO)
The Back-propagation neural network (BPNN) is a kind of multilayer neural network with a nonlinear transfer function and Widrow-Hoff learning rules.The input and target vectors are used to train this type of the network for estimating a function, finding a relationship between inputs and outputs, and classifying inputs.A BP network has a bias to estimate every function with the limited number of discontinuities.BP is a standard algorithm characterized by reduced gradient.In BP, network weights move in the opposite direction of the efficiency function gradient.The term backpropagation refers to the behavior of a BP network in gradient calculation for multilayer nonlinear networks.There are different algorithms operating based on the standard BP algorithm such as the conjugate gradient algorithm and Newton's method.The most common BP network architecture is the feed forward network [23].Figure 6 shows a simple neuron with R inputs: The tansig function can be used to generate inputs ranging between −1 and 1.If the last layer of a multilayer network has sigmoid neurons, the output is limited to a shorter range.However, if linear neurons are used, the output can have any value.
The feed forward networks often have one or several hidden layers of sigmoid neurons by using a linear terminal layer.The presence of several layers of neurons and a nonlinear tansig function enables the network to learn about linear and nonlinear relationships between inputs and outputs.The linear output layer enables the network to have inputs outside the expected range.However, if the output exists in the expected range, the logsig function is used in the linear layer.In the example of this article, Figure 7 indicates the structure of a feed forward network with tansig functions and two layers of 40 neurons.Table 2 indicates the implementation parameters of the neural network.The tansig function can be used to generate inputs ranging between −1 and 1.If the last layer of a multilayer network has sigmoid neurons, the output is limited to a shorter range.However, if linear neurons are used, the output can have any value.
The feed forward networks often have one or several hidden layers of sigmoid neurons by using a linear terminal layer.The presence of several layers of neurons and a nonlinear tansig function enables the network to learn about linear and nonlinear relationships between inputs and outputs.The linear output layer enables the network to have inputs outside the expected range.However, if the output exists in the expected range, the logsig function is used in the linear layer.In the example of this article, Figure 7 indicates the structure of a feed forward network with tansig functions and two layers of 40 neurons.Table 2 indicates the implementation parameters of the neural network.In this technique, PSO is used to train the neural network.The PSO is a global minimization method which can be employed to deal with certain problems, to which solutions include a point or surface of the n-dimensional space.In such a space, there are certain assumptions with an initiallyallocated speed [26].There are also communication channels between particles.Then the particles flow across the solution space, and results are calculated on the basis of a qualification criterion in every interval.With the passage of time, particles move towards the other particles with higher qualification criteria in the same communication group (Figure 8).The position and initial velocity of particles can be calculated through Equations ( 7) and ( 8), respectively.The velocity, weight (w), and position of particles can be obtained from Equations ( 9), (10), and ( 11) in every iteration.Table 3 indicates the input parameters required to implement the  In this technique, PSO is used to train the neural network.The PSO is a global minimization method which can be employed to deal with certain problems, to which solutions include a point or surface of the n-dimensional space.In such a space, there are certain assumptions with an initially-allocated speed [26].There are also communication channels between particles.Then the particles flow across the solution space, and results are calculated on the basis of a qualification criterion in every interval.With the passage of time, particles move towards the other particles with higher qualification criteria in the same communication group (Figure 8).In this technique, PSO is used to train the neural network.The PSO is a global minimization method which can be employed to deal with certain problems, to which solutions include a point or surface of the n-dimensional space.In such a space, there are certain assumptions with an initiallyallocated speed [26].There are also communication channels between particles.Then the particles flow across the solution space, and results are calculated on the basis of a qualification criterion in every interval.With the passage of time, particles move towards the other particles with higher qualification criteria in the same communication group (Figure 8).The position and initial velocity of particles can be calculated through Equations ( 7) and ( 8), respectively.The velocity, weight (w), and position of particles can be obtained from Equations ( 9), (10), and ( 11) in every iteration.Table 3 indicates the input parameters required to implement the PSO algorithm in neural network training.The position and initial velocity of particles can be calculated through Equations ( 7) and ( 8), respectively.The velocity, weight (w), and position of particles can be obtained from Equations ( 9), (10), and (11) in every iteration.Table 3 indicates the input parameters required to implement the PSO algorithm in neural network training.
v i 0 = x min + rand (x max − x min ) ∆t (8) where x i 0 is the current position of the particle, x min and x max are, respectively, the minimum and maximum coordinates of the particle i, v i 0 is the initial velocity of particle i, v i t+1 is the velocity of particle i at t + 1, φ 1 and φ 2 are the coefficients of motion tendency adjustment towards global optimal or best solution obtained by particle i, p i is the best position experienced by particle i, p g t is the best position experienced by all particles until t; and x i t is the position of particle i at t.

Monte Carlo Simulation
The Monte Carlo method is a computational algorithm using the random sampling to obtain results.The Monte Carlo methods are usually employed to simulate physical, mathematical, and economic systems.Such methods are often used when a mathematical or physical system is being simulated.Since they rely on iterative computations and random or false-random numbers, the Monte Carlo methods are often adjusted in a way that they can be executed by computers.In this study, the Monte Carlo simulation was used to select previous Big Data at random and compute the objective function and values of supply and demand generated in every step of the PSO algorithm.Table 4 shows the simulation parameters of this method.

PSO
The PSO was introduced in Section 3.2.This algorithm will also be used in the simulation-optimization conducted on previous Big Data.Table 5 indicates the input parameters of PSO used for preprocessing data.First, it is necessary to point out that the problem of generating solutions close to the current solution is classified as the knapsack or rucksack problem.Such problems are solved by using metaheuristic algorithms because they are considered hard problems [53].Now the knapsack problem is described briefly.
Known as the knapsack or rucksack problem, it is combinatorial optimization problem.Assume that a group of objects is available with specific versions or values.Every object is allocated a certain number so that the weights of selected objects are smaller or equal to a predetermined limit; however, values are maximized.
Assume that there are n objects, numbered from 1 to n.The value of ith object is v i , and its weight is w i .It is usually assumed that weights and values are nonnegative.For a simpler presentation, it can be assumed that objects are sorted in an ascending order of weights without damaging the problem generality.The maximum weight that can be carried in a knapsack is W.
The most famous type of such a problem is the 0 and 1 knapsack problem.In other words, there is zero of every object (not selected) or one of every object (selected).The 0 and 1 knapsack problem can be stated mathematically: The bounded knapsack problem is another version in which the number of objects is a real and nonnegative value.It is equal to c i at the most.In mathematical terms, ∑ n i=1 v i x i should be maximized in a way that ∑ n i=1 w i x i ≤ W , x i ∈ [0, c i ].In this study, the values of input parameters were selected with the assumption that their values and weights were equal.The values were selected in the minimum-to-maximum range of every parameter.However, a variance y i was used in the objective function to prevent the convergence of all solutions to a specific group of values: The goal of executing simulation-optimization on the big data of the electricity market was to find the initial solutions with the least variation from the current parameters ( Given the fact that it is not possible to form a specific model between the time and values of input parameters, simulation was used to calculate the values of the objective function and predict supply and demand based on random points selected for the new points generated by the PSO.The hybrid of simulation and optimization can analyze Big Data of the electricity market at a high speed.Therefore, the sets of initial solutions can be added into the wavelet-PSO-NNs model (Figure 9).In this algorithm, the initial population is generated first by the PSO.New populations are generated in accordance with the steps described in Section 3.3.2.The Monte Carlo simulation method was used to calculate the value of the fitness function.According to Section 3.3.1,a set of random populations is generated first based on time.Then the values of objective function, supply, and demand are calculated by considering the difference between the current solution (  = ( 1 .⋯ .  )) and random solutions selected in the P step of PSO (yp = (y1, y2, ..., ym)).Figure 10 shows the necessary equations.Then the value of fitness function and predicted values of supply and demand were given back to the PSO to resume simulation.The algorithm would be terminated, if the maximum number of iterations were achieved (Table 5).The steps are taken separately for supply and demand values.In this algorithm, the initial population is generated first by the PSO.New populations are generated in accordance with the steps described in Section 3.3.2.The Monte Carlo simulation method was used to calculate the value of the fitness function.According to Section 3.3.1,a set of random populations is generated first based on time.Then the values of objective function, supply, and demand are calculated by considering the difference between the current solution (z current = (z 1 .• • • .zm )) and random solutions selected in the P step of PSO (y p = (y 1 , y 2 , ..., y m )). Figure 10 shows the necessary equations.Then the value of fitness function and predicted values of supply and demand were given back to the PSO to resume simulation.The algorithm would be terminated, if the maximum number of iterations were achieved (Table 5).The steps are taken separately for supply and demand values.Step 1.The data are analyzed by the SO algorithm (Section 3.3).The best selected solutions are in the closest status to current parameters.This algorithm is able to search in the previous Big Data of the electricity market.Such an extensive search is conducted in a limited interval because it is smart.This algorithm is run until the termination condition is met.After that, the predicted values of S and D are entered into Step 2.
Step 2. In this step, the time series of the previous step are decomposed by the Haar wavelet transform.The decomposition is done through equations introduced in Section 3.1.
Step 3. Based on the data analyzed in Step 2, certain weights are determined for parameters through neural networks and PSO.This step is kept on until the number of algorithm execution reaches 1000 (the number of epochs).Then the algorithm is terminated.
Step 4. In this step, the wavelet is combined so that the values of supply and demand can be predicted.The output values are the best values predicted for supply and demand (   and    ).

An Instance of the New Technique
The results of predicting supply and demand were obtained from coding and implementing the algorithm in Matlab R16a ® (USA,California)('nftool', 'wavemenue').Figure 12 shows the inputs and components decomposed in the Haar wavelet for the first future interval and LOTD = 720.Step 1.The data are analyzed by the SO algorithm (Section 3.3).The best selected solutions are in the closest status to current parameters.This algorithm is able to search in the previous Big Data of the electricity market.Such an extensive search is conducted in a limited interval because it is smart.This algorithm is run until the termination condition is met.After that, the predicted values of S and D are entered into Step 2.
Step 2. In this step, the time series of the previous step are decomposed by the Haar wavelet transform.The decomposition is done through equations introduced in Section 3.1.
Step 3. Based on the data analyzed in Step 2, certain weights are determined for parameters through neural networks and PSO.This step is kept on until the number of algorithm execution reaches 1000 (the number of epochs).Then the algorithm is terminated.
Step 4. In this step, the wavelet is combined so that the values of supply and demand can be predicted.The output values are the best values predicted for supply and demand (S t Forcast and D t Forcast ).

An Instance of the New Technique
The results of predicting supply and demand were obtained from coding and implementing the algorithm in Matlab R16a ® (USA, California)('nftool', 'wavemenue').Figure 12 shows the inputs and components decomposed in the Haar wavelet for the first future interval and LOTD = 720.

The Implementation Accuracy
In this paper, the mean squared error (MSE) was used to compute and compare errors.RMSE is calculated to predict supply, demand, and the average summation of supply and demand.Equations ( 12)-( 14) show how RMSE is calculated: = (  +   )/2 Here    and    show the actual values of supply and demand at t, respectively.
Such data were obtained through coding new techniques in Matlab R16a ® (Natick, MA, USA).The In this paper, the mean squared error (MSE) was used to compute and compare errors.RMSE is calculated to predict supply, demand, and the average summation of supply and demand.Equations ( 12)-( 14) show how RMSE is calculated:    Figure 14 shows the MSET in the first to fourth future intervals.Figure 14 shows the MSE T in the first to fourth future intervals.According to Figure 14, the new technique resulted in the best predicted values for the first to fourth future intervals.On average, the values were 0.028, 0.045, 0.035, and 0.040, respectively, for different LOTDs.Such a comparison can be drawn in more LOTDs or parameters.According to the results, it is predicted that the new technique will maintain performance in higher LOTDs.

The Speed of the New Technique
The implementation speed will become more important when the smart grid is thoroughly established in the electricity market.In addition to increasing the accuracy, the newly proposed method will take less time to find a solution, something which really matters to the electricity market manager due to the increase speed of electricity price forecasting.Figure 15 shows the implementation speed of the new technique and other methods in constant termination conditions (0.3 ≤ MSE and max.iteration = 300) for supply and demand on average.Accordingly, the new technique improved the implementation time in comparison with WT+NNPSO.In other words, the According to Figure 14, the new technique resulted in the best predicted values for the first to fourth future intervals.On average, the values were 0.028, 0.045, 0.035, and 0.040, respectively, for different LOTDs.Such a comparison can be drawn in more LOTDs or parameters.According to the results, it is predicted that the new technique will maintain performance in higher LOTDs.

The Speed of the New Technique
The implementation speed will become more important when the smart grid is thoroughly established in the electricity market.In addition to increasing the accuracy, the newly proposed method will take less time to find a solution, something which really matters to the electricity market Data 2018, 3, 43 manager due to the increase speed of electricity price forecasting.Figure 15 shows the implementation speed of the new technique and other methods in constant termination conditions (0.3 ≤ MSE and max.iteration = 300) for supply and demand on average.Accordingly, the new technique improved the implementation time in comparison with WT+NNPSO.In other words, the forecasting time reduced by 90.66 s for different LOTDs on average.Such a reduction was observed at the same time as an increase in accuracy, discussed in Section 5.2.1.
different LOTDs.Such a comparison can be drawn in more LOTDs or parameters.According to the results, it is predicted that the new technique will maintain performance in higher LOTDs.

The Speed of the New Technique
The implementation speed will become more important when the smart grid is thoroughly established in the electricity market.In addition to increasing the accuracy, the newly proposed method will take less time to find a solution, something which really matters to the electricity market manager due to the increase speed of electricity price forecasting.Figure 15 shows the implementation speed of the new technique and other methods in constant termination conditions (0.3 ≤ MSE and max.iteration = 300) for supply and demand on average.Accordingly, the new technique improved the implementation time in comparison with WT+NNPSO.In other words, the forecasting time reduced by 90.66 s for different LOTDs on average.Such a reduction was observed at the same time as an increase in accuracy, discussed in Section 5.2.1.

Summary of Results
Comparing the speed and accuracy of the new algorithm and available algorithms shows that by increasing the amount of data under investigation, the accuracy of the new algorithm is maintained while simultaneously the slope of the execution time of the new algorithm is lower than the existing algorithms.These results show that the big data analysis of the electricity market has good results with the new algorithm in future.With the introduction of a global network of smart grids, the electricity market manager needs to use pre-processing algorithms more than ever before.

Summary of Results
Comparing the speed and accuracy of the new algorithm and available algorithms shows that by increasing the amount of data under investigation, the accuracy of the new algorithm is maintained while simultaneously the slope of the execution time of the new algorithm is lower than the existing algorithms.These results show that the big data analysis of the electricity market has good results with the new algorithm in future.With the introduction of a global network of smart grids, the electricity market manager needs to use pre-processing algorithms more than ever before.

Conclusions and Suggestions
According to the results of a case study conducted on the database of Iran's electricity market, there have been great sizes of Big Data stored since 2002.The future changes of Iran's electricity structure indicate that there will be very much greater data in the market than ever before after establishing smart grids thoroughly across Iran in the presence of retail buyers and retailers.In this problem, it was assumed that the use of previous big stored data would be effective in the better forecasting of important variables, i.e., supply and demand.Therefore, neural network techniques were developed along with one of the simulation-optimization algorithms (PSO-Monte Carlo) to improve the ability of current techniques to predict big variables of the electricity market and reduce the implementation time in the presence of such variables.According to the results, there is appropriate information in the big sizes of data stored in the electricity market.The forecasting of important variables can be improved by conducting appropriate search in data.However, it is necessary to employ metaheuristic algorithms due to the big sizes of data.Given the lack of a specific model for establishing relationships between current parameters and data storage time, simulations were conducted to obtain the objective function and predict the values of supply and demand.It is suggested that other Big Data analysis methods, one of which is machine learning, should be developed and used in short-term electrical load forecasting techniques.It is also suggested that the proposed technique be combined with the fuzzy logic.In general, due to the restructuring of the electricity market in the world, it is recommended to use methods that have high speed and precision in prediction.Furthermore, some suggestions are made for future studies: 1.
Using other intelligent meta-heuristic methods for selecting the input data of neural networks (making data selection more intelligent).

2.
Employing the fuzzy logic in the newly proposed model.

Figure 1 .
Figure 1.The background to the proposed technique.

Figure 1 .
Figure 1.The background to the proposed technique.

Figure 3 .
Figure 3. Data size comparison at the time of implementing the global smart grid in IEM.

Figure 3 .
Figure 3. Data size comparison at the time of implementing the global smart grid in IEM.

Figure 4 .
Figure 4.The three-step decomposition of supply and demand variables.

Figure 4 .
Figure 4.The three-step decomposition of supply and demand variables.

Figure 5 .
Figure 5.The three-step combination of supply and demand values.

Figure 5 .
Figure 5.The three-step combination of supply and demand values.

Figure 5 .
Figure 5.The three-step combination of supply and demand values.

Figure 10 .
Figure 10.Diagram of SO details.Figure 10.Diagram of SO details.

Figure 10 .
Figure 10.Diagram of SO details.Figure 10.Diagram of SO details.

Figure 12 .
Figure 12.The results of executing algorithm for predicting the first future interval with LOTD = 720.

Figure 12 .
Figure 12.The results of executing algorithm for predicting the first future interval with LOTD = 720.5.2.Analyzing the Accuracy and Speed of the New Technique5.2.1.The Implementation Accuracy

Figure 13 .
Figure 13.MSE boxplot of supply and demand in different methods for predicting the first future interval.

Figure 14 .
Figure 14.Comparing the new technique with the old technique in the implementation accuracy for LOTD = 180, 360, 720, 1440.

Figure 14 .
Figure 14.Comparing the new technique with the old technique in the implementation accuracy for LOTD = 180, 360, 720, 1440.

Figure 15 .
Figure 15.The diagram of accuracy and speed in the implementation of different techniques for predicting the four future intervals (LOTD = 180, 360, 720, 1440).

Figure 15 .
Figure 15.The diagram of accuracy and speed in the implementation of different techniques for predicting the four future intervals (LOTD = 180, 360, 720, 1440).

Figure 16
Figure 16 also shows by increasing the data under investigation, improved speed, and accuracy of the algorithm are preserved.The diameter of the circle represents MSE T .

Figure 16
Figure 16 also shows by increasing the data under investigation, improved speed, and accuracy of the algorithm are preserved.The diameter of the circle represents MSET.

Table 1 .
Stored parameters of IEM databases.

Table 1 .
Stored parameters of IEM databases.

Table 5 .
Execution parameters of PSO.
Actualshow the actual values of supply and demand at t, respectively.Such data were obtained through coding new techniques in Matlab R16a ® (Natick, MA, USA).The forecasting errors of the new technique were compared with those of the older ones, in which wavelet transforms or metaheuristic algorithms were not used.The new and old techniques were different in LOTD.Tables6-9show the root median squared error obtained from 100 executions of the new technique.The results include forecasting for one to four future intervals.