## 2 Materials and Methods  
### Method: The Directional Distance Function and the Bootstrap Resampling Technique  
Following [10; 28; 29] the Directional Distance Function allows to obtain efficiency scores solving a linear programming not so different from the scores obtained by the standard data envelopment analysis approach (DEA). The directional function is defined to simultaneously minimize and maximize respectively inputs and outputs. The definition of the direction function is the following:  
\[\overset{\rightarrow}{D}\left(\mathbf{x},\mathbf{y};-\mathbf{g}_{\mathbf{x}^{\prime}}\mathbf{g}_ {\mathbf{y}}\right)=\sup\left\{\beta:\left(\mathbf{x}-\beta\mathbf{g}_{\mathbf{x}^{\prime}} \mathbf{y}+\beta\mathbf{g}_{\mathbf{y}}\right)\in P\right\}\]  
The linear programming for the Directional Distance Function, when constant returns to scale (CRS) are assumed, is the following [28]:  
\[\begin{array}{l}\underset{\beta,\lambda}{max}\ \beta_{CRS}^{*}\\ \text{subject to}\\ \chi\lambda\leq\mathbf{x}_{\mathbf{o}}-\beta\mathbf{g}_{\mathbf{x}}\\ \gamma\lambda\geq\mathbf{y}_{\mathbf{o}}+\beta\mathbf{g}_{\mathbf{y}}\\ \lambda\geq\mathbf{0}\end{array} \tag{1}\]  
where \(\beta_{CRS}^{*}=0\), (i.e., a benchmark) represents the efficient observation, otherwise the score describes a situation of inefficiency. Indeed, increasing the efficiency scores (i.e., \(\beta_{CRS}^{*}>0\)), also inefficiency increases.  
The biggest advantage of the DDF is the possibility to consider different types of outputs: from the one hand, the observation can produce a good output (in our case the final energy saving), but from the other hand, for producing the retrofitting intervention, the observation releases also emissions of CO\({}_{2}\) (\(b\), bad or undesirable output). For this reason, the production possibility set has to be redefined in the following way:  
\[P=\left\{\left(\mathbf{x},\mathbf{y}^{d},\mathbf{y}^{u}\right)\left|\mathbf{x}\geq X\lambda, \mathbf{y}^{d}\leq\gamma\lambda,\mathbf{y}^{u}=\gamma\lambda,\lambda\geq 0\right\}\]Following [30], the undesirable outputs are weakly disposable and the efficiency scores represent the ability of the observation to reduce the bad output increasing the good one and taking inputs equal.  
As the production set has changed, also the previous linear program has to be updated as follows [28]:  
\[\begin{array}{l}\underset{\beta,\lambda}{max}\ \beta^{*}_{CRS}\\ \text{subject to}\\ \chi\lambda\leq\mathbf{\alpha_{x}}\\ Y^{d}\lambda\geq\mathbf{y^{d}_{o}}+\beta\mathbf{y^{d}_{o}}\\ Y^{u}\lambda\leq\mathbf{y^{u}_{o}}+\beta\mathbf{y^{u}_{o}}\\ \underset{\lambda\geq\mathbf{0}}{max}\{\mathbf{y^{u}_{i}}\}\geq\mathbf{y^{u}_{o}}+\beta \mathbf{y^{u}_{o}}\\ \end{array} \tag{2}\]  
Again, the optimal solution is \(\beta^{*}_{CRS}=0\) and otherwise the observation is inefficient (i.e., \(\beta^{*}_{CRS}>0\)) (Efficiency scores vary between 0 and 1. Values equal to 0 represent the efficient observation, Increasing the scores, also inefficiency increases). Further, from the technical point of view, ref [11] suggest that the DDF frontier has to satisfy some axioms (inactivity, compactness of production possibility set, free disposability of inputs, weak disposability of outputs, null-jointness, free disposability of good outputs) that in the environmental case are always satisfied.  
In addition, a resampling technique was applied to improve performance of non-parametric models and to obtain more robust efficiency scores [31; 32].  
The adopted resampling technique is the bootstrapping procedure that replicates n dataset starting from the initial sample. In the present paper, authors adopted the technique suggested by [33], applied until now in few studies [18; 34; 35].  
Finally, notice that all elaborations (i.e., descriptive statistics, Directional Distance Functions, and bootstrap routine) were computed with the R-software version 4.0.1 (June 2020).