  In this paper, we propose a practical Bayesian framework for the calibration
and validation of a computer code, and apply it to a case study concerning the
energy consumption forecasting of a building. Validation allows to quantify
forecasting uncertainties in view of the code's final use. Here we explore the
situation where an energy provider promotes new energy contracts for
residential buildings, tailored to each customer's needs, and including a
guarantee of energy performance.
  Based on power field measurements, collected from an experimental building
cell over a certain time period, the code is calibrated, effectively reducing
the epistemic uncertainty affecting some code parameters (here albedo, thermal
bridge factor and convective coefficient). Validation is conducted by testing
the goodness of fit of the code with respect to field measures, and then by
propagating the a posteriori parametric uncertainty through the code, yielding
probabilistic forecasts of the average electric power delivered inside the cell
over a given time period.
  To illustrate the benefits of the proposed Bayesian validation framework, we
address the decision problem for an energy supplier offering a new type of
contract, wherein the customer pays a fixed fee chosen in advance, based on an
overall energy consumption forecast. According to Bayesian decision theory, we
show how to choose such a fee optimally from the point of view of the supplier,
in order to balance short-terms benefits with customer loyalty.
