## 4 Experimental Setup
### Anomaly Definition  
Defining an anomaly interval or an atypical region is an important aspect of any work related to outlier detection. The definition of this interval will determine which observations will be considered anomalous. Based on information collected and consulted from various sources [55; 56], it has been determined that the anomaly interval consists of increases or decreases in electricity consumption in three different categories. Overall, anomalies in households can be caused by different factors, such as failures of appliances and sensors, bugs in the electrical system, blackouts, holidays, vacations, etc. These three categories refer to the different scenarios that can occur in real life when monitoring electricity consumption. The categories can be found in Table 7, and they consist of the following cases:  
1. Increasing consumption (A): Anomalies include consumption predictions that are 15% above the consumption recorded on the same day, for example when more people are visiting the household because of a celebration or party.
2. Decreasing consumption (B): Anomalies include consumption that decreases up to 85% below the original value, for instance people who are not at home and on a vacation.
3. Anomalies generated by electrical noise (C): Another type of anomaly is included, which is generated by introducing a signal of electrical noise, in this case white noise. Examples include problems with an appliance or shortcuts.  
\begin{table}
\begin{tabular}{l c c c c} \hline \hline
**Regressor** & **Hyperparameter** & **Set of Values** & **Metrics** & \
\begin{tabular}{c} **Number** \\ **of Lags** \\ \end{tabular} &
\begin{tabular}{c} **Window** \\ **Size** \\ \end{tabular} \\ \hline Ridge & alpha & 0.01, 0.1, 0.5, 1.5 & & & \\ Lasso & alpha & 0.01, 0.1, 0.5, 1.5 & & \\ AdaBoost & n\_estimators & 5, 100, 200, 500, 700 & MSE, & 1, & \\ Regressor & n\_estimators & 20, 50, 100, 200, 300 & MAE, & 4, & 60 \\ XGB Regressor & n\_estimators & 5, 10, 20, 50, 100, 200, 500 & MAPE & 25 & \\ \hline \hline \end{tabular}
\end{table}
Table 6: Summary of the hyperparameters for the predictive regressors. Source: own elaboration.  
Figure 3: Partial autocorrelation plot of the electricity consumption variable _kWh_ in a domestic electricity consumption time series. Source: own elaboration.  
Each of the categories included in Table 7 simulates real-life anomalies in the context of household electricity consumption. Category A refers to increases (factor \(f\) upwards) in electricity consumption caused by the inhabitants staying home longer due to the absence of school or work responsibilities, as well as potential visits. These events occur on holidays or weekends and, therefore, are very frequent. Category B focuses on the assumption that, during winter and summer seasons, electricity consumption remains consistently high and similar; the anomaly involves generating decreases (factor \(f\) downwards) in electricity consumption. This also symbolizes an absence or a noticeable lack of activity within the household, for instance during vacations. This category occurs with lower frequency than the events in category A. Category C simulates a white or Gaussian noise signal, representing a type of electrical noise that these kinds of electrical signals commonly encounter [57].  
Regarding white noise, it is important to mention the adaptations made. The values of the white noise signal were subjected to the absolute value to avoid negative electricity consumption when modifying the forecast value. Additionally, the signal values were limited to a minimum and maximum of 0.78 and 1.18, respectively. These values are slightly lower and higher than the limits of categories A and B. By limiting these values, we ensure obtaining modified consumptions that remain within the possible electricity consumption range for domestic use.