## 3 Monitoring System and Optimized Building Operation
### Data Preprocessing and Analysis
#### 3.1.3 Experimental Validation and Prediction Inaccuracy  
Evaluation  
The predictive performance of the methods determined in this paper is evaluated with the statistical error interpretations the mean absolute percentage error (MAPE) and percentage mean deviation (MAE). The mean absolute percentage error or MAPE represents the absolute percentage deviation of the values. Therefore, a particularly low value means a good reproduction of the regression model. \[MAPE(\%)=\frac{100\%}{n}\sum\
olimits_{i=1}^{n}\left|\frac{y_{i}-\hat{y}_{i }}{y_{i}}\right| \tag{5}\]  
The real value is subtracted from the forecast and divided by the real value. Thus, the sum of the individual deviations multiplied by 100% and divided by the number forms the percentage mean deviation (MAE). \[MAE=\frac{\sum\
olimits_{i=1}^{n}\left|\hat{y}_{i}-y_{i}\right|}{n} \tag{6}\]  
In many studies, MAPE is a popular way of evaluating forecasting methods for household electricity demand [37; 42]. Eletrical Heat Pump Demand  
For validation purposes, simulations were carried out with metrological data (ambient temperature, global radiation) during the heating period of 2017/2018, including autumn, winter, and spring. During that period, the thermal heat pump energy output was 15,744 kWh (simulated) and 16,182 kWh (measured). Electrical heat pump energy demand was 3826 kWh (simulated) and 3691 kWh (measured). These results are also shown in Figure 15. Figure 16 shows the ACF (autocorrelation function) and the corresponding residuals plot. With a MAPE of 22.8%, the results show a good match on a daily basis as well as no periodic dependency regarding the ACF that would implement a systematic error. Figure 15: Comparison of simulated and measured thermal and electrical heating demand over one winter season (daily values). Figure 17 shows a comparison of the simulation results with the measured electrical power demand of the heat pump with a one-minute time resolution over the course of two days. The power peak and the durance of the heating process show a good match. Nevertheless, predicting the timing of the intervals is not always accurate, e.g., due to user behavior affecting the DHW demand and ventilation. PV Electricity Production  
For the predicted PV production baseline, the MAPE on an hourly basis between the PV power prediction and real measured data is 22.1% for a forecast one day in advance, 23.3% for a forecast two days in advance, and 27.5% for a forecast three days in advance (see Figure 18). Figure 16: Autocorrelation function (ACF) and residuals plot between simulated and measured thermal heating demand over one winter season (daily values). Figure 17: Comparison of simulated and measured thermal heating power (heat pump). Household Electricity Demand  
The models kNN and DTR are trained with 85% of the dataset and tested with the rest. The training of the models is optimized by a grid search. In Figure 19 the hourly kNN prognosis for the test data (612 h) is shown. The frame of the prediction corresponds to about 25 days. The hourly course shows that the demand peaks of the prediction by the kNN method correspond to the actual ones but often show a shift on the x-axis. In addition, the load peaks are often over dimensioned. The daily requirement forecast (see Figure 20) also shows that the progression is sketched, but always shows a shift on the x and y axes. The hourly prediction by the DTR method (see Figure 21) shows that the model uses a kind of basic pattern for the prediction that is differently pronounced at the y-axis as well as at its shape, depending on the hour. The baseline in the model is much worse than that in the kNN method. Figure 19: K-nearest neighbors (kNN): Hourly demand and prediction over ca. 612 h.  
Figure 18: Comparison of predicted and measured photovoltaic (PV) yield with a prediction time of 24 h, 48 h, and 72 h in advance. The daily prediction by the DTR method (see Figure 22) shows that the progression and proportions are similar to the actual demand, but there is a stronger shift on the x and y axes.