*3.4. Autoregressive Integrated Moving Average*

Having a proven higher efficiency in forecasting data highly related with human activities and behavior [24,25], we used as the second forecasting method the ARIMA technique:

$$X\_t - \alpha\_1 X\_{t-1} - \dots - \alpha\_{p'} X\_{t-p'} = \varepsilon\_t + \theta\_1 X \varepsilon\_{t-1} + \dots + \theta\_q X \varepsilon\_{t-q} \tag{4}$$

where:

*Xt* represents the time series data;

*α<sup>i</sup>* represents the parameters of the autoregressive part of the model;

*θ<sup>i</sup>* represents the parameters of the moving average part;

*ε<sup>t</sup>* is the error term.

#### *3.5. Artificial Neural Network*

Available on a large scale and easy to train and use, the ANN method is the first weapon of choice after regression techniques. We used a multilevel ANN (feed forward) including gradient descent and backpropagation algorithms by minimizing error with a non-Euclidean-type function. Multilevel feed forward networks are trained via supervised methods involving the use of training instances of the form (*Xp*, *t p*)

*X<sup>p</sup> = (X<sup>p</sup> 1, Xp 2,* ... *, Xp <sup>N</sup> )* is the input vector for the training p; *t <sup>p</sup> = (tp 1, tp 2,* ... *, t<sup>p</sup> <sup>M</sup> )* is the desired output vector for p; *N* is the number of input units of the network; *M* is the number of output units.

If *F(X)* is the function processing the problem as per input *X*:

*t*

$$\mathbf{y}^p = F(\mathbf{X}^p) \tag{5}$$

then the output by processing the input data using neural network is defined by:

$$\mathbf{O}^{p} = (\mathbf{O}^{p}|\_{1}, \mathbf{O}^{p}|\_{2}, \dots, \mathbf{O}^{p}|\_{M}) \tag{6}$$

where *Op* is the result of processing of the input, *Xp*, by using the function *Fw(w;Xp)* network applied as an approximation of *F(X)*, so:

$$\mathbf{O}^p = Fw(w; \mathbf{X}^p) \tag{7}$$

The error recorded during processing through the network of the input vector *Xp*—i.e., the measured error in a unit of output *Uj*—defined by *e p <sup>j</sup>* is expressed as the difference between desired and actual output achieved:

$$e\_j^p = t\_j^p - O\_j^p \tag{8}$$

Error *Ep*, recorded during the processing through the network of the input vector *X<sup>p</sup>* and established across the whole neural network, is obtained by combining the error *e p j* based on a relationship of the form:

$$E^p = \sum\_{j=1}^{M} f\left(e\_j^p\right) \tag{9}$$

For error calculation the *E<sup>p</sup>* error and zero based log sigmoid function are used:

$$f(\mathbf{x}) = \frac{e^{a+bx}}{1 + e^{a+bx}} \tag{10}$$

#### *3.6. Forecasting Error Assesing with Mean Absolute Percentage Error (MAPE)*

Usually, the assessment of forecasting errors is conducted with two or three indicators, such as Mean Absolute Error (MAE) and MAPE of Root Mean Square Error (RMSE), but taking into consideration that the average values for rural and urban consumption per household differed significantly [14] we used only the MAPE to evaluate forecasting method accuracy.

$$MAPE = \frac{1}{N} \sum\_{i=1}^{N} \frac{\left| P\_i - \overline{P}\_i \right|}{P\_i} 100\% \tag{11}$$

where *Pi* is the power value at time *I*, *Pi* is the forecasted power value for time *i* and *N* is the number of the forecasted value.

#### *3.7. Trigger/Alarm for Atypical Consumption Behavior in Near Future*

An unpredictable and unexpected event that is related to human behavior as consumption has very limited available information that can be used in forecasting [26,27].

We assume that such an event will not be visible prior to occurrence in available databases. Therefore, we must rely on big data analytics [28] and identify a threshold using methods other than the Twitter analytics proposed in [28] that can raise the alarm for the next STLF. Behind every forecast, there is a human operator that makes sure the database is delivered correctly, and this method would first check the assumptions that are made. Knowing that all human activities are subject to error, we must try to deploy an automatic trigger that raises an alarm based on an explosion of breaking news, such that the human operator could address this alarm and decide if action is needed or if the forecast should be deployed as before [29,30].
