Lindo Systems

! Computing efficiency of Decision Making Units (DMU), using
Directional Distance Function. Ref:
 Chambers, R., Y. Chung, and R. Fare (1996), "Benefit and Distance Functions",
 Journal of Economic Theory, vol. 70, pp. 407-419.
For each DMU, we are given:
   How much it used of each input,
   How much it delivered of each output.
All DMU's use the same types of inputs and 
deliver the same types of outputs.
A DMU i is efficient or undominated if there is no positively weighted
combination of other DMU's that 
  uses no more of every input, and
  delivers at least as much of every output.
A "Beta" score is computed for each DMU i which is 
  <= 0 if DMU i is efficient or undominated,
  > 0 if DMU i is inefficient or dominated.
! Keywords: Benchmarking, DDF, Directional Distance Function, DEA, Efficiency, 
           Pareto optimal;
SETS:
 DMU: LAMBDA;
 FACTOR;
 FACTIN( FACTOR);
 DXF( DMU, FACTOR):  F ! F( I, J) = Jth factor of DMU I;
         ; 
ENDSETS
DATA:
! Korean electrical utilities.  Taken from:
   Ray, S. (2012), "Data Envelopment Analysis: 
   Theory and Techniques for Economics and Operations Research",
   Cambridge University Press;
! DMU = U01 U06 U07 U11 U12 U25 U30; ! Decision Making Units;
! FACTOR= CAPITAL  LABOR    FUEL   OUTPUT;
!     F =  706.698 643.389 648.946 614.661! U01;
!         1027.92  527.72  448.10  404.99 ! U06;
!         2055.85 1048.22 2136.09 2276.89 ! U07;
!          51.396 101.207  91.632  73.405 ! U11;
!         51.3962 93.9782 91.9232 73.8759 ! U12;
!         906.033 780.742 554.623 673.120 ! U25;
!        2569.81 1763.90 3352.76  3528.04;! U30;
! FACTIN = CAPITAL LABOR FUEL;  ! Input factors;
! LOSCALE = 0;    ! Any bounds on SCALE;
! HISCALE = 99999;

! Airline data;
!  Taken from: Coelli, T., E. Griffel Tatje, and S. Perelman (2002),
 "Capacity Utilization and Profitability: A Decomposition of Short-run Profit Efficiencey",
 International Journal of Production Economics, vol. 79, pp. 261-278;
! Decision Making Units;
! DMU = NIPPON CATHAY JAL QANTAS SAUDIA SINGAPORE AUSTRIA BRITISH FINNAIR LUFTHANSA AMERICAN DELTA UNITED;
! FACTOR= PASS CARGO  LAB   FUEL  MATL    CAP;
! FACTIN= LAB FUEL MATL CAP; ! Input factors;
!  F=   35261   614  12222   860  2008   6074 ! NIPPON;
!       23388  1580  12214   456  1492   4174 ! CATHAY;
!       57290  3781  21430  1351  2536  17932 ! JAL;
!       28991  1330  17997   393  1474   4784 ! QANTAS;
!       18969   760  24708   235   806   6819 ! SAUDIA;
!       32404  1902  10864   523  1512   4479 ! SINGAPORT;
!        2943    65   4067    62   241    587 ! AUSTRIA;
!       67364  2618  51802  1294  4276  12161 ! BRITISH;
!        9925   157   8630   185   303   1482 ! FINNAIR;
!       50989  5346  45514  1078  3314   9004 ! LUFTHANSA;
!      133796  1838  80627  2381  5149  18624 ! AMERICAN;
!       96540  1300  61675  1997  3972  14063 ! DELTA;
!      131905  2326  73902  2246  5678  18204;! UNITED;
! LOSCALE = 0;    ! Any bounds on SCALE;
! HISCALE = 9999;

! School data;
  DMU = BL HW NT OP YK EL;  ! The schools;
! Inputs are spending/pupil, % not low income;
! Outputs are Writing score and Science score;
 FACTOR= COST RICH      WRIT  SCIN;
 FACTIN = COST RICH; ! Input factors;
!      The inputs,    the outputs;
  F  =  89.39  64.3     25.2   223  ! BL;
        86.25  99       28.2   287  ! HW;
       108.13  99.6     29.4   317  ! NT;
       106.38  96       26.4   291  ! OP;
        62.40  96.2     27.2   295  ! YK;
        47.19  79.9     25.5   222; ! EL;
 LOSCALE = 0;    ! Any bounds on SCALE;
 HISCALE = 9999;

! Two DMU equivalent except for scale;
!   DMU = DMU1 DMU2;
!   FACTOR = INPUT1 OUTPUT1;
!   FACTIN = INPUT1;
!   F =        1      1 ! DMU1;
!              9      9;! DMU2;
! LOSCALE = 1;    ! Any bounds on SCALE;
! HISCALE = 1;
! If we restrict SCALE = 1, then DMU1 is declared substantially more efficient;
! If we do not restrict SCALE, then DMU1 and DMU2 are
 declared equally efficient;

ENDDATA
SUBMODEL DDF:
  @FREE( BETA);
  MAX = BETA;
! If there is no BETA >= 0 that satisfies both the input and output
set of constraints, it means that DMU ICHK is undominated. We could 
not find any positively weighted combination of the other DMU's
that produced more of each output, and used less of each input;
! For the output measures;
  @FOR( FACTOR(j) | #NOT# @IN( FACTIN, j):
    @SUM( DMU( i) | i #NE# ICHK: LAMBDA(i)*F(i,j)) >= (1+BETA)*F(ICHK,j)
      );
! For the input measures;
  @FOR( FACTIN(j):
    @SUM( DMU( i) | i #NE# ICHK: LAMBDA(i)*F(i,j)) <= (1-BETA)*F(ICHK,j)
      );
 @SUM( DMU(i) | i #NE# ICHK: LAMBDA(i)) = SCALE;
! Some formulations require SCALE = 1 ...;
 @BND( LOSCALE, SCALE, HISCALE);
! but this can be misleading if there are two DMU identical
  except for scale;
ENDSUBMODEL

CALC: 
   @SET( 'TERSEO', 2);  !Minimal output;
   !Write out a solution report;
   @WRITE( @NEWLINE( 2),'        DMU     Beta   Efficiency   Scale', @NEWLINE(1));

! Solve the DEA model for each DMU D;
   @FOR( DMU( D): 
      ICHK = D;
      @SOLVE( DDF);  ! Solve the model above;
      @WRITE( ' ', @FORMAT( DMU( D),'10s'), '   ', @FORMAT( BETA, '6.3f'),
        '    ',@FORMAT(1-BETA,'9.5f'),'  ', @FORMAT(SCALE,'6.4f'), @NEWLINE(1)); 
        );

ENDCALC