Data Envelopment Analysis and SFA Guide: DEA, Malmquist, Python, and R

Empirical efficiency benchmarking often stumbles over scale assumptions, dimensional inflation, and invalid two-stage regressions. Here is how to select between DEA and SFA, run Tone SBM models, and implement Simar-Wilson bootstrap inference in Python and R.

HumanPen Team

· 14 min read

Data envelopment analysis and stochastic frontier analysis: selecting the right frontier model

Data Envelopment Analysis (DEA) and Stochastic Frontier Analysis (SFA) evaluate Decision-Making Unit (DMU) performance under fundamentally different assumptions: DEA is a non-parametric mathematical programming technique that envelops observed inputs and outputs without assuming a functional form, whereas SFA is a parametric econometric method that decomposes deviations into symmetric statistical noise and one-sided technical inefficiency. In empirical benchmarking across energy, healthcare, and public finance, selecting among Charnes, Cooper & Rhodes (1978) CCR (constant returns to scale), Banker, Charnes & Cooper (1984) BCC (variable returns to scale), and Tone (2001) Slacks-Based Measure (SBM) depends on scale flexibility and non-radial factor slacks. Furthermore, researchers must strictly respect sample-size dimensionality bounds to prevent artificial frontier clustering, replace invalid two-stage OLS or Tobit regressions with Simar & Wilson (2007) double-bootstrap truncated regression, and deploy SFA when measurement noise threatens deterministic frontier validity.

Operational benchmarking across hospitals, university departments, bank branches, and regional power grids frequently struggles with model misspecification. A common mistake is treating all frontier methods as interchangeable black boxes. When analysts indiscriminately apply radial CCR models to operations where scale is dictated by external regulation or geography, the resulting efficiency scores penalize viable institutions simply because they cannot adjust operational scale. Conversely, when researchers ignore non-radial input slacks or attempt to explain efficiency scores using naive censored regressions, peer reviewers rightfully question the validity of the reported rankings. Achieving publishable, reproducible efficiency benchmarks requires navigating the mathematical trade-offs between deterministic envelopment and stochastic error composition, ensuring that sample sizes satisfy dimensionality thresholds, and conducting rigorous second-stage econometric inference.

"In management contexts, mathematical programming is usually used to evaluate a collection of possible alternative courses of action en route to selecting one which is best. In this capacity, mathematical programming serves as a planning aid to management. Data Envelopment Analysis reverses this role and employs mathematical programming to obtain ex post facto evaluations of the relative efficiency of management accomplishments, however they may have been planned or executed." — Banker, Charnes & Cooper (1984, Management Science)

Comparing frontier models: CCR, BCC scale efficiency, and Tone non-radial SBM

The foundation of Data Envelopment Analysis rests on mathematical programming applied to N observed Decision-Making Units (DMUs), each utilizing m inputs x to produce s outputs y. In the seminal CCR formulation of Charnes, Cooper & Rhodes (1978), the production possibility set is constructed under Constant Returns to Scale (CRS). Under CRS, any proportional expansion of inputs yields an identical proportional expansion of outputs, measuring overall technical efficiency (θ_CCR). However, real-world organizations rarely operate at optimal scale due to financial constraints, imperfect competition, or regulatory mandates. To address this limitation, Rajiv D. Banker, Abraham Charnes, and William W. Cooper published the BCC model (1984, Management Science), introducing the convexity constraint sum(λ) = 1 to accommodate Variable Returns to Scale (VRS). It is critical to cite BCC accurately: Edwardo Rhodes co-authored the 1978 CCR paper, but was not an author of the 1984 BCC paper. Decomposing overall technical efficiency into pure technical efficiency (θ_BCC) and scale efficiency (SE = θ_CCR / θ_BCC <= 1) reveals whether managerial inefficiency stems from internal operational waste or sub-optimal operating scale.

Model NameFrontier FrameworkReturns to ScaleSlacks HandlingEfficiency RangeIdeal Empirical Application
CCR ModelNonparametric Radial DEAConstant Returns to Scale (CRS)Ignores input excesses and output shortfalls during radial scaling0 < θ <= 1Benchmarking homogeneous DMUs operating at optimal long-run scale
BCC ModelNonparametric Radial DEAVariable Returns to Scale (VRS)Imposes convexity constraint sum(λ) = 1, ignores non-radial slacks0 < θ <= 1Isolating pure technical efficiency from scale efficiency (SE)
SBM ModelNonparametric Non-Radial DEAFlexible (CRS, VRS, NIRS)Directly penalizes input excesses and output shortfalls via scalar ρ0 < ρ <= 1Eliminating radial projection bias when factor slacks are prevalent
Super-SBM ModelNonparametric Frontier RankingFlexible (CRS, VRS)Excludes target DMU from reference set to break frontier tiesδ >= 1 for efficient unitsRanking and discriminating among multiple fully efficient DMUs
SFA ModelParametric Econometric FrontierFlexible via functional form (Cobb-Douglas, Translog)Captured through composed error v - u via Maximum Likelihood Estimation0 < TE <= 1Separating true technical inefficiency from stochastic noise and measurement error

While radial CCR and BCC models represent the historical backbone of DEA, they suffer from a major mathematical limitation: they project DMUs toward the efficient frontier by proportionally contracting all inputs (or expanding all outputs), completely ignoring non-radial input excesses (s^-) and output shortfalls (s^+). As a consequence, a unit projected onto a weakly efficient boundary segment receives a misleading radial efficiency score of 1.000 despite substantial factor slacks. To resolve this slack-neglect issue, Kaoru Tone (2001, European Journal of Operational Research) developed the Slacks-Based Measure (SBM). The SBM framework directly penalizes all input and output slacks into a comprehensive, unit-invariant scalar ρ* in (0, 1], achieving ρ* = 1 if and only if all input and output slacks equal zero (strict Pareto-Koopmans efficiency). When evaluating top performers where multiple DMUs achieve perfect efficiency, Tone (2002) Super-SBM excludes the evaluated unit from its own reference set (setting λ_o = 0), yielding super-efficiency scores δ* >= 1 that allow unambiguous ranking. When curating empirical inputs and outputs from financial filings, combining these models with automated workflows such as ESG and annual report KPI extraction ensures raw operational disclosures translate directly into robust frontier metrics.

Sample size dimensionality bounds and Simar-Wilson bootstrap regression

A pervasive vulnerability in non-parametric frontier estimation is the curse of dimensionality. Because DEA solves an individualized linear program for every DMU without imposing a parameterized production function, adding more inputs m or outputs s expands the dimensionality of the frontier hyperplane. When the number of evaluation dimensions is large relative to sample size N, every DMU eventually finds a unique hyperplane facet where it dominates its peers, mechanically inflating the share of units rated at 1.000. To maintain empirical discrimination, analysts must respect established sample bounds: Cooper, Seiford & Tone (2007) and Banker et al. recommend that sample size satisfy N >= max{m × s, 3(m + s)}, whereas the stricter protocol established by Dyson et al. (2001 EJOR) mandates N >= 2 × m × s. Furthermore, researchers must heed Dyson et al.'s warnings against mixing ratio or percentage variables (such as profit margins or recovery rates) with raw volume variables under CRS, and avoid inputting negative values or undesirable outputs (such as industrial emissions or infection rates) into standard radial models without directional distance transformations or dedicated undesirable-output SBM formulations.

"Efficiency scores of production units are generally measured relative to an estimated production frontier. Nonparametric estimators (DEA, FDH, ⋯) are based on a finite sample of observed production units. The bootstrap is one easy way to analyze the sensitivity of efficiency scores relative to the sampling variations of the estimated frontier. The main point in order to validate the bootstrap is to define a reasonable data-generating process in this complex framework and to propose a reasonable estimator of it." — Simar & Wilson (1998, Management Science)

After calculating first-stage DEA scores, empirical researchers frequently attempt to explain efficiency differences across firms or regions by regressing the estimated scores on environmental covariates Z (such as market competition, regulatory stringency, or ownership structure). Historically, thousands of papers utilized ordinary least squares (OLS) or two-limit Tobit models, incorrectly assuming that scores bounded at 1.0 represent censored data. As proven by Léopold Simar and Paul W. Wilson (2007, Journal of Econometrics), this practice is statistically invalid: finite-sample DEA scores are inherently serially correlated because perturbing a single efficient DMU alters the estimated frontier and shifts the efficiency scores of all evaluated peers. Furthermore, efficiency scores cluster at 1.0 due to finite-sample boundary envelopment rather than true economic censoring. Standard OLS and Tobit standard errors are systematically biased and standard inference breaks down. To obtain valid hypothesis tests, researchers must adopt Simar & Wilson (2007) Algorithm #1 or Algorithm #2 double-bootstrap truncated regression (implemented via R's `rDEA::dea.env.robust`). When navigating differences across statistical environments, consulting guides on replicating SPSS and Stata analyses in Python and R ensures parameter defaults and degree-of-freedom corrections remain completely aligned.

Reproducible DEA, Malmquist, and SFA workflows via HumanPen Start Project

Executing modern frontier estimation with full reproducibility requires robust open-source tooling across R and Python. In R, `Benchmarking` (version 0.33) provides reliable implementations of standard radial DEA (`dea`), bootstrap bias correction (`dea.boot`), and Caves, Christensen & Diewert (1982) Malmquist productivity indices (`malmquist`). The Malmquist index decomposes total factor productivity changes between periods t and t + 1 into technical efficiency catch-up (EC) and frontier technology shifts (TC), evaluated under CRS output distance functions where values exceeding 1.0 designate productivity growth. For non-radial models, `deaR` (version 1.5.4) provides Tone's SBM (`model_sbmeff`) and Super-SBM (`model_supereff`), while `rDEA` (version 1.2-8) supplies Simar-Wilson bootstrap bias corrections (`dea.robust`) and double-bootstrap environmental regressions (`dea.env.robust`). In Python, `scipy.optimize.linprog` (SciPy version 1.18.1) running the HiGHS simplex and interior-point solver handles customized primal and dual envelopment programs, while `pyStoNED` (version 0.7.5) estimates Convex Nonparametric Least Squares (CNLS) and Stochastic Nonparametric Envelopment of Data (StoNED). Parametric Stochastic Frontier Analysis (SFA) via R's `frontier` (version 1.1-8) and `sfaR` (version 1.0.1) solves composed error models via Maximum Likelihood Estimation, estimating the variance parameter γ = σ_u^2 / (σ_v^2 + σ_u^2) to verify whether deviations stem from managerial inefficiency or statistical noise. Once raw microdata is prepared, workflows like turning raw CSV into data analysis reports and slides automate the generation of diagnostic tables and frontier figures.

  • Step 1: Input-output validation and sample screening: Audit the input-output matrix to confirm positivity and isotonicity, check sample bounds against N >= max{m × s, 3(m + s)}, and verify that ratio variables are separated from scale volume inputs.
  • Step 2: Linear programming envelopment and scale efficiency: Estimate CRS and VRS frontiers using R's `Benchmarking::dea` or Python's `scipy.optimize.linprog`, extracting radial efficiency θ, pure technical efficiency, and scale efficiency SE = θ_CCR / θ_BCC.
  • Step 3: Non-radial slack penalty and super-efficiency ranking: Run Tone's SBM via `deaR::model_sbmeff` to compute slack-adjusted efficiency ρ*, breaking ties among fully efficient units with Super-SBM (δ* >= 1) or evaluating dynamic shifts via `Benchmarking::malmquist` (EC × TC).
  • Step 4: Second-stage bootstrap truncated regression and SFA cross-check: Regress bias-corrected scores on environmental covariates Z using `rDEA::dea.env.robust` under Simar-Wilson Algorithm #2, and benchmark against parametric SFA via `sfaR::sfacross` to separate noise from inefficiency.

For research teams, doctoral scholars, and policy analysts navigating multi-period efficiency evaluations or complex microdata econometrics, executing reproducible benchmarking through HumanPen Start Project provides an end-to-end computational scaffold. Attach your data and papers, describe what you need, approve the plan before work starts, and get the reviewed report, charts, and code ready to preview online or download. Analyses originally conducted in proprietary software like commercial DEA suites or Stata SFA packages are systematically translated into open, reproducible Python or R pipelines. Requirements and mathematical specifications are confirmed before computational runs commence, and every delivery undergoes multi-layer review to verify model assumptions, solver convergence tolerances, and parameter mapping.

The execution environment operates within an isolated computing sandbox supporting file uploads up to 5 GB across Excel, CSV, Word, PDF, and zip archives. Benchmarking scripts run in dedicated CPU-based Python and R environments with full version history across project iterations. Proprietary data from sources like WRDS or Wind must be exported locally under the user's license before upload, with zero GPU training overhead. Project assets are protected via encrypted transit, strict per-project workspace isolation, 6-month retention following the latest activity with a 3-day reminder, and user-initiated permanent deletion at any moment.

Scholarly ethics and methodological transparency dictate that computational support serves strictly as an auditable reference foundation. Deliverables generated through reproducible frontier workflows provide researchers with annotated scripts, diagnostic logs, and verified estimation tables. The principal investigator, doctoral student, or quantitative economist remains entirely responsible for validating theoretical returns to scale, defending variable selection, and disclosing analytical methods in compliance with institutional and journal policies. We provide rigorous research scaffolds where authors verify and own every line of code and mathematical reasoning, without making ungrounded claims regarding publication acceptance, funding awards, or academic grading.

Frequently asked questions

Why does my BCC pure technical efficiency score equal 1.000 while my CCR overall efficiency score is only 0.750? This divergence occurs because the BCC model evaluates efficiency under Variable Returns to Scale (VRS) by imposing the convexity constraint sum(λ) = 1, which compares each DMU only against peers of similar operating size. The CCR model, by contrast, enforces Constant Returns to Scale (CRS), evaluating whether the unit is operating at optimal scale. When θ_BCC = 1.000 and θ_CCR = 0.750, your DMU has achieved perfect pure technical efficiency (there is no internal operational waste given its current scale), but suffers from scale inefficiency: Scale Efficiency SE = θ_CCR / θ_BCC = 0.750. By checking the sum of weights in an unconstrained CCR solution (or inspecting non-increasing returns to scale NIRS formulations), you can determine whether the unit suffers from increasing returns to scale (too small) or decreasing returns to scale (overly congested).

Why is second-stage Tobit regression invalid for DEA scores, and what does the Simar-Wilson bootstrap fix? In empirical literature, authors frequently observed that DEA scores are bounded between 0 and 1, mistakenly treating the cluster of scores at 1.0 as censored data and applying two-limit Tobit regression. However, Léopold Simar and Paul W. Wilson (2007) proved that this approach violates basic econometric assumptions: DEA scores do not suffer from true censoring; rather, the piling of scores at 1.0 is an artifact of estimating an unknown true boundary with a finite sample. More critically, estimated DEA scores are serially correlated because all DMUs are benchmarked against a shared, sample-dependent frontier (perturbing one frontier unit alters the scores of all peers). Consequently, Tobit standard errors are invalid. Simar & Wilson's double-bootstrap truncated regression solves this by constructing a coherent data-generating process, applying a smoothed bootstrap to correct finite-sample boundary bias, and estimating environmental effects through truncated regression with parametric bootstrap standard errors.

When should I choose Tone's Slacks-Based Measure (SBM) over standard radial CCR or BCC models? Standard radial DEA models assume that all inputs (or all outputs) can be contracted (or expanded) at the exact same proportional rate. When production processes exhibit structural rigidities, capital fixity, or non-radial factor substitution, a DMU may project onto a boundary where some inputs can be reduced further while others cannot. Radial models ignore these remaining input excesses (s^-) and output shortfalls (s^+), assigning a score of 1.000 to "weakly efficient" units. Tone's (2001) SBM should be preferred whenever inputs and outputs cannot realistically scale in fixed proportions, when resource waste is unevenly distributed across operational factors, or when strict Pareto-Koopmans efficiency is required. When working with environmental emissions, undesirable-output SBM formulations directly incorporate environmental damage without distorting economic outputs.

How do I decide between non-parametric DEA and parametric Stochastic Frontier Analysis (SFA)? The choice hinges on the trade-off between functional flexibility and measurement noise. DEA requires no assumptions about the functional form of production or the distribution of inefficiency, making it ideal for public-sector, healthcare, and educational contexts characterized by multiple inputs and multiple non-priced outputs. However, because DEA is deterministic, any measurement error, unobserved heterogeneity, or statistical outlier is conflated with inefficiency. SFA, as documented in the CRAN `frontier` package manual ("Maximum Likelihood Estimation of Stochastic Frontier Production and Cost Functions"), explicitly separates statistical noise (v ~ N(0, σ_v^2)) from technical inefficiency (u >= 0). SFA is ideal for single-output industries (such as agriculture, manufacturing, or commercial banking) where standard production functions (such as Translog or Cobb-Douglas) are well established and survey data contains inevitable measurement error.

Sources

KEEP READING