With the rapid development and wide application of distributed generation technology and new energy trading methods, the integrated energy system has developed rapidly in Europe in recent years and has become the focus of new strategic competition and cooperation among countries. As a key technology and decisionmaking approach for operation, optimization, and control of integrated energy systems, power consumption prediction faces new challenges. The userside power demand and load characteristics change due to the influence of distributed energy. At the same time, in the open retail market of electricity sales, the forecast of electricity consumption faces the power demand of smallscale users, which is more easily disturbed by random factors than by a traditional load forecast. Therefore, this study proposes a model based on X12 and Seasonal and Trend decomposition using Loess (STL) decomposition of monthly electricity consumption forecasting methods. The first use of the STL model according to the properties of electricity each month is its power consumption time series decomposition individuation. It influences the factorization of monthly electricity consumption into season, trend, and random components. Then, the change in the characteristics of the three components over time is considered. Finally, the appropriate model is selected to predict the components in the reconfiguration of the monthly electricity consumption forecast. A forecasting program is developed based on R language and MATLAB, and a case study is conducted on the power consumption data of a university campus containing distributed energy. Results show that the proposed method is reasonable and effective.
An integrated energy system generally refers to the optimization of the allocation of various energy resources in accordance with the energy structure and energy endowment of a region. It often combines advanced technologies, such as waste heat utilization, heat pump, and energy storage, thereby fully using high and lowgrade energy to provide technical solutions for cold, hot, and electric products for users in the region. As an important approach to accelerate the transformation to sustainable energy worldwide, the integrated energy system has attracted much attention in recent years. Accurate electricity consumption forecasting not only plays a decisive role in comprehensive planning, operation, management, and cascade utilization of energy system, but also acts as a key technology to promote the energy market. To date, load forecasting technology is mature [
Electricity consumption forecasting of integrated energy systems involves studying power data and analyzing their characteristics, determining the internal variation law of historical data and the relationship between historical data and their influencing factors, and then predicting power demand [
Literature review summary.
Ref.  Forecasted variable(s)  Forecasting method(s)  Decomposition method(s)  Decomposition component(s) 

[ 
Monthly load  ARIMA  X12  Trend, seasonal, and irregular components. 
[ 
Daily and weekly load  NN  Wavelet transform  Trend load series under different frequency bands and the detailed load series. 
[ 
Monthly load  Hybrid method combining ARIMA, support vector machine (SVM), and HoltWinters  Seasonal adjustments and HP filter  Trend, seasonal, cyclic, and irregular components. 
[ 
Fault line(s)  Intrinsic mode function (IMF)  Empirical mode decomposition (EMD)  Zero sequence current at different frequencies. 
[ 
Monthly load  NN  Moving regression and smoothing spline decomposition models  Trend and fluctuation series. 
[ 
Monthly load  SARIMA  Multiplicative decomposition  Trend and seasonal components. 
[ 
Monthly load  ARIMA  X12  Trend, seasonal, and random components. 
[ 
Monthly number of a software bug  Hybrid method combining ARIMA, X12, and polynomial regression  X12  Seasonal and cyclic components. 
[ 
Monthly load  Hybrid method combining ARIMA and vector error correction (VEC)  X12  Trends of load and economy, seasonality, holiday, and irregular components. 
[ 
Mean flying hours between failures for aircraft  Hybrid method combining grey box, back propagation NN (BPNN), and SVM.  STL  Longterm trend and seasonal components. 
[ 
Future geospatial incidence levels  Kernel density estimation with dynamic kernel bandwidth  STL  Annual, seasonal, weekend effect, and random components. 
[ 
Bids for amazon EC2 spot instances  Benchmarked time series forecasting methods such as naïve, ARIMA, and ETS  STL  Spike and seasonal components. 
[ 
Daily and weekly load  Hybrid method combining HoltWinters and SVR  STL  Base component and weather sensitive component. 
This paper proposes a monthly power consumption comprehensive forecasting method based on the Seasonal and Trend decomposition using Loess (STL) model, which is a time series decomposition model based on the local weighted regression scatter smoothing method. The model can process data for any type of seasonal variation factor, and users can control the seasonal component change rate and the smoothness of the trend component. In addition, it is more robust to outliers. The STL model has been applied in many fields [
In the monthly electricity sales forecast, predicting the electricity sales of the following month based on the historical electricity sales data is necessary, taking into account the climate, seasons, holidays, user types, economy, and other factors. In the prediction process, monthly electricity consumption can be decomposed into components that represent various influencing factors, and the effects of different influencing factors on each component can be considered to select an appropriate model to predict the monthly electricity consumption. The problem description of the monthly electricity sales forecast is shown in Figure
Monthly electricity sales forecast problem description diagram.
Monthly electricity consumption with the development of time is variable. The change in the nature of human activity, such as seasonal change (e.g., in schools, electricity use is reduced during winter and summer vacations), causes power consumption to increase or decrease [
Monthly electricity consumption curve of a university park in Shenyang from 2010 to 2017.
Figure
In addition to the winter and summer holidays and the Spring Festival, the turning point of the electricity consumption curve is related to the abrupt change of seasons. Winter and spring occur in January, spring and summer in March, summer and autumn in July, and autumn and winter in October. Figure
Electric power is required for a developing economy, and regional economic development is closely related to electric power demand [
The quarterly gross domestic product (GDP) data of a northern city from January 2010 to December 2017 and the monthly electricity consumption data of a university park in North China from January 2010 to December 2017 are used in the analysis because GDP is an important indicator to measure the regional economic conditions. However, monthly GDP data cannot be obtained at present due to limited data availability [
A university park in a northern city provided the power consumption data from January 2010 to December 2017. The National Bureau of Statistics provided the quarterly GDP data of a certain northern city from January 2010 to December 2017. The quarterly GDP growth rate and power consumption quarteronquarter growth changes over time clusters are plotted in the bar chart, as shown in Figure
Trend of quarterly GDP and monthly electricity consumption.
Figure
The variation characteristics of time series of each component are different due to different influencing factors [
Strategy diagram of comprehensive monthly electricity consumption forecast method based on the X12 and STL decomposition models.
The proposed monthly electricity consumption prediction method based on the X12 and STL decomposition models combines a variety of mathematical models. The trend components in economic data were extracted by the X12 decomposition model, and the trend components of economic factors and electricity consumption were fitted by the VAR model. The seasonal component can be extracted from the historical data of electricity consumption because the time contains the information of seasons and holidays, and the BP neural network model is established for prediction. If the random component changes irregularly and its value fluctuates at approximately 1, then the average value method is used for direct calculation. This paper takes a university campus in North China as an example to verify the validity of the monthly electricity consumption prediction method based on the X12 and STL decomposition models.
The STL model is a time series decomposition method that uses robust localweighted regression as a smoothing method. When estimating the value of a response variable, a subset of data is selected from the vicinity of the predicted variable, and then linear or quadratic regression is performed on the subset by using the weighted least squares method to reduce the weight of the value far from the estimated point. Finally, the value of the response variable can be estimated by the local regression model. This pointbypoint method is generally used to fit the whole curve to decompose the time series accurately [
The decomposition model is mainly divided into the time series additive model and the time series multiplication model. The additive model assumes that the influence of each component is independent of each other, and each component is expressed in absolute terms. The multiplication model assumes that the influence of each component on the development of phenomena is interrelated based on the absolute amount of the trend component, and the other components are expressed in proportion. The decomposition model adopts the multiplication model because of the interactive influence of each factor on electricity consumption. The monthly electricity consumption series is expressed by the product of three components, which represent the trend, seasonal, and random factors. The original time series can be decomposed as follows:
When decomposing, the seasonal component of the month at the seasonal inflection point fluctuates greatly with time, and the seasonal component of the same month should be changed every year. Thus, the nonperiodic decomposition of seasonal component is adopted, whereas the seasonal component of the month at the nonseasonal inflection point fluctuates slightly with time, and the seasonal component of the same month every year is almost constant. The seasonal component is used for periodic decomposition.
The economic factors and electricity consumption are affected by seasonal changes and random factors, but the influence of economic factors on electricity consumption is mainly reflected in the trend components [
The trend component is a development direction formed by the influence of economic growth over a long period of time; it shows a stable trend. Seasonal component is a periodic fluctuation that is affected by seasonal alternation. Random components are small perturbations that exhibit no obvious change in characteristics under the influence of accidental factors. Three models are selected to predict the trend, seasonal, and random components.
The VAR model is one of the most commonly used econometric models for the analysis and prediction of economic indicators. GDP data were taken as the influencing factors of monthly electricity consumption and included in the VAR model to predict the trend component of electricity consumption. The model is built based on the statistical properties of data and takes each endogenous variable in the system as a function of the lagged value of all endogenous variables to construct the model [
That is, the VAR (
When considering the unrestricted VAR model without exogenous variables, the expression is as follows:
If the determinant
The estimation of the VAR model can be performed through the least square method, and the estimator of the matrix can be obtained as follows:
When forecasting seasonal components, we should consider the month on season alternation points and season stabilization points.
For months on season stabilization points, the seasonal components are decomposed periodically. The seasonal component of the predicted month is the same as that of the same period in history, that is,
where
For months on season alternation points, the seasonal components are decomposed nonperiodically, and the seasonal components change greatly during the historical period. The BP neural network is adopted to predict the seasonal component, and the process includes forward propagation process deduction and error reverse propagation process deduction. The BP neural network prediction model is
Randomly initialize all connection weights and thresholds in the network within the range of (0, 1)
Calculate the current sample output
Calculate the gradient of the output neuron
Calculate the gradient of the hidden layer neuron
Update the weights
Update the threshold
No evident change trend is observed in the random components, and the value is less than 1. The average method is used to predict the random components of the sequence. The random components of the predicted month are considered the historical average of the random components of the same month. The average prediction model is
After the predicted value of each component is obtained, the final predicted value of the monthly electricity consumption is obtained by using exponential multiplication, that is,
The detailed steps of the monthly electricity consumption forecasting method based on the X12 and STL decomposition models are presented in Algorithm
Decompose GDP sequence
s.window ⟵ period
s.window ⟵ 2
Decompose monthly electricity consumption sequence
Predict the trend components
Estimate the model with the least squares method
Calculate the current sample output
Predict the seasonal components
Randomly initialize all connection weights and thresholds in the network within the range of (0, 1)
Calculate the current sample output
Predict the random components
Reconstruct the predicted value of monthly electricity consumption
A comprehensive forecasting program for monthly electricity consumption based on the STL model is compiled by using R. The data are obtained from the measured monthly electricity consumption in a university park over a period of eight years. A fixed sample size is used to model and forecast the monthly electricity consumption. The monthly electricity consumption data in the first seven years are used as the sample model, and the monthly electricity consumption data in the eightyear period are used as the true value evaluation model.
The STL model can control the seasonal component change rate and then change the seasonal component of the sequence. The seasonal component of electricity consumption in the inflection point month and common month can be separated. The season of the same month changes every year, whereas the seasonal fluctuation of electricity consumption in other months decreases because January and February are affected by the Spring Festival and winter vacation, July and August are affected by summer vacation, and March and November are affected by seasonal alternation. Therefore, the seasonal components of January to March, July to August, and November are decomposed nonperiodically, and the seasonal components of April to June, September to October, and December are decomposed periodically. The monthly electricity consumption is decomposed by the STL function in R language. The multiplicative model is transformed into the logarithmic additive model by logarithmic transformation because the STL function can only deal with the additive model, that is,
Taking March and April as examples, the STL function is used to draw the change curve of the sequence object
March (a) and April (b) trends of original electricity consumption sequence with its components.
Econometric Views or EViews is commonly referred to as an econometric package. It is a time series software specially developed for large organizations to process time series data [
The GDP of each quarter is divided into months, on average, to obtain the approximate monthly GDP data to ensure that the sample size of the economic factors is consistent with monthly electricity consumption. The monthly GDP data of a city in the north are obtained and decomposed using the X12 model. Proc/Seasonal Adjustment/X12 is used to obtain the trend component data of GDP. The natural logarithm of trend components can be initially obtained, and then the VAR model can be established after data processing to ensure the stability of data. The trend component of GDP is shown in Figure
GDP trend component curve.
The lag order is represented by
Confidence interval for the lag order of the VAR model.
Lag  Log L  LR  FPE  AIC  SC  HQ 

0  −919.8341  NA  45308.415  25.60650  25.66974  25.63168 
1  −519.9274  766.4878  7581.285  14.60910  14.79882  14.68462 
2  −392.8206  236.5599  248.1805  11.18946  11.50567  11.31534 
3  −322.0301  127.8163  38.84761  9.334168  9.776853  9.510403 
4  −304.8392  30.08404  26.96743  8.967755  9.536922  9.194342 
5  −295.4543  15.90214  23.27183  8.818175  9.513823  9.095115 
6  −293.7491  2.794622  24.88266  8.881920  9.704049  9.209212 
7  −277.5902  25.58493  17.82851  8.544173 


8  −273.6755  5.980746  17.97444  8.546543  9.621635  8.974540 
9  −273.2689  0.598628  20.00905  8.646359  9.847933  9.124709 
10  −266.7881  9.181128  18.85117  8.577448  9.905503  9.106151 
11  −257.7192 



9.891182  9.015701 
12  −255.9084  2.364098  17.84887  8.497456  10.07847  9.126864 
Table
The VAR model is effective in predicting the interrelated time series variable system. If the variables are not related to each other, then the VAR model [
Exogenous test results.
Excluded  Chisq  df  Prob. 

GDP_HP  30.56972  11 

All  30.56972  11  0.013 
POWER_HP  23.12329  11  0.0170 
All  23.12329  11  0.0170 
Dependent variable: LNGDP. Dependent variable: GDP_HP.
The model parameters are estimated. Then, the VAR setting box of GDP and electricity consumption data is opened, the OK button is clicked, and the estimation result window pops up, as shown in Table
VAR parameter estimation results.
LNGDP  POWER_T  

GDP_HP(−1)  0.892644  −0.318902 
(0.11730)  (0.30656)  
[7.61004]  [−1.04026]  
GDP_HP(−2)  −0.025358  0.608604 
(0.12315)  (0.32184)  
[−0.20592]  [1.89100]  
POWER_HP(−1)  −0.020718  −0.160956 
(0.04430)  (0.11577)  
[−0.46773]  [−1.39035]  
POWER_HP(−2)  0.005056  0.036296 
(0.04195)  (0.10965)  
[0.12052]  [0.33102]  
C  −0.001664  −0.006855 
(0.00618)  (0.01615)  
[0.26925]  [0.42438] 
The first part of the output shows the ordinary least squares (OLS) regression statistics for each equation. The second part of the output shows the regression statistics of the VAR model [
The impulse response is performed to understand the interaction between variables and the degree of influence [
Impulse response diagram of power consumption.
In the figure, the horizontal axis represents the number of lag periods of impact; the vertical axis represents the growth rate reflecting the trend component of GDP and electricity consumption; the solid line represents the impulse response function, the response degree, and duration of this variable at present and in the future after the impact of one standard deviation of the random error term of other variables; and the dotted line represents the deviation zone of plus or minus two standard deviations [
For months on season stabilization points: historical contemporaneous values were directly taken as the predicted values of seasonal components in the current period.
For months on season alternation points: the BP neural network is written in MATLAB editor program code to predict the profits in the first 12 months as samples. Thus, the set of 12 input neurons and output neurons is 1. The current monthly electricity consumption is forecasted. Then, the “run” button is clicked, and the simulation results on the normalized prediction data, namely, the electricity consumption forecast of the current month using seasonal cycle components, are obtained. The training process and parameters of the BP neural network are shown in Figure
Training process of the BP neural network.
The predicted value of the random component in the current period is expressed by the average historical value of the random component of the fixed sample size, according to Model 12.
Four models are programmed and analyzed using the combined R language and MATLAB.
The ARIMA model is established based on the previous change law of electricity consumption in accordance with the time series characteristics of electricity consumption, without considering the influence of many factors, and the monthly electricity consumption are predicted using conventional linear regression.
The SARIMA model is established to predict the monthly electricity consumption by eliminating the seasonal effects on the series through the seasonal difference method in accordance with the time series characteristics of electricity consumption, considering only the seasonal factors affecting the monthly electricity consumption.
The monthly electricity consumption series is expressed by the product of three components, which represent the trend, seasonal, and random factors, in accordance with the time series characteristics of electricity consumption, and three components are modeled and predicted by considering the influence of different factors.
The change rate of seasonal components is set, and the time series is customized and decomposed by the STL model in accordance with the time series characteristics of electricity consumption in different months. Three components are predicted considering the influence of different factors.
The actual monthly electricity consumption data and forecast results of a university park in 2017 are shown in Table
Prediction results of monthly electricity consumption in 2017.
Month  True value (kW·h)  Predicted value (kW·h)  

Model 1  Model 2  Model 3  The proposed method  
1  1442390  1015637  1373173  1367599  1486094 
2  845119  949851  1005304  819824  812497 
3  685767  769105  649486  602850  701265 
4  1229505  896167  1305590  1180485  1267620 
5  1060960  1014361  1084692  1118136  1004093 
6  1066720  1000885  1121492  1151494  1005170 
7  1020280  1015933  1075962  1071765  969470 
8  763400  869250  868404  781979  745155 
9  653626  737681  706551  656776  678921 
10  830280  823047  893032  870825  868556 
11  1059400  904942  1306999  1183896  1130486 
12  1110200  1000357  1272306  1162874  1133625 
Prediction graphical results of monthly electricity consumption in 2017.
Mean absolute error (MAE), root mean square error (RMSE), relative error, and mean absolute percentage error (MAPE) values were selected to evaluate the performance of the model. The error evaluation of the results of the four prediction methods is shown in Table
Assessment of monthly electricity consumption forecasting results for 2017.
Month  Model 1  Model 2  Model 3  The proposed method 

Relative error (%)  Relative error (%)  Relative error (%)  Relative error (%)  
1  −29.59  −4.80  −5.19 

2  12.39  18.95 

−3.86 
3  12.15  −5.29  −12.09 

4  −27.11  6.19  −3.99 

5  −4.39 

5.39  −5.36 
6  −6.17  5.13  7.95  −5.77 
7  − 
5.46  5.05  −4.98 
8  13.87  13.75  2.43  − 
9  12.86  8.10 

3.87 
10  − 
7.56  4.88  4.61 
11  −14.58  23.37  11.75 

12  −9.89  14.60  4.74 



MAPE  12.03  9.62  5.58 

MAE  127198.42  92195.00  55408.53 

RMSE  176048.17  111642.10  63829.84 

MAE can reflect the actual situation of the predicted error. The formula of MAE for the
RMSE is more sensitive to outliers. The calculation formula of RMSE for the
The relative error can reflect the reliability of the predicted value. MAPE can not only measure the deviation between the predicted value and the actual value but can also consider the ratio between the error and the actual value. The relative error and MAPE of the
The following conclusions can be drawn based on the evaluation of the prediction results of the four methods:
The relative errors of electricity consumption in 2017 reveal that the errors of the proposed method in most months are less than those of methods 1, 2, and 3. The MAPE, MAE, and RMSE values suggest that the errors of the proposed method are less than those of methods 1, 2, and 3. The forecast results show that the coincidence between the predicted value of the proposed method and the actual value is higher. These results show that the accuracy of the four methods is better than that of methods 1, 2, and 3.
The seasonal component change rate is adjusted by the STL model. The monthly prediction error indicates that the prediction error of the proposed method is less than that of method 3 in January, March, July–August, and November, of which the seasonal components are nonperiodically decomposed. Therefore, the decomposition method of changing the seasonal component change rates for different months of electricity consumption is effective.
Although the proposed method is superior to methods 1, 2, and 3 in general, the prediction error in March and November is still large because the data of seasonal inflection point month have a mutation, and the ARIMA model often has a large error when dealing with abrupt data.
In the process of using the STL model to decompose monthly electricity consumption, although human factors have been avoided as much as possible, some manual intervention and randomness cannot be avoided, as mainly reflected in the parameter setting of the algorithm. The mechanism of the STL model should be further studied.
The proposed forecasting method by combining STL and ARIMA models has achieved better performance in comparison with other classical forecasting methods, according to results of the studied sample. This improvement is also attributed to decomposition strategy that has been applied, i.e., decomposition of periodic and nonperiodic seasonal components using the STL model. However, some limitations of the proposed method do exist; meanwhile, there may be solutions that can further improve the performance of forecasting. For instance, taking into account more humanrelated factors may improve the results. Examples of these factors are energy users’ preference on comfortable temperature range related to airconditioning devices and their charging habits related to electric vehicles. In other words, developing a more detailed classification of electricity load categories and corresponding human behavior models may be a possible way to improve our work, although this requires a welldeveloped metering infrastructure and a much larger amount of data samples.
The effectiveness of using economic variables like the GDP to support monthly energy demand forecast has also been demonstrated by this study. Considering the fact that only few countries and/or regions publish their GDP on a monthly basis, utilizing other monthly economic factors, such as relative strength index or consumer price index may also be able to improve the performance. However, before an economic factor is applied, it would be necessary to study the correlation between it and the monthly energy demand to ensure the strong correlation in both direction and strength.
Following the rapid development of integrated energy systems, forecasting electricity consumption will become a key component for enabling proactive energy system planning, smart operation, accurate billing, new business related to electricity trading, etc.
When forecasting monthly electricity consumption, most methods directly model and predict the time series of historical data. However, in the actual forecasting process, the time series of the monthly power sales often contains components with different characteristics. A new method for predicting monthly power sales is proposed based on the analysis of the factors that affect the time series. The proposed method combines the STL and ARIMA models into one framework solution. Its applicability and accuracy are verified by a case study using practical time series monthly energy consumption data and quarterly GDP values related to an integrated energy system. Because it provides better accuracy than other existing methods, the potential use of this method in forecasting the energy demand of integrated energy systems is high.
No data were used to support this study.
The authors declare that they have no conflicts of interest.
This work was supported by the National Key Research and Development Program of China (no.2017YFB0902100).