## 3 Rolling-MFO-GM (1,1) Model
### Mfo-Gm (1,1)  
Generally, the parameters \(a\) and \(b\) of GM (1,1) are usually determined by the least square estimation method [56]. However, as the accuracy of forecasting is required to be enhanced, many scholars have employed various kinds of methods to optimize these two parameters, such as intelligent optimization algorithms, which can improve the forecasting performance of grey model. In this paper, the two parameters of GM (1,1) are optimally determined by MFO on the purpose of improving the accuracy of annual electricity consumption. The procedures of MFO-GM (1,1) are elaborated below.  
Step 1: Parameters initialize.  
Five parameters should be set firstly, which are the number of moths and flames, _Agents_no_; the number of variables, \(dim\); the maximum iteration number, \(Max\_iteration\); and the lower bound, \(lb=[lb_{1},lb_{2},lb_{3},...,lb_{n-1},lb_{n}]\), and upper bound, \(ub=[ub_{1},ub_{2},ub_{3},...,ub_{n-1},ub_{n}]\), variables. In this paper, it is assumed that _Agents_no_ = 100, \(dim=2\), \(Max\_iteration\) = 1000, \(lb\) = [-10, 10], \(ub\) = [0, 10,000].  
Figure 3: Number of flame is declined adaptively during the course of iterations.  
Step 2: Optimization starts.  
When employing MFO to optimize the parameters of GM (1,1), the fitness function should be determined firstly. This paper uses the Mean Absolute Percentage Error (_MAPE_, shown as Equation (21)) to build the fitness function.  
\[MAPE=\frac{1}{n}\sum_{k=1}^{n}\left|\frac{x(k)-\hat{x}(k)}{x(k)}\right|\times 1 00\% \tag{21}\]  
where \(x(k)\) is the practical value at time \(k\); and \(\hat{x}(k)\) is the forecasting value at time \(k\).  
In MFO-GM (1,1), the parameters \(a\) and \(b\) are determined by the position of flames stored in the column vector \(OF\). According to the initialization position generated by Equation (16), GM (1,1) can be built, and Equation (13) can be calculated. The actual data sequence \(\left\{x^{(0)}(1),x^{(0)}(2),\cdots,x^{(0)}(p)\right\}\) is selected as the input sequence, and then the forecasting sequence \(\left\{\hat{x}^{(0)}(1),\hat{x}^{(0)}(2),\cdots,\hat{x}^{(0)}(p)\right\}\) can be calculated in accordance with the GM (1,1). Furthermore, the fitness function can be confirmed which minimizes the result of _MAPE_ of forecasting data elements, which is defined as follow:  
\[f=\min\frac{1}{p}\sum_{k=1}^{p}\left|\frac{x^{(0)}(k)-\hat{x}^{(0)}(k)}{x^{(0) }(k)}\right|\times 100\% \tag{22}\]  
Up to now, the best solution can be selected at the first iteration. The next 999 iterations (the maximum iterations, 1000, minus the initial iteration, 1) will be carried out on the basis of this optimization mechanism of MFO.  
Step 3: Optimization ends.  
In the process of optimization, different _MAPE_s would be generated due to the different parameters values, and the best _MAPE_ could be found by the end of the optimization. Furthermore, the optimal parameters \(a\) and \(b\) could be calculated by MFO based on Equation (22). Then, the future data can be forecasted by substituting the optimal parameters \(a\) and \(b\) into Equation (13).  
The process of MFO-GM (1,1) is illustrated in Figure 4.  
Figure 4: Flow process diagram of grey model (1,1) optimized by moth-flame optimization algorithm (MFO-GM (1,1)).