GAMS code for Data Envelopment Analysis

Chapter 5 (Fig. 5.01) – The mathematical formulation for Allocative and Cost Efficiency

$Title Chapter 5 (Fig. 5.1)
$Title Mathematical formulation for Allocative and Cost Efficiency and the corresponding GAMS code

$onText

If using this code, please cite:

---------------------------------------------------------------------------------
Emrouznejad, A., P. Petridis, and V. Charles (2023). Data Envelopment Analysis
with GAMS: A Handbook on Productivity Analysis, and Performance Measurement,
Springer, ISBN: 978-3-031-30700-3.
---------------------------------------------------------------------------------

Website: https://dataenvelopment.com/GAMS/

$offText

Sets    j DMUs /DMU1*DMU10/
        g Inputs and Outputs /Prodc, Trn, Inv, SatDem, Rev/
        i(g)  Inputs /Prodc, Trn, Inv/
        r(g) Outputs /SatDem, Rev/;
        alias(jj,j);
        alias(k,jj);

Table Data(j,g) Data for inputs and outputs

            Prodc     Trn      Inv        SatDem        Rev
DMU1        10        100       61           20          2.64
DMU2        52        125       100          6          5.29
DMU3        24         54       56           17         2.43
DMU4        45         91       14            2         8.99
DMU5        51         10       67           19         2.94
DMU6        52         26       56           17         0.75
DMU7        22         35       34           17         6.36
DMU8        91         56       101          10         7.2
DMU9        43         72       55            9         2.16
DMU10       34         39       16            8         7.3;


Table Cost(j,i) Cost Data for inputs

            Prodc         Trn          Inv
DMU1        0.255        0.161        0.373
DMU2        0.98         0.248        0.606
DMU3        0.507        0.937        0.749
DMU4        0.305        0.249        0.841
DMU5        0.659        0.248        0.979
DMU6        0.568        0.508        0.919
DMU7        0.583        0.628        0.732
DMU8        0.627        0.675        0.738
DMU9        0.772        0.657        0.486
DMU10       0.917        0.639        0.234;


Variables efficiency objective function
          cost_efficiency cost efficiency
          Theta     efficiency (Theta values);

Nonnegative variables
          l(j) dual weights (Lambda values)
          x_t(i) auxilliary variable for c*theta;

Parameters DMU_data(g) slice of data
           cst(i) slice of cost data
           eff(j) efficiency
           tech_eff(j) technical efficiency
           cost_eff(j) cost efficiency
           alloc_eff(j) allocative efficiency
           lamres(j,j) peers for each DMU;

Equations OBJ_INP objective function for input VRS model
          OBJ_COST objective function for cost efficiency model
          CON1_COST(i) inputs for cost efficiency model
          CON1_INP(i) input duals for input VRS model
          CON2_INP(r) output dual for input VRS model
          CON3 VRS orientation;

OBJ_INP..       efficiency=E=Theta;

CON1_INP(i)..  SUM(j, l(j)*Data(j,i))=L=Theta*DMU_data(i);

CON2_INP(r)..  SUM(j, l(j)*Data(j,r))=G=DMU_data(r);

CON3..         SUM(j, l(j))=E=1;

OBJ_COST..       cost_efficiency=E=SUM(i,cst(i)*x_t(i));

CON1_COST(i)..   SUM(j, l(j)*Data(j,i))=L=x_t(i);

model INPUT_DEA_VRS input oriented DEA CRS / OBJ_INP, CON1_INP, CON2_INP, CON3/;
model COST_DEA_VRS input oriented DEA CRS / OBJ_COST, CON1_COST, CON2_INP, CON3/;


loop(jj,
   DMU_data(g) = Data(jj,g);
   cst(i) = Cost(jj,i);
   solve INPUT_DEA_VRS using LP minimizing Theta;
   solve COST_DEA_VRS using LP minimizing cost_efficiency;
   cost_eff(jj) = SUM(i,cst(i)*x_t.l(i))/SUM(i,cst(i)*DMU_data(i));
   eff(jj)=Theta.l;
   tech_eff(jj)= eff(jj);
   alloc_eff(jj) = cost_eff(jj)/tech_eff(jj);
   loop(k,
      Lamres(jj,k)=l.l(k);
    );
);

display  eff, lamres, tech_eff, cost_eff, alloc_eff;

execute_unload