GAMS code for Data Envelopment Analysis

Chapter 4 (Fig. 4.09) – The mathematical formulation of the dual RAM model

$Title Chapter 4 (Fig. 4.9)
$Title Mathematical formulation of the dual RAM model 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 /ProdCost, TrnCost, HoldInv, SatDem, Rev/
        i(g)  Inputs /ProdCost, TrnCost, HoldInv/
        r(g) Outputs /SatDem, Rev/;
        alias(jj,j);
        alias(k,jj);

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

           ProdCost     TrnCost      HoldInv     SatDem      Rev
DMU1        0.255        0.161        0.373        20        2.64
DMU2        0.98         0.248        0.606        6         5.29
DMU3        0.507        0.937        0.749        17        2.43
DMU4        0.305        0.249        0.841        2         8.99
DMU5        0.659        0.248        0.979        19        2.94
DMU6        0.568        0.508        0.919        17        0.75
DMU7        0.583        0.628        0.732        17        6.36
DMU8        0.627        0.675        0.738        10        7.2
DMU9        0.772        0.657        0.486        9         2.16
DMU10       0.917        0.639        0.234        8         7.3;


Variables efficiency objective function for RAM model
          v(i) input dual
          mu(r) output dual
          u0 constraint dual;

Nonnegative variables
          v(i) input dual
          mu(r) output dual;

Parameters DMU_data(g) slice of data
           eff(j) optimal values objective function
           Rminus(i) range for inputs i
           Rplus(r) range for outputs r
           m cardinal of set of inputs
           s cardinal of set of outputs
           res_v(j,i) results of v(i)
           res_mu(j,r) results of mu(r);

Rminus(i)=smax(j,Data(j,i))- smin(j,Data(j,i));
Rplus(r)=smax(j,Data(j,r))- smin(j,Data(j,r));

m=CARD(i);
s=CARD(r);



Equations OBJ objective function
          CON1(j)
          CON2(i) upper bound for input dual
          CON3(r) upper bound for output dual;


OBJ..       efficiency=E=SUM(i,v(i)*DMU_data(i))-SUM(r,mu(r)*DMU_data(r))-u0;

CON1(j)..  SUM(i,v(i)*Data(j,i))-SUM(r,mu(r)*Data(j,r))-u0=G=0;

CON2(i)..  v(i)=G=1/Rminus(i);

CON3(r)..  mu(r)=G=1/Rplus(r);


model Dual_RAM Dual Range Adjusted Measure model
         / OBJ, CON1, CON2, CON3/;

loop(jj,
   DMU_data(g) = Data(jj,g);
   solve Dual_RAM using LP minimizing efficiency;
   eff(jj)=1-efficiency.l;
   res_v(jj,i)=v.l(i);
   res_mu(jj,r)=mu.l(r);
   );

Display res_v, res_mu, eff
Execute_unload