Research Article

Monthly Electricity Consumption Forecasting Method Based on X12 and STL Decomposition Model in an Integrated Energy System

Algorithm 2

Procedure of the monthly electricity consumption forecasting method based on X12 and STL decomposition models.
Input: Monthly GDP time series E; monthly electricity consumption time series Y
Output: Predicted value of monthly electricity consumption
(1)function X12
(2)  Decompose GDP sequence E
    
(3)function stl (ltsObject, s.window, robust = TRUE)
(4)  while ltsObject on season stabilization points
(5)   s.window ⟵ period
(6)  while ltsObject on season alternation points
(7)   s.window ⟵ 2n + 1, n > 3
(8)  end while
(9)  Decompose monthly electricity consumption sequence Y
(10)end function
(11) Predict the trend components
(12)  function VAR
(13)   Estimate the model with the least squares method
(14)   Calculate the current sample output
(15)  end function
(16) Predict the seasonal components
(17)  function
(18)   Randomly initialize all connection weights and thresholds in the network within the range of (0, 1)
(19)   repeat
(20)    for all do
(21)    Calculate the current sample output
(22)    end for
(23)   until the stop conditions are achieved
(24)  end function
(25) Predict the random components
(26)  
(27) Reconstruct the predicted value of monthly electricity consumption
(28)