# Applications of Probabilistic Forecasting in Demand Response
## 3 Results
### Probabilistic Predictions  
This section depicts the probabilistic predictions obtained with the two methods described above (LQR and the \(QRF\)), with the double objective of comparing accuracy between the methods and evaluating the effect on the applications for demand response. Two different prediction models were developed for each of the two methods. The first model of each method was designed to predict the demand value for each hour of the following day (forecasting horizon of 48 h); they are denoted by LQR48 and QRF48, respectively. The second model of each method was designed to provide the demand value with a prediction horizon of 1 h; they are denoted by LQR1 and QRF1, respectively. The first model compromises a total of 55 predictors, whereas the second model involves a total of 79 predictors, both detailed in Tables 3 and 4, respectively. In all cases, the 99 quantiles corresponding to probabilities 0.01, 0.02, \(\ldots\), 0.99 were estimated. The coefficients for each model were adjusted using the training dataset, including all available explanatory variables. Once the models were developed, they were applied for the forecast of the hourly load using the data from the testing dataset. In the case of LQR, to avoid quantile crossing, the 99 values obtained for each hour were reordered accordingly. Table 5 shows the deterministic (forecast for quantile 0.5) and probabilistic forecasting results obtained for the entire testing dataset. It is worth highlighting the improvement achieved, as expected when reducing the prediction horizon, in both the deterministic and probabilistic forecasts of the LQR1 compared to the LQR48 model. However, the LQR1 model exhibits a poorer calibration compared to the LQR48 model, which can be observed in Figure 2, where _PICP_ and VRH are plotted for the testing period, applying both models. For the VRH, classes of length 10 were considered--that is, the first bar of the histogram shows the relative counts of percentiles from 1 to 10, the second bar shows the relative counts of percentiles from 11 to 20, and so on. Therefore, a flat VRH is expected for a calibrated model, with 10% of relative frequency for each class. While the LQR48 model exhibits an almost flat VRH, the LQR1 model clearly shows under-dispersion. Sharpness is depicted in Figure 3.  
In the case of the _QRF_, the parameter tunning was performed by 10-fold cross validation, with ntree = 1000 (large enough), and searching for the minimum _CRPS_ in a grid varying mtry and min.node.size. Note that _CRPS_ was selected as the goodness-of-fit measure to evaluate the three properties of probabilistic forecasts jointly (accuracy, calibration, and sharpness). For the prediction horizon of 48 h and 1 h, the optimal hyperparameters after the cross-validation process as well as some goodness-of-fit measures for the test dataset can be seen in Table 6. \begin{table}
\begin{tabular}{c c} \hline Weather variables (7 predictors) & temp, swflux, mod, rh, cft, prec and snow. \\ \hline Historical loads (30 predictors) & Actual loads with lags 1, 2, \(\ldots\), 24, 48, 72, 96, 120, 144, 168. \\ \hline Calendar variables (42 predictors) & Eleven dummies for the month, six dummies for the weekday, twenty-three dummies for the day hour, one dummy for holidays, and one dummy for daylight saving time. \\ \hline \end{tabular}
\end{table} 
Table 4: List of predictors used in the LRQ and _QRF_ methods with a prediction horizon of 1 h. \begin{table}
\begin{tabular}{c c c} \hline \hline  & **LQR48 (Horizon 48 h)** & **LQR1 (Horizon 1 h)** \\ \hline _MAE_ (kW) & 231.46 & 133.16 \\ \hline _RMSE_ (kW) & 313.59 & 185.34 \\ \hline _CRPS_ (kW) & 164.44 & 95.11 \\ \hline \end{tabular}
\end{table} 
Table 5: Forecasting results of the LQR models for the testing dataset. Figure 3: Sharpness property of the LQR models: _PINAW_ for the LQR48 model (black dots) and for the LQR1 model (blue dots).