# Off-Grid Power Plant Load Management System Applied in a Rural Area of Africa
## 4 Real-Time Load Predictor  
The proposed real-time load predictor is based on a part of our previous work, which employs ARIMA as its main regression model and uses BIC to avoid the over- or underfitting problems in real-time processes caused by the general training approach of ARIMA [5]. ARIMA (\(p\), \(d\), \(q\)) is an improved regression model, and its related initial model is the autoregressive moving average (ARMA). An ARMA (\(p\), \(q\)) model can be expressed as Equation (1) [19]:  
\[\begin{split}\mathbf{y}_{t}\ =\ a_{1}y_{t-1}+a_{2}y_{t-2}+\ldots+a_{p}y_{ t-p}+n_{t}+b_{1}n_{t-1}+\ldots+b_{q}n_{t-q}\end{split} \tag{1}\]  
where \(\mathbf{y}_{t}\), the value at time \(t\), is a function of the previous \(p\) values, i.e., \(y_{t-1},y_{t-2},\ldots,y_{t-p}\). The errors at times \(t,t-1,\ldots,t-q\) are \(n_{t-1},n_{t-2},\ldots,n_{t-q}\). \(p\) is the number of autoregressive terms; \(a_{1},\ldots a_{p}\) are the autoregressive coefficients; \(q\) is the lagged forecast error; and \(b_{1},\ldots b_{q}\) are the moving average coefficients.  
ARIMA is used to address the limitation of ARMA that can only be applied in stationary series regression [19]. Therefore, in this study instead of fitting the data directly, ARIMA first transforms the nonstationary time series data into a stationary \(d\)-order difference series, where \(d\) is the order  
Figure 2: The results of routine analysis. (**a**) Off-grid solar power plant load; (**b**) Routine analysis. As our method is applied in a rural area of Tanzania, the power consumption of the entire village is relatively low.  
of the difference. Then, the obtained stationary \(d\)-order difference series is obtained and used for forecasting. In this study, based on the results of the routine analysis, \(d\) is set to 1.  
However, according to our previous research and the results of routine analysis, even though the \(d\)-order difference series of the initial time series is stationary, in real-time time series prediction, ARIMA still has difficulty avoiding overfitting or underfitting problems in the real-time prediction process. The preset values of \(p\) and \(q\) may lead the ARIMA model to fail to precisely fit the latest historical load data in each step, which eventually led to a decline in prediction accuracy. Because of the nonstationary characteristics of the time series, any prior training and preset parameters of the model will lead to a decrease in the fitting degree. Therefore, BIC is introduced into real-time prediction to provide a real-time optimal regression model selection function, avoiding over- or underfitting problems caused by preset parameters [5].  
The general idea of BIC is to reduce unrestricted models to accurate benchmarks by using prior information knowledge, reducing parameter uncertainty and improving prediction accuracy [19]. After scoring the fitting results of all the candidate models, the model with the lowest BIC score is selected as an indicator of the best fitting result. We assume that the maximum values of both \(p\) and \(q\) are \(n\), yielding \(n^{2}\) regression scenarios numbered from 1 to \(n^{2}\). We obtain \(n^{2}\) BIC scores and then select the regression with the lowest BIC [5]. The BIC is [20]:  
\[\text{BIC}\ =\ k\times ln(m)-2\times ln\Big{(}\hat{L}\Big{)} \tag{2}\]  
where \(\hat{L}\) is the maximum value of the model likelihood function, \(m\) is the sample size, and \(k\) is the number of model parameters. In this study, the sample size \(m\) is equal to \(n^{2}\), and \(k\) is equal to \(2\) (\(p\) and \(q\)). \(n^{2}\) is set as \(n^{2}\ =\ U\)-\(U^{T}\), where \(U\) is a vector [0, \(k\)], i.e., [0,2] [5].  
To improve the fitting degree and applicability of the ARIMA model in real-time prediction, the BIC is introduced for automatic model optimization. In each prediction step, the moving window selects the historical data from the past 24 h to update the ARIMA model, and the BIC is simultaneously utilized to select the optimal parameter set for the ARIMA model.