Skip to Content
EnergiesEnergies
  • Feature Paper
  • Article
  • Open Access

14 July 2026

22 Pages

Enhanced Estimation of PV Power Production and Consumption with Multi-Step Prediction in Smart Energy Grids †

,
,
and
1
Department of Mathematics and Computer Science, Karlstad University, Universitetsgatan 2, 65188 Karlstad, Sweden
2
Department of Engineering and Physics, Karlstad University, 65188 Karlstad, Sweden
3
Department of Computer Science, Deggendorf Institute of Technology, 94469 Deggendorf, Germany
*
Author to whom correspondence should be addressed.

Abstract

Accurate forecasting of power production and consumption is essential for the efficient operation of smart energy grids, enabling stable energy exchange and grid reliability. However, the growing integration of photovoltaics (PVs) and electric vehicles introduces significant uncertainty. This paper evaluates multiple Machine Learning (ML) models for single- and multi-step forecasts of PV generation and household consumption, incorporating uncertainty bounds to inform operator decisions. We use data from two Swedish sites and the CityLearn benchmark dataset to compare direct, recursive, and hybrid multi-step strategies. LightGBM with gradient-boosted quantile regression achieves the best single-step performance, with Mean Absolute Error (MAE) as low as 10.19 W in Halmstad and 16.12 W in Uppsala. For multi-step forecasts, the direct method outperforms others, reaching a 48 h consumption MAE of 71.08 W in Uppsala and 52.05 W in Halmstad, and achieving prediction interval coverage probabilities above 0.95. Moreover, personalized models trained on individual households outperform generalized ones, even with smaller datasets, highlighting the value of tailored approaches for improving forecast accuracy under uncertainty.

1. Introduction

Cyber Physical Power Systems (CPPSs) is the response to the increased electrification of several sectors, the integration of renewable energy resources and storage systems, and the need to achieve safe, secure, and sustainable energy systems [1]. A CPPS could be defined as an electrical system that integrates two-way cyber-secure intelligent communication along the whole power system value chain, aiming to facilitate real-time efficient operability. The real-time operations rely on a communication network, including the associated sensors and devices, that is necessary for cost reduction and to secure the supply of electricity to a diverse spectrum of industries, commercial actors, and households [2]. For decision-making purposes, especially in real-time, CPPS makes use of comprehensive data collections, including their handling and analytics. However, acquiring representative data is technically challenging and costly because of installations’ and infrastructure’s capital costs, as well as maintenance, processing and support costs [3,4]. Therefore, the volume of data has an essential financial and operational impact on CPPS. As such, it is of major importance to explore opportunities for a viable trade-off between the necessary infrastructure development and data-series exchange volumes.
Day(s)-ahead forecasting of power production and consumption is important for system optimization [5]. Machine Learning (ML)-based power production and consumption forecasting has been used over the last two decades, and such models often perform well [6,7]. Models such as Artificial Neural Network (ANN), Support Vector Machine (SVM), decision trees, and random forests, to name a few, used to be among the popular choices [8]. Furthermore, models based on Deep Learning (DL) are also well-regarded options [9]. There are two main “location-wise” practices for energy forecasting. On the one hand, local ML-based models for each end-prosumer are usually deployed by using edge devices, analytics, and computations [10,11,12]. However, the rise in digitization has led to increased fine-grained time-series data from smart meters that could be used for advanced ML models on the grid system level using cloud computations [13]. Nevertheless, the volume and complexity of the data significantly affect the performance of a model. Having said the above, data exchanges, analytics, and computations should be limited to avoid unnecessary infrastructure and operational costs while preserving users’ privacy and security, of course [3,14]. As such, an assessment of the related accuracies from ML-based models may show the importance of having individual or aggregated forecasting.
From a time-step forecasting perspective, the forecasting can be either single-step or multi-step. Single-step forecasting refers to the computation of one step ahead in the forecasting horizon, while multi-step refers to several steps ahead in the forecasting horizon [15]. Multi-step forecasting, on the one hand, may enhance decision-making operations, while on the other hand, it suffers from increased uncertainty bounds due to accumulating errors as the forecasting horizon increases [16]. Hence, it is essential to investigate multi-step forecasting in comparison to single-step forecasting approaches to explore the benefits in each case.
This paper aims to investigate the deployment of ML-based power production and consumption forecasting models with regard to (1) the impact of time-series dataset size on the accuracy of different ML-based forecasting models, (2) the applicability of local and aggregated models to forecasting accuracy across different sites, and (3) the implementation of multi-step forecasting techniques and their predictive performance.
Specifically, the contributions of this paper are as follows:
  • Model performance improves with increasing training dataset size, particularly up to around 4000 samples. Beyond this point, further gains diminish, suggesting that very large datasets may not be necessary and that computational demands and infrastructure requirements can be reduced.
  • Personalized models trained on individual households consistently outperform those trained on aggregated data, even when the latter use larger training sets. This highlights the value of localized patterns and supports the use of edge or federated learning over centralized training.
  • The LightGBM Gradient Boosting Quantile Regression (GBQR) model achieves the best single-step performance, with Mean Absolute Error (MAE) values as low as 10.19 W in Halmstad and 16.12 W in Uppsala, while remaining robust across weather variations.
  • For 48 h forecasts, the direct strategy, which trains a dedicated model for each forecast step and is applied to different Swedish sites and the CityLearn benchmark, outperforms both the recursive and hybrid methods in terms of accuracy and uncertainty reliability.
This paper substantially extends our prior conference publication [12] in four ways. First, we add a second real-world site (Halmstad) alongside Uppsala, enabling a comparative analysis of model performance across locations with differing solar generation patterns and autocorrelation structures. Second, we introduce and evaluate three multi-step forecasting strategies (direct, recursive, and direct-recursive hybrid) adapted specifically for Quantile Regression (QR) to produce calibrated uncertainty bounds over 48 h horizons; the conference paper considered single-step forecasting only. Third, we include the CityLearn 2022 benchmark dataset as an independent validation set, supporting reproducibility and generalizability testing beyond the Swedish prosumer data. Fourth, we conduct a systematic analysis of training set size effects and individual versus aggregated model performance, providing practical guidance on data requirements and deployment strategies for smart grid operators. Together, these extensions move the scope from a proof-of-concept single-site, single-step evaluation to a comprehensive multi-site, multi-horizon benchmarking study with uncertainty quantification.
The rest of the paper is structured as follows. Section 2 presents the background and related work. Section 3 details our dataset and Section 4 explains the methodology. Section 5 evaluates the presented approaches, and Section 6 concludes the paper.

3. Dataset

We use measurements from seven different households in Uppsala and five households in Halmstad, Sweden, over a period of 14 months at an hourly resolution for training and evaluation. Our dataset D = ( X ¯ , y ) consists of a N × k feature matrix X ¯ = [ x 1 , … , x N ] with feature vectors x i = ( x i , 1 , … , x i , k ) T , where k represents the number of features and N the frequency. D consists of the household measurements and additional weather features retrieved from the Swedish Meteorological and Hydrological Institute (SMHI) (see Table 2) at an hourly resolution to enrich the ML model in order to improve the accuracy of the PV production and consumption predictions [19]. The input features ( X ¯ ) for the ML models are normalized. y = ( y 1 , … , y N ) is the outcome that indicates either the production ( P P r o d u c e d ) or consumption ( P C o n s u m e d ) of the household. The consumption is calculated as follows:
P C o n s u m e d = P I m p o r t + P P r o d u c e d − P E x p o r t
where P I m p o r t represents the bought power from the main energy grid, P P r o d u c e d is the produced power by the installed PV system and P E x p o r t is the sold power to the main grid. At a specific instant of time, either the bought power from the main energy grid, P I m p o r t , or the sold power to the main grid, P E x p o r t , is zero. Figure 1 illustrates the histograms and Kernel Density Estimations (KDE) [30] of the produced and consumed power, respectively. The histograms of the KDE were generated on the hourly aggregated data of all prosumers. Figure 1a presents the histogram of the produced power with and without the nighttime. For the training and evaluation later on, we deleted the nighttime data for the production since PV cells do not produce electricity. Figure 1b illustrates the consumption of all prosumers. P C o n s u m e d can also fall into the negative range in the observed dataset, for example, when the household does not produce or buy energy and only sells stored energy to the main grid from its battery.
Table 2. Prosumer and Weather Features.
Figure 1. Histograms of the power production (a) and consumption (b) with fitted KDEs for both cases.
In addition to the Swedish household data, we also use the CityLearn Challenge dataset as a standardized benchmark for building-level energy forecasting. The CityLearn dataset originates from the CityLearn 2022 Challenge and includes electricity demand, PV production, and storage behavior for a collection of residential and commercial buildings located in California, USA. The data is generated using EnergyPlus simulations and provides hourly measurements of energy consumption and production alongside environmental features such as temperature and solar irradiance. The dataset is publicly available online (https://github.com/intelligent-environments-lab/CityLearn/tree/master/data/datasets/citylearn_challenge_2022_phase_all (accessed on 1 May 2026).

4. Methodology

The prediction of household consumption and production in a smart energy grid can be formulated as a multi-output regression problem using the dataset presented in Section 3. The ML models in this work estimate three output values for the next time step: lower uncertainty bound y ^ l , upper uncertainty bound y ^ u , and the median value y ^ m . These outputs represent the expected quantile values around the median prediction, with q m = 0.5 for the median quantile, q l = 0.5 − q 2 for the lower quantile, and q u = 0.5 + q 2 for the upper quantile, where q ∈ ( 0 , 1 ) represents the interval. Consequently, our ML models take X ¯ as input and produce the outputs ( y ^ l , y ^ m , y ^ u ) according to the specified interval (e.g., one hour ahead), for both production and consumption.
First, we summarize our evaluation metrics and then present the prediction models we trained. Our models either estimate the triple ( y ^ l , y ^ m , y ^ u ) directly or derive it from estimating the normal distribution. The Prediction Interval (PI) is defined as [ y ^ l , y ^ u ] .

4.1. Evaluation Metrics

In this work, we evaluate the ML model prediction performance using MAE and R2 as error metrics, calculated based on the predicted y ^ m and the actual (measured) value y. In addition, we report the Symmetric Mean Absolute Percentage Error (sMAPE) as a scale-independent accuracy metric, used here in place of standard MAPE for reasons explained below. Standard MAPE is ill-defined for this dataset because household consumption values include negative entries (when households sell stored battery energy back to the grid) and near-zero values, both of which cause MAPE to diverge. sMAPE avoids this by normalizing by the average of the absolute actual and predicted values:
sMAPE = 1 N ∑ i = 1 N | y i − y ^ i m | ( | y i | + | y ^ i m | ) / 2 × 100 %
sMAPE is bounded and well-defined even when y i ≤ 0 , making it appropriate for consumption forecasting with prosumer data. MAE remains the primary point accuracy metric throughout this work, as it operates directly in the physical unit (W) and is not affected by near-zero denominators. To quantify the quantiles q l , q m , and q u , we use the pinball quantile loss function:
L y , y ^ p ; p = max p y − y ^ p , ( 1 − p ) y ^ p − y
To calculate the average over the dataset, we compute Mean Quantile Loss (MQL) by incorporating the summed-up loss ( L Σ ) as
MQL Σ = 1 N ∑ i = 1 N L Σ y i , y ^ i
To further assess the distinction between y ^ l and y ^ u , we employ the MPIR, where a lower value indicates lower prediction uncertainty and thus better performance.
MPIR = 1 N ∑ i = 1 N ( y ^ i u − y ^ i l )
Moreover, the PICP measures how many y i of the samples fall into the PI. PICP is derived by
PICP = 1 n ∑ i = 1 n c i ,
where c i has only two values (0 and 1). If y i is within the PI of y ^ l and y ^ u , c i = 1; otherwise, c i = 0. The model is perfectly calibrated when PICP is equal to q. To measure the deviation from perfect calibration, CFE given by | q − q ^ | was used. The closer q ^ is to q, the lower the CFE.

4.2. Quantile Regression

QR involves training a model to estimate a specific quantile value using the quantile loss function defined in Equation (3). To estimate the outputs ( y ^ l , y ^ m , y ^ u ) , we train separate models for the lower, median, and upper quantiles. This allows the model to provide not only a point prediction through the median quantile, but also uncertainty bounds through the lower and upper quantiles. Any regressor that supports the quantile loss function during training can therefore be used within the QR framework.
In this work, we evaluate two gradient-boosted quantile regression approaches: LightGBM [25] and CatBoost [31]. As motivated in Section 2, these models are adopted for their scalable gradient-boosted learning combined with native support for quantile loss, directly aligned with the uncertainty-aware forecasting objective of this work. As baselines, we use Linear Quantile Regression (LQR) and Gaussian Process (GP), allowing the gradient-boosted models to be compared against both a simple linear quantile model and a probabilistic non-parametric model.

4.3. Multi-Quantile-Loss Function

Multi-Quantile-Loss Function (MQF) is a loss function used in QR to simultaneously estimate multiple quantiles of the input vector X. MQF is a generalization of the single quantile loss function used in standard QR. Let Y be the response variable, X be the predictor variable, and p 1 , p 2 , … , p k be the quantile levels of interest, where p i ∈ ( 0 , 1 ) and k is the number of quantiles to be estimated. The MQF is defined as
MQF = ∑ i = 1 n ∑ j = 1 k ρ p j ( y i − X i T β p j )
where n is the sample size, y i is the observed response variable for observation i, X i T is the transpose of the predictor variable matrix for observation i, β p j is the vector of coefficients for the p j -th quantile, and ρ p j ( u ) is the check function
ρ p j ( u ) = u ( p j − I ( u < 0 ) )
The MQF simultaneously estimates the p 1 -th, p 2 -th, and p k -th quantiles of the response variable. In other words, it allows us to estimate multiple quantiles with a single model, rather than training separate models for each quantile value. By training a single model that outputs the different quantiles at once, the model may exploit correlation in the data and lead to better predictions. MQF can be used with any regression model that can use the single quantile loss function during training, such as GBQR and Quantile Neural Network (QNN). In this work, we use the GBQR CatBoost mentioned in Section 4.2.

4.4. Multi-Step Forecasting Techniques

We developed three strategies for multi-step forecasting: direct, recursive, and direct–recursive hybrid approaches to forecast n time steps ahead. These techniques have been explored in previous works [18,32], but we adapt them specifically for QR to address uncertainty bounds in the forecasts, because it directly estimates the prediction interval and provides uncertainty information. Each strategy offers unique advantages and entails different complexities, which we discuss in the following sections.

4.4.1. Direct Approach

In direct multi-step forecasting, a distinct model is generated for each prediction step (as visualized in Figure 2a). For an n-step ahead forecast, the prediction model is described as follows:
y ^ t + q = f q ( x t , x t − 1 , … , x t − m + 1 ) , q = 1 , 2 , … , n .
Figure 2. Multi-step forecasting strategies.
Here, y ^ t + q is the predicted value at step q, and x t represents the historical data. Each model f q is trained independently using the historical dataset, ensuring that errors do not propagate through the forecast horizon. This method is computationally intensive due to the necessity of constructing n distinct models for the forecast steps. Additionally, to capture uncertainty bounds, two extra models for the upper and lower quantiles are generated for each step, resulting in 3 n models in total. While computationally demanding, this approach avoids error accumulation and provides precise prediction intervals.

4.4.2. Recursive Approach

The recursive approach leverages previously forecasted values as inputs for future predictions (as shown in Figure 2b). The prediction model for this method is represented as
y ^ t + q = f ( y ^ t + q − 1 , x t , … , x t − m + 1 ) , q = 1 , 2 , … , n .
In this formulation, the predicted value at each step y ^ t + q depends on the previous prediction y ^ t + q − 1 and the historical data. This method is computationally efficient as it requires training only one model, f, which is recursively applied. However, this approach may lead to error accumulation, as any prediction error propagates through subsequent steps. To incorporate QR, three models are trained for the median, upper, and lower quantiles, ensuring that uncertainty bounds are maintained throughout the forecast horizon.

4.4.3. Direct–Recursive Hybrid Approach

The direct–recursive hybrid approach combines elements of both the direct and recursive methods (as shown in Figure 2c). In this approach, an individual model is generated for each time step, like in the direct method, but predicted values are incorporated into the input set for the next step, like in the recursive method. The model is formulated as follows:
y ^ t + q 1 = f 1 ( x t , x t − 1 , … , x t − m + 1 ) , y ^ t + q 2 = f 2 ( y ^ t + q 1 , x t − 1 , … , x t − m + 2 ) , y ^ t + q 3 = f 3 ( y ^ t + q 2 , y ^ t + q 1 , x t − 1 , … , x t − m + 3 ) , q = 1 , 2 , … , n .
This hybrid method aims to balance the advantages of both approaches by using individual models per time step while also feeding predicted values into subsequent models. For QR, similar to the direct approach, three models are trained for each step to predict the median, upper, and lower quantiles, resulting in a total of 3 n models. This method effectively manages error propagation while providing flexibility and robust uncertainty bounds. By employing these strategies within the framework of QR, we ensure that our multi-step forecasts not only predict future values but also provide valuable insights into the uncertainty associated with these predictions.

5. Evaluation

In alignment with the presented contributions from Section 1, we are aiming to answer the following questions:
1.
How is forecasting performance affected by training size? (see Section 5.1)
2.
How do different training sets and model deployments impact accuracy? (see Section 5.2)
3.
What are the prediction quality and forecast uncertainty of different ML models for different sites? (see Section 5.5)
4.
What is the impact of different multi-step forecasting techniques on the prediction quality? (see Section 5.6)

5.1. Influence of Training Set Size

This experiment uses data from a single household in the Uppsala dataset to isolate the impact of training set size on model performance. The results focus on PV production forecasting to evaluate how different QR models respond to increasing amounts of local training data. Figure 3 presents the evaluation results for various quantile regressors with increasing training dataset sizes for a single-step forecasting horizon. It is clear that the error for all models is highest with a small dataset and decreases until the dataset size reaches approximately 500 samples. The GP model plateaus at this point, while the LightGBM and MQF models continue to decrease until reaching a training size of about 4000 samples. In contrast, the LQR model consistently exhibits a high summed MQL, regardless of the training dataset size.
Figure 3. Influence of the training set size on the production of one household in Uppsala.

5.2. Model Aggregation and Generalization

To assess how different training strategies affect forecasting accuracy, we focus on single-step forecasting with the GBQR-LightGBM model. We evaluate three model configurations based on different training data scopes:
  • Individual model: A dedicated model is trained using only the data from the target household.
  • Aggregated model: A single model is trained on data from all households and applied uniformly across them.
  • Leave-One-Out (LOO) model: A model is trained on data from all households except the test household. This setup reflects a transfer scenario in which a new household joins the grid without historical data.
Figure 4 presents the summed MQL across all households for each configuration. The variability in losses highlights the heterogeneity of household-level PV production, driven by differences in panel size, orientation, and local conditions. Households 1, 2, and 6 show consistently lower losses, while household 7 experiences the highest loss in all settings.
Figure 4. Boxplots of the summed quantile loss for the local-level individual model (blue), grid-level aggregated model (pink), and LOO model (turquoise) for the power production.
The individual model achieves the lowest MQL across all households, despite using the smallest training set. This suggests that localized temporal and environmental patterns are more beneficial for accuracy than generalizing across users. The aggregated model, though trained on a larger dataset, performs worse, likely due to the loss of household-specific features. The LOO approach yields the highest errors, particularly for households 3, 5, and 7, indicating limited generalizability when no local training data is available.
These findings underline the importance of model personalization in smart grid forecasting. While aggregated or LOO models offer scalability and ease of deployment, their performance may degrade significantly in heterogeneous conditions. Future work may explore federated or adaptive learning techniques to improve generalization without compromising individual accuracy.
While this evaluation is based on the Uppsala dataset, we hypothesize that similar findings would hold for Halmstad and CityLearn, particularly regarding the superior performance of localized models, though we acknowledge this remains to be validated empirically across all datasets. As shown later in Section 5.3, Halmstad exhibits stronger autocorrelation in PV production, which may further enhance the performance of household-specific models and improve grid-level generalization. In addition, it is expected that the grid-level model benefits from this autocorrelation, as stronger temporal patterns improve generalization. This is confirmed by the results presented in the following sections. Although not repeated here, future work could extend this comparison across all datasets to validate the robustness of these observations.

5.3. Auto-Correlation Evaluation

In the following sections, we are going to assess the model performance changes between Halmstad and Uppsala prosumers. To understand the variation in the model performance between these locations, we analyzed the autocorrelation of their PV power production data. Specifically, we will use prosumer 1 in the Uppsala grid and prosumer 4 in the Halmstad grid for the correlation evaluation. Figure 5 illustrates the autocorrelation coefficients for PV production at various lag levels for both locations. The heat-map reveals a higher correlation in the PV production data for Halmstad compared to Uppsala. It is visible that the autocorrelation coefficient for Halmstad is higher for all presented lags. This higher autocorrelation in Halmstad’s PV production data may be attributed to consistent weather patterns influencing solar generation.
Figure 5. Auto-correlation of Halmstad and Uppsala PV-produced power with respect to corresponding lag values.
The stronger temporal autocorrelation observed in Halmstad implies that future PV production values are more predictable based on past values, which benefits forecasting models, especially in multi-step settings. This may explain why Halmstad exhibits lower MAE and MQL values in later experiments, particularly when using direct strategies (see Section 5.6). It also suggests that Halmstad’s stronger signal structure makes it more suitable for TL or generalized models, potentially reducing the performance gap between aggregated and individualized training approaches compared to Uppsala.

5.4. Feature–Target Correlation Study

To further justify the selection of input features and to quantify their relationship with the forecasting targets, we conduct a systematic correlation analysis on the primary Swedish datasets. For each prosumer, we compute three complementary correlation coefficients between every weather feature and the target variable (either P P r o d u c e d or P C o n s u m e d ): Pearson coefficient (linear dependence), Spearman coefficient (monotonic dependence), and Kendall τ coefficient (ordinal dependence). The results are averaged across prosumers per site and target, and are visualized as heatmaps in Figure 6.
Figure 6. Feature–target correlation heatmaps (Pearson, Spearman, Kendall) for Halmstad and Uppsala, averaged across prosumers. Values close to ± 1 indicate strong linear or monotonic dependence; values near 0 indicate weak association.
For PV production, Global Radiation is by far the most strongly correlated feature across both sites, with Pearson r = 0.86 , Spearman ρ = 0.85 , and Kendall τ = 0.74 in Halmstad, and Pearson r = 0.86 , Spearman ρ = 0.92 , and Kendall τ = 0.81 in Uppsala. This is physically expected, as solar irradiance is the primary driver of PV generation. Humidity shows a consistent negative correlation with production (Pearson r ≈ − 0.53 in both sites), reflecting cloud cover effects. Temperature also exhibits a moderate positive correlation ( r ≈ 0.40 – 0.44 ), consistent with its role as a seasonal proxy. The nonlinear measures (Spearman and Kendall) largely confirm the Pearson findings, indicating that the relationships are not merely linear artifacts.
For household consumption, correlations with weather features are considerably weaker across both sites. The strongest signal is from dew point in Uppsala (Pearson r = − 0.24 , Spearman ρ = − 0.34 ) and humidity in Halmstad (Pearson r = − 0.12 , Spearman ρ = − 0.19 ). This low weather–consumption correlation is expected: residential electricity consumption is driven primarily by occupant behavior and appliance use, rather than by outdoor conditions, particularly in Sweden, where a large share of space heating is supplied through district heating rather than directly through the electrical grid [33]. These results confirm that while weather features provide a meaningful signal for production forecasting, temporal and behavioral patterns captured implicitly through time-of-day and day-of-week encodings, as well as lagged target values, are the primary drivers for consumption accuracy. Weather features serve as secondary context rather than primary predictors for consumption. This distinction further motivates the use of personalized household-level models, as discussed in Section 5.2, since individual temporal usage patterns vary significantly between households and cannot be captured by shared weather signals alone.

5.5. Performance Evaluation of Single-Step Techniques

This section evaluates the performance of different ML models for single-step forecasting of power production and consumption at a 90% prediction interval ( q = 0.90 ), a standard setting in QR [34]. The results in Table 3 represent average metrics across all households in Uppsala and Halmstad, aggregated separately by location. As shown in Section 5.3, Halmstad’s PV production exhibits stronger temporal dependencies, which translate into improved model performance. Among all evaluated methods, the LightGBM GBQR model consistently achieves the best accuracy. In Uppsala, it yields an MAE of 16.12 W for production and 16.34 W for consumption. In Halmstad, the same model achieves a lower production MAE of 10.19 W, while its consumption MAE of 20.37 W is slightly higher than in Uppsala. On average across sites, the MQF model tends to rank second, although the ordering of the remaining models (GP and GBQR-CatBoost) varies by site and target. Regarding uncertainty-aware performance, LightGBM GBQR also achieves the lowest MPIR values: 58.27 W (production) and 91.17 W (consumption) in Uppsala, and 51.02 W and 50.72 W, respectively, in Halmstad. Most models exhibit good calibration (low CFE), with CatBoost GBQR showing particularly strong reliability. One exception is the MQF model in Uppsala, which produces a relatively high CFE of 0.23, indicating overconfident intervals.
Table 3. Regression metrics across Halmstad, Uppsala, power production, and consumption (best performing ).
Overall, the results confirm that LightGBM GBQR is the most robust model for single-step forecasting under uncertainty, achieving the best performance across both sites. It is worth noting that sMAPE and MAE rankings occasionally diverge for consumption targets: for example, MQF achieves a lower sMAPE than GBQR–LightGBM in Halmstad consumption (4.68% vs. 5.75%), despite having a substantially higher MAE (50.18 W vs. 20.37 W). This discrepancy arises because sMAPE is sensitive to near-zero denominators, which occur when both actual and predicted consumption values approach zero during low-demand periods. Since MAE operates directly in physical units and is unaffected by this distortion, it remains the primary accuracy metric in this work, with sMAPE serving as a complementary scale-independent indicator. Notably, the lower error rates observed in Halmstad can be attributed to its more consistent solar generation patterns and higher temporal autocorrelation in PV production data, as detailed in Section 5.3. The near-ideal R2 values observed for production forecasting (0.99 in most cases) are physically justified rather than indicative of overfitting: as shown in Section 5.4, Global Radiation alone exhibits a Pearson correlation of r = 0.86 with PV production, meaning that a well-fitted model will naturally achieve high R2 on held-out test data, since the target is strongly and directly determined by an observed input feature. This is further supported by the training-size analysis in Section 5.1: as shown in Figure 3, error decreases monotonically with increasing training set size and plateaus beyond approximately 4000 samples, rather than first decreasing and then increasing on held-out data, the latter pattern being a hallmark of overfitting as model capacity outpaces available training data.

5.6. Performance Evaluation of Multi-Step Techniques

Before comparing the three multi-step strategies against each other, we first establish their necessity by benchmarking against a naive persistence baseline, which predicts that every future value equals the last observed value (i.e., y ^ t + h = y t for all h = 1 , … , 48 ). Table 4 reports the average MAE and sMAPE of the persistence baseline alongside the direct method (the best-performing ML strategy) for both Swedish sites. The direct method reduces MAE by 96.6% for Halmstad production and 95.2% for Uppsala production compared to persistence, clearly demonstrating the value of the proposed ML approach. For consumption, the improvement is 94.4% in Halmstad and 94.8% in Uppsala. The recursive and hybrid methods also outperform the persistence baseline at every site and target, but by a substantially smaller margin than the direct method: for example, the recursive method reduces Halmstad consumption MAE by only 81.1% relative to persistence (927.77 W to 175.65 W), compared to the direct method’s 94.4% reduction. This narrower margin, combined with the widening MPIR values shown later in this section, reflects the danger of error accumulation in recursive forecasting over a 48 h horizon.
Table 4. Comparison of the direct multi-step ML method against a naive persistence baseline (average across all 48 forecast steps).
This section compares the effectiveness of different multi-step forecasting techniques: direct, recursive, and hybrid, as introduced in Section 4.4, for predicting power consumption and production over 48 h horizons. All evaluations are conducted using the LightGBM GBQR model, identified in Section 5.5 as the best-performing approach for single-step forecasts. This ensures consistency in assessing each strategy’s impact. The evaluation uses MAE, MPIR, CFE, and PICP as performance metrics. In addition to the Swedish datasets (Uppsala and Halmstad), we include the CityLearn 2022 dataset as a standardized benchmark for building-level energy forecasting.
Table 5 presents the average regression results for consumption and production forecasts using the three multi-step strategies across the Swedish sites and the CityLearn dataset. The direct strategy consistently yields the lowest MAE and MPIR values, demonstrating better predictive accuracy and stability. For example, in Uppsala, the direct approach results in an average MAE of 71.08 W for consumption, which is significantly better than the 140.77 W obtained using the recursive approach. In Halmstad, the direct strategy also shows superior performance, with a consumption MAE of 52.05 W, compared to 175.65 W for the recursive method. In terms of production, the direct method again shows lower average MAE values, such as 142.24 W in Uppsala and 94.17 W in Halmstad.
Table 5. Average regression metrics for multi-step forecasts (48 h).
The CityLearn dataset produces the most favorable results across all strategies, with lower MAE, MPIR, and CFE values. This strong performance reflects two compounding factors: first, the dataset is simulation-derived (EnergyPlus), which reduces the measurement noise and irregular variability inherent in real metered data; second, its California location means solar production and electricity demand follow more consistent daily and seasonal patterns than in Sweden. Together, these factors make it easier for ML models to generalize effectively, and readers should bear this in mind when comparing CityLearn results to the Swedish findings. In contrast, the Swedish datasets reflect real metered prosumer behavior under pronounced seasonal and weather-related variability, posing greater challenges for accurate forecasting while better representing real-world deployment conditions. It is important to note that the Swedish prosumer data constitute the real experimental validation requested alongside simulation-based results: unlike CityLearn, which is generated via EnergyPlus building simulation, the Uppsala and Halmstad datasets consist of actual hourly measurements from real prosumer installations, collected over 14 months under real-world weather and behavioral conditions. The consistent superiority of the direct method across both the simulated CityLearn data and the real Swedish measurements therefore confirms the correctness and effectiveness of the proposed approach under both controlled and real-world deployment conditions.
Figure 7 and Figure 8 display the MAE and MPIR values over the 48 h prediction interval for both consumption and production forecasts for Halmstad and Uppsala, respectively. These results are aggregated for each forecast step. We clarify an apparent inconsistency raised regarding the interpretation of MPIR: although Figure 7 and Figure 8 show certain configurations of the direct method attaining a relatively high MPIR at some horizons, this does not contradict its role in minimizing the effects of uncertainty propagation. The direct strategy maintains relatively stable MAE and MPIR values throughout the forecast horizon, which reflects its strength in preserving accuracy as the horizon extends. While a lower MPIR indicates tighter and thus more confident prediction intervals, the key advantage of the direct method is not that its intervals are unconditionally narrower, but that they remain consistently calibrated across all 48 steps. The recursive method, despite sometimes producing narrower intervals at early steps, yields dramatically wider and increasingly unreliable intervals at longer horizons, as evidenced by its MPIR of 921.63 W against 323.22 W for the direct method in Uppsala production, making it less suitable for operational risk-aware decision-making. The recursive strategy, on the other hand, exhibits a broader distribution of errors, particularly at longer horizons. This behavior highlights its tendency to accumulate prediction errors. The hybrid approach shows intermediate performance, with better accuracy than the recursive method but greater variability than the direct strategy.
Figure 7. Error distributions for multi-step forecasting in Halmstad across different strategies and targets.
Figure 8. Error distributions for multi-step forecasting in Uppsala across different strategies and targets.
Beyond point prediction performance, the direct approach also shows stronger reliability in probabilistic forecasting. This is reflected in the highest PICP values among the evaluated methods. For instance, PICP reaches 0.962 in Uppsala, 0.961 in Halmstad, and 0.975 in the CityLearn dataset for consumption forecasts, indicating that the predicted uncertainty intervals successfully enclose most actual values. The recursive approach shows slightly lower PICP scores, such as 0.954 in Uppsala and 0.951 in Halmstad, which suggests reduced reliability due to the accumulation of forecast errors. The hybrid approach again performs between the other two methods, offering moderate calibration.
A more detailed examination of the uncertainty metrics reveals additional insights into how well the models capture uncertainty. While the recursive method often retains low CFE values on the Swedish datasets, its MPIR values are substantially larger and its PICP scores are lower than those of the direct method. This indicates that the recursive intervals, although nominally covering a comparable fraction of true values, tend to become excessively wide as forecast errors accumulate over the horizon. Such behavior reduces their usefulness for risk-aware decision-making. This is particularly evident for Uppsala’s production forecasts using the recursive method, as noted above. These observations emphasize the importance of interpreting CFE in conjunction with MPIR and PICP to evaluate the practical quality of uncertainty estimation.
Overall, the results demonstrate that the direct multi-step approach provides the most accurate and reliable performance for extended forecast horizons. Although the hybrid method offers a balance between computational efficiency and predictive quality, it remains less consistent than the direct strategy. The recursive method, while simple, is especially vulnerable to compounding errors over time. Selecting an appropriate forecasting method should take into account the available data quality, forecast horizon, and operational requirements to ensure effective deployment in smart grid applications.

6. Conclusions

In this study, various quantile ML models were assessed to predict power production and consumption in a smart energy grid with uncertainty bounds. These models estimated the expected median value ( y ^ m ) and a prediction interval, consisting of a lower and upper quantile value ( y ^ l , y ^ u ) , with a 90% confidence level to measure the prediction uncertainty.
The results indicate that multiple calibrated models can estimate prediction intervals with a CFE of less than 10%. The GBQR LightGBM model had the best performance overall, achieving an MQL as low as 4.99 W (Halmstad production), with MQF ranking second. In terms of prediction quality, our approach achieves a single-step production MAE of 10.19 W in Halmstad and 16.12 W in Uppsala, and a consumption MAE of 16.34 W in Uppsala and 20.37 W in Halmstad. Additionally, the impact of the training dataset size on prediction accuracy was investigated, and it was determined that for power production, 4000 samples were sufficient for accurate estimates in the smart energy grid, which contained seven households from real prosumers located in Sweden.
Additionally, a household-based evaluation of different training schemes was conducted. The households in the test smart grid had varying properties that resulted in heteroscedastic capacity values and, consequently, varying prediction accuracies depending on the household. Our study found that household-based models, which exclusively used data from their respective households, achieved the highest estimation accuracy, despite being trained with the least data. However, the LOO training scheme showed that learned patterns in one household did not necessarily apply to other households.
The performance evaluation of multi-step prediction techniques showed that the direct approach consistently provided the highest accuracy and narrowest error margins, with the lowest MAE and MPIR values for 48 h predictions. For instance, it achieved a consumption MAE of 71.08 W in Uppsala and 52.05 W in Halmstad, outperforming the recursive method, which had higher consumption MAE values (140.77 W and 175.65 W, respectively). These results highlight the robustness and reliability of the direct method for long-term forecasting. While the recursive approach had broader error margins due to error accumulation, the hybrid method balanced accuracy and computational efficiency but still faced stability issues. Moreover, we introduced the PICP to evaluate the reliability of forecast uncertainty bounds. The direct approach consistently achieved the highest PICP values, reaching 0.962 in Uppsala and 0.961 in Halmstad for consumption, indicating well-calibrated prediction intervals. To further validate our findings, we also evaluated the methods on the CityLearn 2022 dataset, which serves as a benchmark for building-level energy forecasting. The direct approach again outperformed other techniques, achieving a consumption MAE of 5.92 W and a PICP of 0.975, demonstrating both high accuracy and robust uncertainty calibration across diverse contexts.
In future work, we plan to expand our forecasting methods to include a broader range of models and incorporate additional data inputs to improve the accuracy of PV production predictions. A key next step will be enhancing load predictions by integrating factors such as EV usage and consumer behavior. Additionally, implementing our methods within an MLOps framework will be crucial for maintaining high model quality and ensuring adaptability to the evolving landscape of forecasting in the energy sector.

Author Contributions

Conceptualization, P.A., S.S., A.T. and A.K.; Methodology, P.A. and S.S.; Software, P.A. and S.S.; Validation, P.A., S.S., A.T. and A.K.; Formal Analysis, P.A. and S.S.; Investigation, P.A. and S.S.; Data Curation, P.A.; Writing—Original Draft Preparation, P.A.; Writing—Review and Editing, P.A., S.S., A.T. and A.K.; Visualization, P.A.; Supervision, A.T. and A.K.; Project Administration, A.K. and A.T.; Funding Acquisition, A.K. and A.T. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the Swedish Energy Agency through the project Solar Electricity Research Centre, Sweden (SOLVE), grant number 52693-1. Additional support was provided by the Bavarian Government through the High-Tech Agenda (HTA) and the Knowledge Foundation of Sweden (KKS) through project 20210059.

Data Availability Statement

The Swedish prosumer datasets used in this study were provided by CheckWatt AB and are not publicly available due to privacy and commercial restrictions. Requests to access these datasets should be directed to the corresponding author with the permission of CheckWatt AB. The CityLearn 2022 Challenge dataset is publicly available at: https://github.com/intelligent-environments-lab/CityLearn/tree/master/data/datasets/ (accessed on 1 May 2026). The code implementing the model training, evaluation, and multi-step forecasting strategies described in this paper is publicly available at: https://github.com/Pekanuss123/Energies-Journal/ (accessed on 1 June 2026).

Acknowledgments

The authors thank CheckWatt AB for providing access to the prosumer dataset. This paper is an extended version of our paper published in: Aupke, P.; Seema; Theocharis, A.; Kassler, A.; Archer, D.-E. “PV Power Production and Consumption Estimation with Uncertainty Bounds in Smart Energy Grids.” In Proceedings of the 2023 IEEE EEEIC / I&CPS Europe, 2023, pp. 1–6.

Conflicts of Interest

The authors declare no conflicts of interest. The funders had no role in the design of the study, the collection, analyses, or interpretation of data, the writing of the manuscript, or the decision to publish the results.

Abbreviations

The following abbreviations are used in this manuscript:
ANNArtificial Neural Network
CFECoverage Fraction Error
CPPSCyber Physical Power Systems
DLDeep Learning
FLFederated Learning
GBQRGradient Boosted Quantile Regression
GPGaussian Process
KDEKernel Density Estimation
LOOLeave-One-Out
LQRLinear Quantile Regression
MAEMean Absolute Error
MLMachine Learning
MPIRMean Prediction Interval Range
MQFMulti-Quantile Function
MQLMean Quantile Loss
PIPrediction Interval
PICPPrediction Interval Coverage Probability
PVPhotovoltaic
QNNQuantile Neural Network
QRQuantile Regression
SMHISwedish Meteorological and Hydrological Institute
SVMSupport Vector Machine
TLTransfer Learning

References

  1. Yohanandhan, R.V.; Elavarasan, R.M.; Pugazhendhi, R.; Premkumar, M.; Mihet-Popa, L.; Terzija, V. A holistic review on Cyber-Physical Power System (CPPS) testbeds for secure and sustainable electric power grid—Part—I: Background on CPPS and necessity of CPPS testbeds. Int. J. Electr. Power Energy Syst. 2022, 136, 107718. [Google Scholar] [CrossRef] [Scilit]
  2. Alvarez-Alvarado, M.S.; Apolo-Tinoco, C.; Ramirez-Prado, M.J.; Alban-Chacón, F.E.; Pico, N.; Aviles-Cedeno, J.; Recalde, A.A.; Moncayo-Rea, F.; Velasquez, W.; Rengifo, J. Cyber-physical power systems: A comprehensive review about technologies drivers, standards, and future perspectives. Comput. Electr. Eng. 2024, 116, 109149. [Google Scholar] [CrossRef] [Scilit]
  3. Motegi, N.; Piette, M.A.; Kinney, S.; Dewey, J. Case Studies of Energy Information Systems and Related Technology: Operational Practices, Costs, and Benefits. In Proceedings of the International Conference for Enhanced Building Operations, Berkeley, CA, USA, 13–15 October 2003. Report LBNL-53406; Lawrence Berkeley National Laboratory: Berkeley, CA, USA, 2003. [Google Scholar]
  4. Strubell, E.; Ganesh, A.; McCallum, A. Energy and policy considerations for modern deep learning research. Proc. AAAI Conf. Artif. Intell. 2020, 34, 13693–13696. [Google Scholar] [CrossRef] [Scilit]
  5. Nammouchi, A.; Aupke, P.; D’Andreagiovanni, F.; Ghazzai, H.; Theocharis, A.; Kassler, A. Robust opportunistic optimal energy management of a mixed microgrid under asymmetrical uncertainties. Sustain. Energy Grids Netw. 2023, 36, 101184. [Google Scholar] [CrossRef] [Scilit]
  6. Gaboitaolelwe, J.; Zungeru, A.M.; Yahya, A.; Lebekwe, C.K.; Vinod, D.N.; Salau, A.O. Machine Learning Based Solar Photovoltaic Power Forecasting: A Review and Comparison. IEEE Access 2023, 11, 40820–40845. [Google Scholar] [CrossRef] [Scilit]
  7. Alcañiz, A.; Grzebyk, D.; Ziar, H.; Isabella, O. Trends and gaps in photovoltaic power forecasting with machine learning. Energy Rep. 2023, 9, 447–471. [Google Scholar] [CrossRef] [Scilit]
  8. Manandhar, P.; Rafiq, H.; Rodriguez-Ubinas, E. Current status, challenges, and prospects of data-driven urban energy modeling: A review of machine learning methods. Energy Rep. 2023, 9, 2757–2776. [Google Scholar] [CrossRef] [Scilit]
  9. Maleki, N.; Lundström, O.; Musaddiq, A.; Jeansson, J.; Olsson, T.; Ahlgren, F. Future energy insights: Time-series and deep learning models for city load forecasting. Appl. Energy 2024, 374, 124067. [Google Scholar] [CrossRef] [Scilit]
  10. Gooi, H.B.; Wang, T.; Tang, Y. Edge Intelligence for Smart Grid: A Survey on Application Potentials. CSEE J. Power Energy Syst. 2023, 9, 1623–1640. [Google Scholar] [CrossRef] [Scilit]
  11. Nayak, S.; Patgiri, R.; Waikhom, L.; Ahmed, A. A review on edge analytics: Issues, challenges, opportunities, promises, future directions, and applications. Digit. Commun. Netw. 2024, 10, 783–804. [Google Scholar] [CrossRef] [Scilit]
  12. Aupke, P.; Seema; Theocharis, A.; Kassler, A.; Archer, D.E. PV power production and consumption estimation with uncertainty bounds in smart energy grids. In Proceedings of the 2023 IEEE International Conference on Environment and Electrical Engineering and 2023 IEEE Industrial and Commercial Power Systems Europe (EEEIC/I and CPS Europe), Madrid, Spain, 6–9 June 2023; pp. 1–6. [Google Scholar] [CrossRef] [Scilit]
  13. Yang, H.; Tate, M. A Descriptive Literature Review and Classification of Cloud Computing Research. Commun. Assoc. Inf. Syst. 2012, 31, 30. [Google Scholar] [CrossRef] [Scilit]
  14. Khan, T.; Tian, W.; Zhou, G.; Ilager, S.; Gong, M.; Buyya, R. Machine learning (ML)-centric resource management in cloud computing: A review and future directions. J. Netw. Comput. Appl. 2022, 204, 103405. [Google Scholar] [CrossRef] [Scilit]
  15. Kim, J.; Obregon, J.; Park, H.; Jung, J.Y. Multi-step photovoltaic power forecasting using transformer and recurrent neural networks. Renew. Sustain. Energy Rev. 2024, 200, 114479. [Google Scholar] [CrossRef] [Scilit]
  16. Limouni, T.; Yaagoubi, R.; Bouziane, K.; Guissi, K.; Baali, E.H. Accurate one step and multistep forecasting of very short-term PV power using LSTM-TCN model. Renew. Energy 2023, 205, 1010–1024. [Google Scholar] [CrossRef] [Scilit]
  17. Makridakis, S.; Spiliotis, E.; Assimakopoulos, V. The M4 Competition: Results, findings, conclusion and way forward. Int. J. Forecast. 2018, 34, 802–808. [Google Scholar] [CrossRef] [Scilit]
  18. Ben Taieb, S.; Bontempi, G.; Atiya, A.F.; Sorjamaa, A. A review and comparison of strategies for multi-step ahead time series forecasting based on the NN5 forecasting competition. Expert Syst. Appl. 2012, 39, 7067–7083. [Google Scholar] [CrossRef] [Scilit]
  19. Aupke, P.; Kassler, A.; Theocharis, A.; Nilsson, M.; Andersson, I.M. Impact of Clustering Methods on Machine Learning-based Solar Power Prediction Models. In Proceedings of the 2022 IEEE International Smart Cities Conference (ISC2), Pafos, Cyprus, 26–29 September 2022; pp. 1–7. [Google Scholar] [CrossRef] [Scilit]
  20. Liu, X.; Golab, L.; Golab, W.; Ilyas, I.F. Smart Meter Data Analytics: Systems, Algorithms, and Benchmarking. ACM Trans. Database Syst. 2016, 42, 1–39. [Google Scholar] [CrossRef] [Scilit]
  21. Fekri, M.N.; Grolinger, K.; Mir, S. Distributed load forecasting using smart meter data: Federated learning with Recurrent Neural Networks. Int. J. Electr. Power Energy Syst. 2022, 137, 107669. [Google Scholar] [CrossRef] [Scilit]
  22. Ben Taieb, S.; Sorjamaa, A.; Bontempi, G. Multiple-output modeling for multi-step-ahead time series forecasting. Neurocomputing 2010, 73, 1950–1957. [Google Scholar] [CrossRef] [Scilit]
  23. Hong, T.; Pinson, P.; Wang, Y.; Weron, R.; Yang, D.; Zareipour, H. Energy Forecasting: A Review and Outlook. IEEE Open Access J. Power Energy 2020, 7, 376–388. [Google Scholar] [CrossRef] [Scilit]
  24. Meinshausen, N. Quantile Regression Forests. J. Mach. Learn. Res. 2006, 7, 983–999. [Google Scholar]
  25. Ke, G.; Meng, Q.; Finley, T.; Wang, T.; Chen, W.; Ma, W.; Ye, Q.; Liu, T.Y. LightGBM: A Highly Efficient Gradient Boosting Decision Tree. In Advances in Neural Information Processing Systems 30; Guyon, I., Luxburg, U.V., Bengio, S., Wallach, H., Fergus, R., Vishwanathan, S., Garnett, R., Eds.; Curran Associates, Inc.: Red Hook, NY, USA, 2017; pp. 3146–3154. [Google Scholar]
  26. Wen, R.; Torkkola, K.; Narayanaswamy, B.; Madeka, D. A Multi-Horizon Quantile Recurrent Forecaster. arXiv 2017, arXiv:1711.11053. [Google Scholar] [CrossRef] [Scilit]
  27. Xu, C.; Sun, Y.; Du, A.; Gao, D.c. Quantile regression based probabilistic forecasting of renewable energy generation and building electrical load: A state of the art review. J. Build. Eng. 2023, 79, 107217. [Google Scholar] [CrossRef] [Scilit]
  28. Wang, Y.; Gan, D.; Sun, M.; Zhang, N.; Lu, Z.; Kang, C. Probabilistic individual load forecasting using pinball loss guided LSTM. Appl. Energy 2019, 235, 10–20. [Google Scholar] [CrossRef] [Scilit]
  29. Zhang, Y.; Ma, R.; Liu, J.; Liu, X.; Petrosian, O.; Krinkin, K. Comparison and Explanation of Forecasting Algorithms for Energy Time Series. Mathematics 2021, 9, 2794. [Google Scholar] [CrossRef] [Scilit]
  30. Terrell, G.R.; Scott, D.W. Variable kernel density estimation. Ann. Stat. 1992, 20, 1236–1265. [Google Scholar] [CrossRef] [Scilit]
  31. Prokhorenkova, L.; Gusev, G.; Vorobev, A.; Dorogush, A.V.; Gulin, A. CatBoost: Unbiased Boosting with Categorical Features. Adv. Neural Inf. Process. Syst. 2018, 31, 6639–6649. [Google Scholar] [CrossRef] [Scilit]
  32. Sorjamaa, A.; Lendasse, A. Time series prediction using DirRec strategy. In Proceedings of the ESANN’2006 Proceedings—European Symposium on Artificial Neural Networks, Bruges, Belgium, 26–28 April 2006; pp. 143–148. [Google Scholar]
  33. Werner, S. District heating and cooling in Sweden. Energy 2017, 126, 419–429. [Google Scholar] [CrossRef] [Scilit]
  34. Koenker, R.; Hallock, K.F. Quantile Regression. J. Econ. Perspect. 2001, 15, 143–156. [Google Scholar] [CrossRef] [Scilit]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.