# Economies of Scale and Efficiency in the Wastewater Treatment Sector: A Decision Tree Approach
## 2 Materials and Methods  
The term \"efficiency\" generally refers to the optimal utilization of production factors within a production process, based on current technology. [PERSON] pioneered the study of frontier functions [36], which are used as benchmarks to assess efficiency for each productive unit. [PERSON]'s model establishes a benchmark or frontier of best practices that comprises the most efficient units within a given sample. Consequently, if a firm maximizes output for a specified input vector or minimizes inputs to achieve a certain output, it is considered to be on the \"production frontier\". In such cases, a firm's technical efficiency is determined by calculating the maximum possible proportional reduction in factor usage that remains compatible with its level of output. Efficiency assessments are widely applied across productive sectors [37], with two primary approaches to calculating efficiency: (i) the parametric approach, exemplified by stochastic frontier (SF) analysis [38], and (ii) the nonparametric approach, such as data envelopment analysis (DEA) [39]. SF methods distinguish inefficiency from heterogeneity in terms of costs [40] and are frequently applied in water sector studies [41,42]. DEA, however, is particularly suited for the study of wastewater treatment efficiency, as it benchmarks without assuming specific behaviors for treatment plants [43]. DEA, a linear programming technique, assesses efficiency by comparing sample units based on their respective inputs and outputs. The flexibility of DEA has fueled its use in benchmarking studies within the water sector, offering insight into scale economies and highlighting process improvements [44]. Some nonparametric approaches for estimating production frontiers rely on using envelopment techniques to assess the efficiency of decision-making units (see, e.g., [32,45,46]). These techniques model production frontiers by enveloping the observed data points, creating a benchmark that distinguishes efficient units from inefficient ones. However, a limitation of the DEA and FDH models is their tendency to produce estimated frontiers that lie below the actual or theoretical frontier, often resulting in an underestimation of technical inefficiency [47]. This limitation creates challenges in generating a generic model, as the DEA and FDH methods may perform well for specific datasets but fail to accurately represent broader patterns. This is similar to the contrast between descriptive statistics, which summarize specific data, and statistical inference, which seeks generalization. In statistical learning, generalization is critical: according to [PERSON] [48], a model that finds an appropriate balance between fitting the training data while remaining adaptable to new data achieves the best performance. This is especially relevant as operations research increasingly adopts data analytics and machine learning methods, where the issue of overfitting often arises. For instance, [PERSON] [49] developed the classification and regression trees (CART) method, which constructs decision trees by iteratively splitting nodes to increase predictive accuracy. While a deep tree can capture intricate patterns within the data, it risks overfitting, yielding overly optimistic estimates for the training set but lacking accuracy for new data. Conversely, a shallow tree may fail to capture important patterns, leading to poor model performance. To address these issues, [PERSON] [49] introduced a cost-complexity pruning technique, which refines the model by removing excess complexity based on cross-validation. This approach optimizes the tree's accuracy and enhances its ability to generalize by preventing overfitting. In this study, we employ a regression tree technique based on CART to estimate production frontiers that adhere to the free disposability property [50]. This method partitions the input space into terminal nodes through a series of binary splits, where each terminal node represents a constant predicted output.