Lab / 01 · Working
DEA Efficiency Explorer
Data Envelopment Analysis compares units that turn several inputs into several outputs. It finds the best-practice frontier, scores every unit against it and shows what an inefficient unit would need to change.
The sample datasets are synthetic. They are not data or results from my own research.
Read the case study: From Research to Software03 Results
- Efficient
- 1/12
- Weakly efficient
- 0
- Mean efficiency
- 0.766
- Lowest
- 0.571
- CCR frontier
- BCC frontier
- Efficient
- Inefficient
- Target on the frontier
Unit detail
Clinic C
0.571 efficiency
θ = 0.571: all inputs could shrink to 57.1% while keeping outputs.
Reference set (λ)
- Clinic Bλ = 0.585
| Actual | Slack | Target | Change |
|---|---|---|---|
| Staff hours / week | |||
| 209 | 0 | 119.4 | -42.9% |
| Patients treated / week | |||
| 326 | 0 | 326 | 0 |
Efficiency ranking
Times used as a reference
Results
| Unit | Efficiency | θ / η | Status | Reference set (λ) |
|---|---|---|---|---|
| 0.571 | 0.571 | Inefficient | Clinic B (0.585) | |
| 0.584 | 0.584 | Inefficient | Clinic B (0.928) | |
| 0.642 | 0.642 | Inefficient | Clinic B (0.853) | |
| 0.685 | 0.685 | Inefficient | Clinic B (0.745) | |
| 0.753 | 0.753 | Inefficient | Clinic B (1.034) | |
| 0.778 | 0.778 | Inefficient | Clinic B (0.366) | |
| 0.785 | 0.785 | Inefficient | Clinic B (1.224) | |
| 0.787 | 0.787 | Inefficient | Clinic B (1.555) | |
| 0.798 | 0.798 | Inefficient | Clinic B (0.939) | |
| 0.849 | 0.849 | Inefficient | Clinic B (1.522) | |
| 0.954 | 0.954 | Inefficient | Clinic B (1.151) | |
| 1 | 1 | Efficient | — |
The models
Each unit gets its own linear programme. The explorer solves the envelopment form in two stages: first the radial score, then the largest possible slacks with that score fixed.
CCR, input-oriented
min θ
Σj λj xij ≤ θ xio (i = 1…m)
Σj λj yrj ≥ yro (r = 1…s)
λj ≥ 0
CCR, output-oriented
max η
Σj λj xij ≤ xio
Σj λj yrj ≥ η yro
λj ≥ 0 · E = 1/η
BCC adds the convexity constraint
Σj λj = 1
Stage 2 (slacks)
max Σi s−i/x̄i + Σr s+r/ȳr
Σ λjxij + s−i = θ* xio, Σ λjyrj − s+r = yro
Targets and improvement
x̂i = θ* xio − s−i
ŷr = yro + s+r
Δ% = (target − actual) / actual × 100
Assumptions
- Inputs must be strictly positive; outputs must be non-negative, with at least one positive output per unit.
- Units are comparable: same kind of activity, same variable definitions.
- DEA scores are relative — they compare units with each other, not with an absolute standard.
- CCR assumes constant returns to scale; BCC allows variable returns and separates scale effects.
- Rule of thumb: at least max(m·s, 3(m + s)) units for m inputs and s outputs.
Solver and accuracy
A dense two-phase simplex written in TypeScript runs in a Web Worker. Every row is scaled by its variable mean; slacks are weighted by 1/mean so results do not depend on units. Scores are tested against SciPy’s HiGHS solver (an independent implementation) to 1e-6 and against analytic results.
Tolerances: score = 1 if abs(score − 1) ≤ 1e-7; a slack counts if slack / mean > 1e-7; a unit is a peer if λ > 1e-7.
Scores are unique. λ values and slacks can have alternative optimal solutions; the explorer reports one maximal-slack solution.
Chance-constrained DEA will be added in a later phase, after a review of the mathematics in my article and thesis.