Impacts of traffic data on short-term residential load forecasting before and during the COVID-19 pandemic

Accurate load forecasting is essential for power-sector planning and management. This applies during normal situations as well as phase changes such as the Coronavirus (COVID-19) pandemic due to variations in electricity consumption that made it difficult for system operators to forecast load accurately. So far, few studies have used traffic data to improve load prediction accuracy. This paper aims to investigate the influence of traffic data in combination with other commonly used features (historical load, weather, and time) – to better predict short-term residential electricity consumption. Based on data from two selected distribution grid areas in Switzerland and random forest as a forecasting technique, the findings suggest that the impact of traffic data on load forecasts is much smaller than the impact of time variables. However, traffic data could improve load forecasting where information on historical load is not available. Another benefit of using traffic data is that it might explain the phenomenon of interest better than historical electricity demand. Some of our findings vary greatly between the two datasets, indicating the importance of studies based on larger numbers of datasets, features, and forecasting approaches.


Background and progress of the load forecasting study
Electricity load forecasting plays an essential role in the power sector's operational planning and load management. With high accuracy of load forecasting, electric utilities/system operators can utilize power resources more efficiently with optimal cost [1,2]. Load forecasting can be classified, based on time horizon, into four different groups: very short-term (minute to hour ahead), short-term (hour to week ahead), medium-term (week to year ahead), and long-term (more than one year ahead). The short-term forecast is more relevant to daily power system operation, while the medium-and long-term horizons are necessary for system maintenance, fuel purchase planning, and power plant construction [2].
Aggregated load forecasting has been intensively studied at different scales, such as residential [3,4] and commercial [3,5]. Moreover, load forecasting can be performed at disaggregated (appliance or individual) level to support grid operator's planning when distributed generation increases [6,7].
We reviewed 36 papers, which were selected based on (i) specific keywords, such as load forecasting, electricity demand forecasting, electricity, modeling, feature selection, transportation, and traffic, and (ii) the publication year (around the past decade and during COVID-19 pandemic). The main aim of this review was to identify the most frequently used features and prediction methods for load forecasting. We realized that features used for electricity demand prediction could be categorized into four groupshistorical load, weather, time, and others as shown in Fig. 1 (both with and without lag variables). Historical load and temperature are the top two most frequently used features. In addition, the previous works usually combine several features together in different combinations. For instance, Buitrago and Asfour (2017) [1] used weather, time and historical load data to forecast short-term electricity demand, while Rahman et al. (2018) [3] adopted only weather and time to predict electricity consumption for commercial and residential buildings. Other feature combinations for load forecasting were summarized in an Appendix A. Moreover, some of the papers included indirect indicators of energy use. For instance, Aman et al. [8] adopted building-specific parameters, such as gross area, year of construction, and the academic calendar, to predict electricity demand in a campus micro-grid. It was found that these parameters could help increase prediction accuracy. Some of the social variables, such as Gross Domestic Product (GDP), industrial production index, and population, were also included in the forecasting model [4]. Cordova et al. (2019) [9] introduced the concept of "co-mobility," which relates people's mobility/movement and the commodities demanded (electricity in this context) to the load forecasting study. They tested different feature combinations of historical load, weather, and traffic count. It was found that using traffic count, as a feature, results in better forecasting accuracy of electricity demand.
Regarding the forecasting method, Hammad et al. (2020) [2] categorized the most frequently used time-series forecasting for electricity consumption into three groupsstatistical, machine learning (ML), and hybrid models.
Statistical methods include those related to autoregressive and parametric models (i.e. [10]). ML methods primarily focus on supervised ML methods, such as neural network-based (i.e. [3,11]), tree-based (i.e. [8,12]), support vector machine (SVM) (i.e. [4,13]). Finally, hybrid models are generally developed by combining the advantages of different forecasting approaches [2]. Fig. 2 summarized forecasting models used in 36 studies. It was found that neural-based, tree-based and SVM/SVR-based methods are the top three prediction model categories in load forecasting studies.

Studies on load forecasting during COVID-19 pandemic
The COVID-19 pandemic has significantly affected not only the health sector but also other fields, such as the economic, social, political, and environmental sectors [14]. Electricity supply is also one of the sectors impacted by this pandemic. This is because the strict social distancing restrictions were enforced, and people had to stay indoors during lockdowns. Recently published articles [14][15][16] focused on analysis to understand how COVID-19 affects electricity demand and generation. They found that overall electricity demand declined during the pandemic. The demand pattern shifted on some individual days (for example, the traditional morning peak moved toward noon). By contrast, residential electricity demand increased [17][18][19] especially for cooking, heating, cooling, and home entertainment due to the work-from-home regulations [18]. Moreover, the change of power demand profile during the lockdown could also lead to the changes in the power generation mix by increasing the amount of renewable energy generation and reducing greenhouse gas (GHG) emissions as discussed in the Spanish case study [16]. The reduction of GHG emissions was also confirmed by Abu-Rayash and Dincer [14] that due to COVID-19, the emissions from the power sector could decrease around 40,000 tons of carbon dioxide equivalent (CO 2 -eq), mainly from restricted international travel and transportation limitation.
The change of magnitude and pattern of electricity consumption during COVID-19 has posed challenges to system operators to accurately forecast load [20,21].   [20] mentioned that based on the published day-ahead load forecasting errors for Germany and California Independent System Operator (CAISO), there was crucial over-forecasting in April 2020 (during COVID-19), compared to the forecasts in April 2019 (before COVID-19). Since there were no similar events like this pandemic before, the current utilization of features in the load forecasting model, such as historical load, weather, and time, might be unable to capture phase changes due to lockdown restrictions. As mentioned by   [20], it is still necessary to have new quantitative features, such as those related to social and economic activities, in the load forecasting model to improve the accuracy.
Therefore, Chen et al. (2020) [20] and Wang and Wang (2021) [21] conducted a load forecasting study using mobility data, as a measure of economic activities, to improve load forecasting accuracy. The example of mobility data includes transit and shopping trends [20], as well as percentage change in visitors to workplaces and time spent in residential areas [21]. These parameters would help the grid operators/researchers understand people's behaviors when lockdown regulations were implemented, which would affect the magnitude and pattern of electricity consumption. As expected, it was found that mobility data could help improve the prediction accuracy of electricity demand when compared to conventional load forecasting models. For instance, the forecasting method with mobility data, which was proposed by   [20] could outperform the standard load forecasting model by around four percent.
Additionally, Wang and Wang (2021) [21] included the number of COVID-19 cases as a feature, although it transpired that this was not helpful in predicting demand. Additionally, although they confirmed that mobility data could help improve load forecasting accuracy during the pandemic, they also tested the load forecasting model using pre-stay-at-home weekend data as additional training dataset to simulate lockdown situations during COVID-19 (but without the use of mobility data). It was shown that only pre-stay-at-home weekend load data could also lead to the improvement of load forecasting accuracy. However, it was argued by   [20] that using only pre-stay-at-home weekend load data would not be good enough to mitigate the impacts of this pandemic on load forecasting accuracy. Thus, they proposed the use of mobility data as additional feature. It is also important to highlight that these mobility data studies during COVID-19 did not include time variables in their analysis, unlike the literatures of load forecasting before COVID-19 pandemic, as discussed in Section 1.1.

Research gaps and contributions
As mentioned earlier, very few papers have studied ways to improve load forecasting during phase changes such as the COVID-19 pandemic. Furthermore, although integrating traffic or mobility data can improve accuracy, different combinations of traffic data and other features are rarely tested for load prediction [21]. Significantly, these previous studies did not assess to what extent this prediction accuracy held if time variables were included in the forecasting models (as summarized in Fig. 3).
Our analysis aims to (i) investigate whether traffic data can improve short-term residential load forecasting accuracy during phase changes such as COVID-19 and (ii) test different combinations of feature sets, including time variables (historical load, weather, time, and traffic). In turn, we hope to understand better how the information contained in traffic data is included inor complementary toother prediction features.
While this paper focuses on short-term aggregated residential load forecasting in Switzerland, the methodology framework could also contribute to broader impacts in other grid areas or countries. For example, this would help system operators accurately forecast electricity demand when phase changes occur or when historical load is not available, such as when predicting the electricity demand of competitors in a liberalized market.

Data
To forecast the target variable (aggregate, residential electricity load), we used the following four groups of features (independent variables) -(1) historical residential electricity load, (2) weather-related, (3) time-related, and (4) traffic (road traffic and train traffic) timeseries. All the time series were aggregated into an hourly resolution from 2016 to 2020. To validate the robustness of model results, we repeated our analyses for two grid areas in Switzerland (Area 1: Aarau and Area 2: Ticino). 1 A summary of the data sources and time series used is provided in Table 1.

Data pre-processing and modeling
The main steps of our research are shown in Fig. 4. During the first step, the target variable and independent variables during 2016-2020 were collected as discussed in Table 1.
In the second step, we pre-processed the data. Some of the individual featuresmainly weather and individual road traffic data that contained many missing valueswere dropped from the feature list. Then, weather and time data were pre-screened to remove variables strongly correlated with each other. This is similar to the approach used by Refs. [5,[23][24][25][26]. As Pallonetto et al. (2022) [26] discussed, we calculated the Spearman correlation coefficient for each pair of variables within each of the four groups of variables from Table 1 (weather, time, traffic, train). For each pair of variables with a correlation coefficient of 0.7 (i.e., the average value of the range between 0.61 and 0.8 suggested by Refs. [27,28]), we then dropped one variable. The remaining feature set after the pre-screening consists of the 10 features for DSO1 (historical load, solar radiation in Buchs, precipitation in Buchs, number of days since 2016, hour of day, week of day, week of day (cosine), month of year, total road traffic, and total train station visitors), and 11 features for DSO2 (historical load, solar radiation in Monte Generoso, precipitation in Monte Generoso, temperature 2 m above ground in Monte Generoso, number of days since 2016, hour of day, week of day, week of day (cosine), month of year, total road traffic, and total train station visitors). The selected features in both areas were almost identical, except for one variable (temperature 2 m above ground) selected in the DSO2 area but not in the DSO1 area.
These pre-screened features were then standardized and used as inputs to forecast short-term residential electricity demand during four different phases, as illustrated in Fig. 4. In this study, five different time horizons -one-, two-, four-, 6-h, and one-day-aheadwere tested, as shown in Table 2. Initially, we tested to what extent traffic data may have a delayed effect on load. For this purpose, we used all features at time t to forecast the target variable (residential load) at time t + n (n = 1,2,4,6). In addition to that, we estimated to what extent a perfect forecast of weather and traffic data could help improve day-ahead load forecasts. For this purpose, we estimated a model including historical load at time t, while the remaining features (weather, time, and traffic) were included for the times t, t+6, t+12, t+18, and t+24.
Each of the five forecast horizons from Table 2 was tested with each of the eight feature sets described in the rows in Table 3. For example, the "Base" feature set (with historical load) contained both the historical load and the weather data, which were primarily used in the literature to forecast electricity demand (such as [25,[29][30][31]). Moreover, the reason for including a version of the same feature sets without historical load (in the last four rows in Table 3) was to validate to what extent the information from the other time series was included captured by the historical load.
During the third step of Fig. 4, the model was trained using pre-COVID-19 data for each feature set. To determine the impact of each individual feature, the features were added iteratively during the calibration process (stepwise addition) in order of increasing importance. During the first iteration, the model was calibrated with one feature. The importance of each feature was measured by root mean square error (RMSE) as shown in Eq. (1): where Y i is the load observation at time t+1 or 2,4,6,24, Ŷ i is the predicted value of load, n is the number of observations. At the end of the first iteration, the feature, which achieved the lowest RMSE during the four phases (pre-COVID-19, lockdown, post-lockdown, and strict regulation), was retained for inclusion in the subsequent iterations. In the second iteration, we calibrated the model with two features. In addition to the feature retained at the end of the first iteration, we calibrated the model using each of the remaining features in the feature set and retained the second feature, which achieved the lowest RMSE for the subsequent iterations. This process was repeated until all features from the feature set were added to the model. Finally, during the fourth step of Fig. 4, the model performance (RMSE) of each iteration of the stepwise addition was reported by calibrating the data using pre-COVID-19 and calculating RMSE based on training dataset (pre-COVID-19) as well as test datasets from three different phases (lockdown, post-lockdown, and strict regulation).
Focusing on the forecasting technique, random forest was used to calibrate the load prediction model in this analysis. Breiman (2001) [32] proposed a random forest to overcome the limitations of simple decision trees. Then, non-leaf nodes are selected to split until the stop condition is met. The bottom node of the tree is called a leaf node [33]. Random forest was adopted to increase the computational complexity, as discussed in Ref. [33], to solve the poor generalization problem of decision tree methods. It is a combination of multiple decision trees and is a bagging algorithm, as discussed in Refs. [32,34]. This ensemble method combines the results from multiple and parallel training of machine learning algorithms to give more accurate outcomes and reduce variance in a noisy dataset.
As illustrated in Fig. 2, the tree-based method is one of the most widely adopted methods in load forecasting literature as in Refs. [6,8,12,23,33,[35][36][37][38]. This is because, according to Refs. [12,34], when compared to other popular methods, a tree-based model is easy to explain and interpret, robust to outliers, has fast computation times, and can be used in both classification and regression problems.
In this study, random forest was trained using scikit-learn, a free  machine learning software library for Python language. In the software, a set of hyperparameters was needed for a random forest modeling, which we adopted the default values from the programming as summarized below.
• Number of trees in the forest (100).
• Maximum depth of the tree (None: the nodes continue to expand until all leaves contain less than the minimum number of samples required to split an internal node). • Minimum number of samples required to split an internal node (2).  • Minimum number of samples required at a leaf node (1).
• Number of features to consider for the best split (auto, all features).
For each regression tree, the best splitting point for each predictor should represent the point where the lowest sum of square error occurs. To avoid overfitting, bagging (bootstrap aggregation), as discussed in Refs. [33,34], was also adopted in the modeling.  Table 3 Different feature sets tested in this analysis. data, we can see that each phase has different magnitudes. However, daily patterns of each variable during each phase show almost no change except the patterns of the total number of train passengers during the post-lockdown and strict regulation phases. Focusing on the residential load for both DSOs, the different magnitudes of the four phases seem to be partly linked to the respective season. For example, the strict regulation phase (in winter) had the highest electricity demand, while postlockdown (in summer) had the lowest values. During lockdown (the transition period of winter and summer), DSO1 had a lower demand than average pre-COVID-19, while DSO2 had a higher demand than pre-COVID-19. Regarding traffic data, the total number of vehicles and passengers during COVID-19 decreased due to the introduction of stayat-home policies.

One-, two-, four-, and 6-h load forecasts
In this section, we describe the results of the one, two, four, and 6-hahead forecasts from Table 2 for each of the feature sets in Table 3. The model was trained using pre-COVID-19 data and tested using the training dataset (pre-COVID-19) as well as test datasets from three different phases (lockdown, post-lockdown, and strict regulation). In general, we expected the model to perform best (i.e., have the lowest RMSE) during the pre-COVID-19 phase, as this was the training data, while the performance would decrease during the test datasets (lockdown, post-lockdown, and strict regulation). Comparing the different feature sets, we expected that model performance during the test periods would be best (i.e., have the lowest RMSE) if we included the traffic data as an additional feature. This is because we assumed that traffic data could reflect the actual level of electricity consumption because people were less likely to use public transportation.
Based on Table 4 2 our first assumption regarding the RMSE of pre-COVID-19 was correct, as the RMSE during the training period (pre-COVID-19) was significantly lower than during the testing periods. For the hour-ahead forecasts, our assumption regarding the benefits of transport data during the test periods (lockdown, post-lockdown, and strict regulation) was not confirmed for DSO1 or DSO2. When we compared the "Base" and "Traffic" feature sets, the RMSE of the "Traffic" feature set was lower than for the "Base" feature set (averaging around 12% across DSOs, feature sets, and during COVID-19 phases), meaning that the inclusion of traffic data in addition to weather data improved prediction accuracy. However, when we compared the feature sets that contain time variables (such as the hour of the day, etc.) -which were extracted directly from the timestamp without further data collectionthe RMSEs of "Time" and "All" feature sets were almost the same level and significantly lower than for the "Base" and "Traffic" feature sets. For datasets including historical load, weather, and time data, the inclusion of traffic data did not improve prediction accuracy in such a setting. These findings suggest that adding time variables give a far better result than adding traffic variables. However, the main benefit of traffic data seems to be that it can explain the phenomenon of interest (behavior of individuals in relation to electricity demand) better than historical load.
However, for the two-, four-and 6-h-ahead forecasts in the postlockdown and strict regulation phases, the value of adding traffic data, together with time, historical load, and weather variables, was evident as the RMSE was slightly lower when comparing "Time" and "All" feature sets (highlighted in bold in Table 4). The reason that these small changes occurred in the post-lockdown and strict regulation phases might arise from the visible changes in traffic patterns (mainly the number of train passengers) during those two phases, as discussed in Section 3.1 and shown in Fig. 5. As a result, traffic data could bring additional positive, albeit minor benefits, to load forecasting accuracy. This was, however, not the case for the 1-h forecast, suggesting the possibility of a delayed impact for traffic data.
In summary, for the one-, two-, four-and 6-h-ahead forecasts of both DSOs, traffic data (rather than weather data) might improve load prediction accuracy. However, when adding time and traffic variables together, the RMSE of all phases is barely different from when using only time variables alone.

Day-ahead load forecast
This section describes the results of the day-ahead load forecasting horizon in Table 2 for each of the feature sets in Table 3. The motivation for including the actual t+6, t+12, t+18, and t+24 h values as features for the day-ahead load forecast was to test how a perfect weather and traffic data forecast could help improve forecast accuracy. The model performance of the four phases (the RMSE) of DSO1 and DSO2 are summarized in Table 5. Moreover, our assumption from the previous modeling results of the one-, two-, four-, and 6-h-ahead forecasts was that historical electricity demand might already contain most of the information included in the traffic data. To test our hypothesis that historical load includes information from traffic data, the cases with and without historical load as an independent variable were examined.
Focusing on the with historical load case for the DSO1 area (Table 5a), the RMSE of pre-COVID-19 phases was lower (around 0.1) than during COVID-19 phases (at about 0.3-0.4). When comparing different feature sets, the RMSE of the "Traffic" feature set was lower than the "Base" feature set, which averaged six percent during the COVID-19 phases. This confirms our finding from Section 3.2 that including traffic data on top of historical load and weather data could improve prediction accuracy.
Additionally, the inclusion of "Time" variables or "All" variables led to an average 20% lower RMSE during COVID-19 phases compared with the "Base" feature set. In addition, the RMSE of the feature set with "All" variables was not different from that of the "Time" feature set. In most cases, adding new features to the model leads to a lower RMSE. However, when the model is overwhelmed by too many unnecessary features, such as time variables (i.e., number of days since 2016 in the lockdown phase), the RMSE starts to become constant or even increase.
Focusing on the without historical load case for the DSO1 area, the pre-COVID-19 phase still had a lower RMSE than the other three COVID-19 phases. However, without the historical load, the RMSE for all four phases was higher than in the with historical load case, highlighting the importance of historical load as a feature for load forecasting. The RMSE of the pre-COVID-19 phase ranged from around 0.05-0.2, while during COVID-19 phases, it was between around 0.3 and 0.6.
Comparing the RMSE of the "Base" and "Traffic" feature set for the without historical load case, we noted that the inclusion of traffic data in addition to weather data decreased the RMSE during COVID-19 periods by 11%, on average. Moreover, the impact of traffic data when including time variables for the day-ahead forecast was more evident than the with historical load case (Table 5a in bold). This may also confirm our hypothesis that historical load could already contain some of the information from the traffic data. As a result, in the with historical load case, traffic did not display a positive effect on prediction accuracy (unlike when historical load data were removed from a list of features). Although the RMSE is higher if historical load is excluded, this might be beneficial, for example, for predicting a neighboring grid area load when historical load data is essential for load prediction [39]. However, this may not be available in real-time. Another advantage of using traffic data instead ofor to complementhistorical load data is that it may explain the phenomenon of interest better than historical electricity demand, thereby providing further insights from our findings.
Regarding Table 5b (the with historical load case for the DSO2 area), like DSO1, the pre-COVID-19 phase had a lower RMSE (around 0.1) compared to the during COVID-19 phases (at about 0.2-0.3). The main difference is that for DSO2, the prediction accuracy (the RMSE) of each phase across different datasets was at almost the same level. In other words, it can be inferred that none of the additional features (time and traffic data) significantly increases prediction accuracy.
According to the without historical load case for the DSO2 area (as with DSO1), the pre-COVID-19 phase still had a lower RMSE than the during-COVID-19 phases. In addition, when excluding the historical load data, traffic showed more positive effects on load prediction accuracy. Moreover, in general, traffic data alone cannot lower the RMSE as much as the combination of all features (Table 5b in bold), meaning that traffic data are still useful in terms of increasing prediction accuracy but need to be used as a feature together with other relevant variables.
Regarding the strict regulation phase for the DSO2 area, it was interesting to note that traffic data improved prediction accuracy the most, leading to a lower RMSE than with any other feature set (Table 5b in red; for both with and without historical load). The difference between the results for the two DSO areas highlights the uncertainty of our findings and the danger of determining the impact of new features based on a single dataset. To obtain a more robust picture regarding the effects of traffic data and other independent variables on forecast accuracy, studies using larger numbers of different datasets, features, and forecasting techniques are needed.
In addition, to test whether the effects of transportation data on load forecasting accuracy may only be detected during the short transition period (lockdown), the data from March 14th-18th, 2020 (the transition period -before and after the government declared a State of Extraordinary Situation in Switzerland) was selected to model this assumption based on hour-ahead prediction. Unfortunately, even using this shorter data period, the result implications were not different. Traffic data alone could not improve load forecasting accuracy more than the inclusion of traffic data and other variables.
Our findings are well aligned with the previous literature before and during COVID-19 [9,20,21], which concluded that mobility data (or traffic data in this context) can improve electricity load forecasting. However, these previous studies used traffic data with other variables, such as weather and the number of COVID-19 cases data but did not include time variables in their studies. Accordingly, this study contributes the new finding that only time variables can improve the accuracy of short-term load prediction compared to traffic-data-only cases. However, the results show the greatest accuracy when including both time and traffic data.
Although this case study focused on Switzerland context, the methodology framework of this analysis could also contribute to broader impacts, such as other areas/countries or specific situations. For instance, when predicting the electricity demand of competitors in a liberalized market and historical load is not available, this framework could help system operators to accurately forecast electricity demand using traffic, weather, and time features. Moreover, this framework could be extended to analyze load forecasting in some specific areas/ contexts, such as islanded microgrids under limited communication, where it might have a burden of data accessibility as mentioned in Ref. [40], or those related to delay-tolerant predictive power compensation control for photovoltaic voltage regulation [41]. However, it is important to note that our proposed method would require near real-time traffic information, which may not be available in some of these settings.

Table 4
The lowest RMSE (for one-, two-, four-, and 6-h-ahead) of each feature set during each phase.  Table 5 The lowest RMSE (for day-ahead) of each feature set during each phase.

Conclusions
This work investigates the effects of traffic data on short-term electricity load prediction before and during the COVID-19 pandemic through different combinations of feature sets (historical load, weather, time, and traffic data). To detect the impacts of traffic data during the COVID-19 pandemic, random forest models were trained using pre-COVID-19 data and tested using a training dataset (pre-COVID-19) and test datasets from three different phases during COVID-19.
The results from this study show that traffic dataas well as weather and historical load dataimproved prediction accuracy both before and during COVID-19. However, time variables have a much more significant impact on prediction accuracy than traffic data. Adding traffic data to time, weather, and historical load data can only improve forecasting accuracy to a small degree. However, traffic data still improves load prediction when historical load information is not available.
The inclusion of traffic data as a feature could be justified for two main reasons: First, improving prediction accuracy in situations where historical load data is unavailable in real-time (such as for neighboring grid area predictions), and second, deriving further insights regarding the phenomenon of interest (the behavior of individuals in relation to electricity demand).
Finally, our analysis using two datasets shows that the impact of new features on forecast accuracy can vary enormously between different datasets. To obtain a more robust picture of the effect of different features and modeling approaches on forecast accuracy, studies using larger numbers of datasets, features, and forecasting approaches would be required.

Declaration of competing interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.