1. Introduction
Reliable energy models are needed to determine flexibility in energy demand of buildings and to estimate energy savings resulting from energy conservation measures. Senave et al. [
1] defined three key elements for which thorough insight is required to asses energy performance of existing buildings: (i) the thermal performance of the building fabric, (ii) the efficiency of the technical systems, and (iii) the behavior of the users. Energy modeling of urban buildings seeks to expand conventional whole building energy modeling to the scale of neighborhoods, cities, or even entire building stocks [
2]. Creating reliable models at these scales is difficult, as they require large amounts of detailed input data that are lacking in digitized form for most existing buildings. However, development within aerial imaging or LiDAR (light detection and ranging) [
3] makes 3D shape representation of existing buildings possible. Such data sources enable relatively detailed energy models to be constructed, especially geometrical aspects of the building and its surroundings [
4]. However, parameters describing thermal performance of the building fabric, the technical systems, and occupant behavior are usually not readily accessible in a digitized format. Calibration with on-site measurements is needed to obtain reliable estimates of these aspects [
1,
5]. Today, metering data that provides the basis for utility billing are often available in decent resolution and sampling rates [
6]. These metering data coming from on-site measurements, such as supplied energy and domestic cold water, indirectly contain or mirror the buildings’ actual energy performance.
In a review on methodologies and recent advancements in the calibration of building energy models, Fabrizio and Monetti [
5] concluded that automated models are often simplified in order to reduce computational time, and due to that, more complex models are difficult to handle in the calibration process. They also highlighted the importance of assessment of occupancy behavior, “since the occupancy related to the building usage is one of the main sources of uncertainty in the building simulation models” [
5]. A method of introducing and handling parameter uncertainty in energy models is with a Bayesian approach. Several studies aiming at understanding and showing the potentials of this approach are listed in Chong and Menberg [
7], where energy models performance, based on Bayesian calibration, are tested on and compared with deterministic model results. Based on these experiences, guidelines for Bayesian calibration of building energy models are presented. Accordingly, a test of the guidelines in a case study [
7] also suggests that Bayesian calibration has limitations depending on the information content within datasets in terms of how many uncertain parameters can be introduced in the model and the quality of prior knowledge about these.
Previous energy model calibration research can be grouped into those working with relatively simple state-space models with 2 to 4 state variables (for example Bacher and Madsen [
8], Coffman and Barooah [
9], Raillon and Ghiaus [
10], Rouchier et al. [
11]) and those working with calibration of detailed engineering-based models (for example Chong and Menberg [
7], Tian et al. [
12], Bandera and Ruiz [
13]). The benefits of simple state-space models are that little prior information about the building is needed and that these can be efficiently computed and used directly in Monte Carlo Markov Chain (MCMC)-based inference. However, such models do not reveal much details about the energy performance. Engineering-based simulation tools such as EnergyPlus [
14] are based on extensive building physics research [
15]. When such models are calibrated, they can provide detailed knowledge about the energy performance of the building and its components. Nonetheless, these engineering-based models require detailed input and are too computationally expensive to be directly used in MCMC-based inference. The typical Bayesian approach is to approximate the detailed model with a simpler surrogate or emulator model [
7].
Weather-dependent space heating use can be estimated reasonably well deterministically [
4]. However, even the most sophisticated deterministic models contain approximation errors and, for example, Bacher and Madsen [
8] and Rouchier et al. [
11] suggest using stochastic state-space modeling to account for such approximation errors. Solar heat gains, internal heat gains, and heat use for domestic hot water (DHW) are inputs that contain high levels of time-varying uncertainty and are challenging for both stochastic and deterministic modeling approaches. Internal heat gains and DHW use are inherently uncertain due to dependency on occupant behavior [
16], whereas solar heat gains are uncertain both due to epistemic uncertainty of occupant behavior (i.e., shading operation) and aleatory uncertainty due the complexity in modeling solar irradiance and shading from the surroundings [
4,
17,
18]. Augmented stochastic state-space models have been suggested as a suitable approach to deal with such highly nondeterministic inputs: Kim and Park [
19] used a detailed augmented state-space model (consisting of 15 states) to estimate time-varying process disturbances attributed to uncertainty in internal heat sources and airflow, and Coffman and Barooah [
9] augmented a simplified two state-space model with a third disturbance state to account for unmeasured disturbances attributed to occupant behavior.
In this paper, we focus on Swedish district-heated multifamily buildings.
Figure 1 exemplifies the heat balance of a district heating substation serving multiple multifamily buildings. According to Kensby et al. [
20], there is untapped potential in using thermal mass as short-term thermal energy storage to shift heat demand from times when the district heat is produced at high cost and with negative environmental impact to more favorable hours. In Sweden, energy and water bills must be based on actual consumption [
21]. Consequently, most Swedish district heating operators have automatic meter-reading systems installed, which gather hourly or sub-hourly readings, storing them in centralized databases. Most Swedish cities have extensive district heating networks which provide heat to around 90% of all multifamily buildings [
22]. Such on-site measurements make calibration of energy models on large scales possible.
Kim and Park [
19] and Lundström et al. [
4] have proposed detailed state-space models that are able to produced simulation results similar to engineering-based simulation tools and that have potential to reveal detailed knowledge about the energy performance of buildings and their systems/components. To the authors knowledge, there are no previous published work that have conducted calibration with such detailed space-model with data from actual buildings. With increased availability of digitized information, automated collection, and integration of data into an energy model, representing one or multiple similar buildings is feasible today [
4]. A deterministic model in the form of a thermal network [
4] (a 14-node implementation based on that proposed by the ISO 52016-1:2017 [
23] standard) is transformed into a stochastic state-space model and further augmented with four additional disturbance variables. Furthermore, we presents a Bayesian calibration procedure to assess parameter uncertainty, to incorporate prior knowledge, and to test parameter estimation with both dynamic Hamiltonian Monte Carlo (HMC) sampling and penalized Maximum Likelihood Estimation (MLE) optimization by utilizing the probabilistic programming language Stan [
24]. The proposed model framework was tested in a case study, and lessons learned are reported and discussed.
The objective is a framework for assessing actual energy performance: A framework that works on most Swedish multifamily buildings, that is sufficiently detailed to result in usable insights, and that can make use of the varying data sources that are available today while still resulting in decent results in situations of less data availability. The main original contributions of our work are an iterated extended Kalman filter to handle nonlinearity of DHW use; an augmentation that implements a probabilistic approach for handling uncertain input data; a direct implemention of the model in the Stan language, thus enabling computationally efficient (including automatic differentiation) inference with both HMC and penalized MLE; and a case study based on real buildings and original data.
The work is presented as follows:
Section 2 presents the proposed Bayesian calibration procedure with an augmented stochastic state-space model. In
Section 3, we briefly describe our previous modeling work [
4] and extend the deterministic model to include heat losses in the piping, manual venting, DHW heat use, and internal heat gains and the uncertainty modeling of these four uncertain inputs. Finally,
Section 4 presents a case study to demonstrate the performance of the developed model framework: parameter estimation with both dynamic HMC sampling and penalized MLE optimization, the behavior of the filtering algorithm, the impact of different data sources for DHW use, and the impact of uncertainty in indoor temperature sensor readings.
5. Discussion
5.1. Bayesian Calibration
The developed energy model is relatively detailed, and identifying the full set of parameters
with only likelihood function is not feasible: the likelihood might not carry enough information for some parameters, and it is difficult to separate the effects of other parameters. An informative prior model is needed to constrain the parameter space. The data (through the likelihood function) usually carries strong evidence about the total heat loss but has much less information about the individual parameters. On the other hand, our prior knowledge is typically more informed and intuitive to specify on the individual building element level. The selection of parameters that are predetermined as uncertain
should be seen as part of the prior model specification. The used parameterization was based on a qualitative assessment by the authors, where aspects such as ease of prior specification, anticipated influence, and insight gain were considered. More formal parameter screening such sensitivity analysis (e.g., Senave et al. [
1] or Chong and Menberg [
7]) could be used for a more quantitative assessment.
The following ideal goals were formulated as a basis for the development work: 1. each parameter should describe one property; 2. the posterior should encompass the true value; 3. the prior should encompass the posterior; and 4. the prior model should be informative enough to be useful on its own. Goal 1 might be unreachable as there are interacting effects that are difficult to fully separate into a single parameter. If we are too far from goal 1, then goal 2 becomes more difficult to guarantee. Goal 3 could be reached by defining a very noninformative prior model, but this would breach goal 4 and leave us with a useless model in the absence of calibration data. Furthermore, a sufficiently informative prior model can, due to its regulating impact, help us in achieving goal 1 and thereby goal 2 as well. In essence, the entire process is somewhat iterative: reliable output is dependent on decent input which, in turn, is dependent on statistics from previous outputs and case-specific input data.
External air temperature is the strongest driver for energy use, but its effect manifests in different time lags. There is an instantaneous correlation that mainly affects heat loss through glazing, thermal bridges, and ventilation; heat losses through the envelope with thermal mass have more delayed effects (hours and up to a few days) while heat loss through the ground floor or external piping network has a delayed effect that is best described as seasonal. The occupant-dependent DHW preparation and internal heat gains have strong diurnal patterns and a seasonal pattern. Solar heat gains are most instantaneously correlated to the solar irradiance, but there are some delayed effects due to heat stored on the interior surface layers and heat conducted through the envelope. Also, solar irradiance has both seasonal and diurnal patterns. The calibration procedure can be seen as pattern matching. The data carries information about the abovementioned patterns, but the prior model needs to be relatively informative to enable separation of the various effects into specific heat flows.
The parameters of the prior model are set as independent, i.e., specified without any correlation. Specifying a correlation structure for a prior model with nonnormal parameters is a complex task, and as long the likelihood is sufficiently rich, there is no need to specify correlations. As seen in
Figure 10, the correlation structure is identified in the posterior HMC sampled parameters. However, if the prior model is to be used by itself, the assumption of independent parameters might result in overly optimistic uncertainty intervals, summing independent parameters results in a tighter uncertainty interval than summing correlated parameters. The total heat transfer coefficient,
is a weighted sum of seven parameters that we expect to correlate and is therefore more sensitive for such an effect.
Kristensen et al. [
2] used hierarchical modeling to pool information between energy models through the likelihood function. Such an approach could also be used with our proposed models, thus allowing energy models of buildings that lack measurement data to be informed by data from other buildings that can be reliably measured.
5.2. Bayesian Filtering with Time-Varying Uncertainty on Inputs
We propose an augmented stochastic state-space model and iterated extended Kalman filtering. Both Kim and Park [
19] and Coffman and Barooah [
9] proposed using augmented state-space modeling to identify non-measured process disturbance. They use one augmented state to model the non-measured process disturbance and to identify it as part of the estimation procedure. We propose four augmented states to enable definition of predetermined time-varying uncertainty separately for major uncertainty sources. The increased number of disturbance states does not necessarily provide increased prediction power. Rather, the main motivation is that it is conceptually more appealing and more natural to incorporate prior knowledge when these sources of uncertainty are kept separate. The augmentation allows incorporation of prior knowledge, such as solar heat gains, which are highly uncertain during day time but certainly zero during night time or that DHW use is often close to zero (but has right-skewed outliers) at night. Another effect of using uncertain inputs is that parameters are learned with more weight during periods of low uncertainty in the inputs (e.g., night time) than during periods of high uncertainty (e.g., when occupant activity peaks and high insolation is plausible).
The DHW is modeled as log-normally distributed while the other inputs are modeled as normal distributions. The log-normal distribution has a multiplicative uncertainty, i.e., right-tailed and always positive, which describes the nature of uncertain energy flows very well. Modelling the other augmented states as log-normal was also considered, but a normal scale was chosen for its conceptual simplicity and computational efficiency. DHW can be modeled as nonnormal with relatively simple alteration of the measurement function h, while the other uncertain inputs are connected to the thermal network and thus require a nonlinear state transition function f (discarding the benefits of computationally fast linear algebra). The more apartments that are served by a DH substation, the better a normal distribution approximates the occupant-dependent inputs (an effect known as the central limit theorem). Thus, single family and smaller multifamily buildings benefit more from nonlinear modeling and/or actual measurements on the inputs.
5.3. Data Availability
The results of
Section 4.2.3 show that DHW inputs based on on-site measurements are substantially more informative than modeled inputs. In practice, measurement-based input data are frequently not available. We have shown that reference metering from similar buildings can substitute measured data. Such reference metering will be noisy on a hourly time-scale but captures the general correlations to weather and time and possibly to other aspects such as demographics. In our case study, we had access to reference metering for DHW and indoor air temperatures for the exact same period as used for the training but not for the domestic household electricity. The matching method described in
Section 3.4 was used for internal heat gains; this is a relatively simple modeling approach compared with existing bottom-up based approaches in the literature [
16,
36,
37]. Using a modeling approach for all the inputs would also enable calibration when measurements are lacking and for out-of-sample predictions with, e.g., forecast or normal year weather data.
A few weeks of data during the heating season is enough to identify the main parameters describing thermal behavior. However, different weather conditions contain different types of information, and using a longer period of data is beneficial for learning more aspects of the model/building. For example, heat-use data during the summer holds information about DHW use and heat losses due to DHW circulation. If there exist indoor air temperature measurements, the summer season captures information about the insulation and thermal heat capacity (which is difficult to identify during the heating season for buildings that hold the set-point temperature well). Our method of using different time periods for training has the advantage of learning different aspects about the buildings in a computationally efficient way and allows skipping of periods with faulty or missing data.
5.4. Energy Modeling
In this paper, we have presented one energy model that we anticipate as general and accurate enough to sufficiently approximate a large proportion of the targeted Swedish district-heated multifamily buildings. However, there are also buildings within this category that would not be well approximated by the current model, for example, buildings with exhaust air heat pumps, thermal solar panels, active thermal storage, or advanced control strategies. The generality of the model applied to various building types requires further development work.
Model selection is a frequently advocated approach, for example, by Bacher and Madsen [
8], Raillon and Ghiaus [
10], Rouchier [
43]. The strongly regulating prior used for the air infiltration parameter
can be viewed as model selection. In the case study, there is very little evidence of air infiltration in the data (the buildings are well sheltered and located in an inland region of generally low wind exposure), and the posterior distribution of
keeps close to the specified prior. However, the used exponentially modified Gaussian prior distribution would allow for higher
values in case of strong enough evidence in the data.
In the case study, the internal mass element (modeling internal walls and the intermediate floors) accounts for some 79% of the total thermal mass. Similar shares would be expected for other Swedish multifamily buildings. Thus, this element is important for the thermal charging–de-charging pattern, which is essential for predicting heat demand flexibility [
20] and thermal comfort assessments. The internal mass is modeled with a two-node element [
4], its thermal resistance is set to 1
/W, and the thermal mass is split equally between surface and inside nodes. This part of the thermal network is likely to benefit from more detailed investigation and validation to ensure realistic thermal mass behavior.
6. Conclusions
Reliable energy models are needed to determine building energy performance. Relatively detailed energy models can be auto-generated based on 3D shape representations of existing buildings. However, parameters describing the dynamic thermal behavior of buildings are seldom available in digitized form and these parameters have to be estimated. This paper presents a Bayesian calibration framework and qualitatively evaluates results produced from a case study.
The proposed energy model is detailed, and identifying the full set of parameters with only likelihood function is not feasible. An informative prior model is needed to constrain the parameter space to ensure identifiability. The Bayesian calibration approach enables incorporation of such regulating information in a formal way. A benefit of the relatively detailed model specification is that it allows incorporation of prior knowledge on a level at which such information tends to exist, e.g., thermal transmittance per building element type rather than total heat loss. An informative prior model also allows meaningful inference in cases where there is no measurement data to calibrate with.
The results of the Gaussian approximation approach of the penalized MLE match well with the result of the HMC sampling. The MLE was on the order of 100 times faster than HMC sampling. For applications where short computation time is essential, penalized MLE is adequate. The MLE parameter estimation, in the case study, took approximately a half minute to compute on a standard laptop computer (much thanks to the automatic differentiation and fast linear algebra enabled by Stan).
DHW use is a major source of uncertainty for the targeted district-heated multifamily buildings. Incorporating hourly billing metering for domestic cold water substantially decreases this uncertainty. The benefit would be even greater for buildings with fewer apartments than our case study with 59 apartments.
The proposed state augmentation enables a probabilistic approach for handling uncertain input data, which allows more prior knowledge to be incorporated. We provide uncertainty models for these inputs that can be utilized for both model- and measurement-based inputs.
A limitation of using measurement-based inputs is that these cannot be applied in cases lacking data or for out-of-sample predictions. A seamless utilization of both measurement-based and model-based inputs is needed to achieve a framework that can learn from all available data while still result in decent enough results in situations of less or no data availability. We also anticipate that a hierarchical modeling approach can be used to pool information between models, thus allowing energy model of buildings that lack measurement data to be informed from other building that do have reliable measurements.