Vous êtes sur la page 1sur 11

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/327142221

DATA ENVELOPMENT ANALYSIS: MATLAB, GAMS and PYTHON

Technical Report · August 2018

CITATIONS READS
0 749

1 author:

Luis ernesto Torres


Universidade Federal Fluminense
8 PUBLICATIONS   2 CITATIONS   

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

data envelopment analysis - dea View project

All content following this page was uploaded by Luis ernesto Torres on 06 September 2018.

The user has requested enhancement of the downloaded file.


Working Paper Aug. 2018

DATA ENVELOPMENT ANALYSIS: MATLAB, GAMS and PYTHON

Luis Ernesto Torres Guardia

Departamento de Engenharia de Produção

Universidade Federal Fluminense, Niterói, RJ.-Brasil

tepletg@vm.uff.br

Abstract

The objective of this paper is to present some software packages, MATLAB, GAMS
and PYTHON, to solve conventional Data Envelopment Analysis (DEA) models and super-
efficiency analysis, measuring the efficiency of each Decision Making Units (DMUs) of the
corresponding model. It is reported a numerical experience with an example taken from DEA
literature: 20 decision making units with four inputs and three outputs.

Keywords: Data envelopment analysis, technical efficiency, numerical software packages.

1 INTRODUCTION

Data Envelopment Analysis (DEA) have been established as an useful method for
estimating the relative efficiency of a set of homogeneous decision making units (DMUs)
with multiple inputs and multiple outputs. The discussion of DEA models presented here is
brief, with relatively little technical detail. Its theories and applications can be found in
various books and survey like Cooper at al. [2007], Cheng [2014].

The basic DEA model may be rewritten, from a fractional program, into an equivalent
linear optimization problem, was initially introduced by Charnes, Cooper and Rhodes [1978],
known as the so-called CCR model.

There are several software packages to find the solution of the linear optimization
problem associated of the Data Envelopment Analysis model. This work presents the
numerical solutions of DEA models using MATLAB, GAMS and PYTHON software
packages. MATLAB (MATrix LABoratory), developed in late 1970 for numerical computing
environment. The GAMS (General Algebraic Modeling System) software is a high-level
modeling system for mathematical optimization and optimization and initially in 1978 was
presented for solving linear optimization. Python was first released in 1991 and it is for
general-purpose programming. The corresponding linear optimization problem is solved, in
all DEA models, using the linprog command in MATLAB version (2014a) and PYTHON
version (3.6). In GAMS version (2014), it is used the CPLEX version.

The GAMS software packages have been utilized by Kalvelagem [2004] to provide
some DEA models implementations. Álvarez et al. [2016] presented the implementations o
1
DEA models using MATLAB. In this study it is implemented some DEA models using the
MATLAB and GAMS and including PYTHON software packages.

The remainder of this paper is organized as follows. Section 2 introduces the classical
DEA model denominated CCR with an example that is use in the rest of this work. Section 3
presents the other basic DEA model called BCC. In Section 4 includes other DEA model to
handle the measure of efficiency, say super-efficiency. In each of the sections mentioned
above, visualizations of the results are created to understand better the dataset. Finally, in
section 5 it involves the software implementations and future work.

2. CCR MODELS
The one of the most basic DEA models was initially proposed by Charnes, et al. [1978]
known as the CCR model. Let us xik the input i of DMUk and yrj the output r of DMUj. The
CCR model is given by the following equivalent primal linear programming to express the
input-oriented DEA, also called the multiplier model:

q
(1) max 
r 1
ur yrk

m
subject to: 
i 1
vi xik = 1,

q m


r 1
ur yrj - 
i 1
vi xij ≤ 0,

ur ≥ 0, vi ≥ 0, r = 1,...,q; i = 1,....,m; j =1,2,...,n.

where:

- vi is the weights to be determined for input i,


- ur is the weights to be determined for ouput r,
- m is the number of inputs,
- q is the number of outputs,
- n is the number of entities,
- hk is the relative efficiency of a Decision Making Unit (DMUk) under study.

In practice from a computational point of view, it is often solved the dual problem for
the linear optimization problem (1), also referred to as the envelopment model, which is given
by:

(2) min Ɵ

n
subject to: j 1
λj yrj ≥ yrk,

n
Ɵ xik - 
j 1
λj xij ≥ 0,

2
λj ≥ 0, j = 1,2,...,n; i = 1,2,...,m; r = 1,2,...,q,

λj ≥ 0, j = 1,2,...,n; i = 1,2,m; r =1,2,...,q,

where λj is the weights of the DMUj.

The concepts of DEA model are illustrated on the numerical example taken from the
article developed by Martic, et al. [2009]. The example considers 20 decision making units
with four inputs and three outputs. The input and output data of the DEA example are given in
the following table 1.

Table 1. Data of the DEA model

in1 in2 in3 in4 ou1 ou2 ou3


dmu1 250 60 50 30 200 100 90
dmu2 1500 400 150 125 600 250 60
dmu3 800 350 300 85 600 450 40
dmu4 500 150 200 75 500 360 60
dmu5 200 100 120 60 330 250 50
dmu6 600 100 50 35 180 75 80
dmu7 1500 500 90 40 500 200 100
dmu8 1000 360 300 90 750 500 65
dmu9 530 120 100 60 350 180 50
dmu10 300 45 80 50 440 230 80
dmu11 700 160 60 30 300 130 100
dmu12 500 200 50 20 200 80 85
dmu13 200 30 50 40 160 90 100
dmu14 100 50 20 15 125 50 80
dmu15 800 180 200 100 700 400 90
dmu16 1200 300 250 115 750 400 55
dmu17 250 100 20 25 180 70 100
dmu18 400 80 30 10 130 60 90
dmu19 1000 250 130 100 600 270 95
dmu20 300 75 60 45 225 100 40

According to the DMUs’ efficiency scores, DEA classifies the DMUs into two diverse
efficient and inefficient groups. The DMUk is considered as relative efficient if the virtual unit
is Ɵk* = 1, where Ɵk* is denominated the optimal solution of the objective function of model
(2) . Otherwise the DMUk is not efficient and Ɵk* < 1.

The results for the data given in table 1, for Ɵk* of the model in (2) is given below,
using MATLAB, GAMS and PYTHON. For this and the following DEA models, the
computational time is negligible.

3
Table 2. DEA: CCR-IO-DUAL

DMU MATLAB GAMS PYTHON


1 0.8817 0.882 0.881693989071
2 0.5906 0.591 0.590588235294
3 1.0000 1.000 1.0
4 1.0000 1.000 1.0
5 1.0000 1.000 1.0
6 0.5991 0.599 0.599131130179
7 1.0000 1.000 1.0
8 1.0000 1.000 1.0
9 0.6440 0.644 0.644
10 1.0000 1.000 1.0
11 0.9552 0.955 0.955181547798
12 0.8971 0.897 0.89709762533
13 1.0000 1.000 1.0
14 1.0000 1.000 1.0
15 0.8268 0.827 0.82682753726
16 0.7104 0.710 0.710397766923
17 1.0000 1.000 1.0
18 1.0000 1.000 1.0
19 0.7251 0.725 0.725130806022
20 0.6239 0.624 0.623931623932

It can gain some insights into the results obtained in table 2 above. That is, creating
visualizations really helps make things clearer and easier to understand any datasets. It can be
done using the function matplotlib with PYTHON or the bar chart with MATLAB. The
results of the DEA-CCR model given in (2) can be visualized in the following figure 1:

4
3. BCC MODELS

The first extension of basic CCR Model is called the DEA-BCC model developed by
Banker et al. [1984] and is given by the following linear programming:

(3) min Ɵ

n
subject to: Ɵ xik - j 1
λj xij ≥ 0,

n
- yrk + 
j 1
λj yrj≥ 0,


j 1
λj = 1,

λj ≥ 0, i = 1,2,...,m; r = 1,2,...,q; j = 1,2,...,n.

The result for determining the optimal value Ɵ using model 3 for each DMUk is given
below, in table 3.

5
Table 3. DEA: BCC-IO-DUAL

DMU MATLAB GAMS PYTHON


1 0.9603 0.960 0.960306807287
2 0.8667 0.867 0.866666666667
3 1.0000 1.000 1.0
4 1.0000 1.000 1.0
5 1.0000 1.000 1.0
6 0.5994 0.599 0.599131130179
7 1.0000 1.000 1.0
8 1.0000 1.000 1.0
9 0.6470 0.647 0.646974063401
10 1.0000 1.000 1.0
11 1.0000 1.000 1.0
12 0.8991 0.899 0.899127061106
13 1.0000 1.000 1.0
14 1.0000 1.000 1.0
15 1.0000 1.000 1.0
16 1.0000 1.000 1.0
17 1.0000 1.000 1.0
18 1.0000 1.000 1.0
19 1.0000 1.000 1.0
20 0.6497 0.650 0.649710504549

The result obtained in table 3 is visualized in the following Figure 2.

6
4. SUPER- EFFICIENCY

The first super- efficiency DEA model was formulated by Andersen and Petersen
[1993] and called by AP model. Andersen and Petersen suggested modifying the LP
formulation for CCR in order to remove the corresponding column of the DMU under
evaluation from the coefficient matrix. This new procedure is to rank efficient DMUs.
However, the AP model may result in infeasibility and instability when certain zero patterns
appear in the data domain. There are several methods for ranking of the extreme efficient
DMU, see Jablonsky [2016]. Here, the AP model is presented and given below:

(4) min Ɵ

n
subject to: Ɵ xik -  j 1
λj xij ≥ 0, j≠k

n
- yrk + j 1
λj yrj≥ 0, j≠k

λj ≥ 0, j≠k i = 1,2,...,m; r = 1,2,...,q; j = 1,2,...,n.

The result using the super-efficiency Andersen and Petersen method is given below
where the rank efficient is represented in column AP.

7
DEA: ANDERSEN AND PETERSEN

DMU MATLAB GAMS PYTHON AP


1 0.8817 0.882 0.881693989071 -
2 0.5906 0.591 0.590588235294 -
3 1.0052 1.005 1.00521221147 10
4 1.0102 1.010 1.01024695909 9
5 1.6304 1.630 1.63043478261 5
6 0.5991 0.599 0.599131130179 -
7 1.1340 1.134 1.13402061856 7
8 1.0642 1.064 1.06422244094 8
9 0.6440 0.644 0.644 -
10 1.9871 1.987 1.98709677419 1
11 0.9552 0.955 0.955181547798 -
12 0.8971 0.897 0.89709762533 -
13 1.8902 1.890 1.89024390244 2
14 1.7778 1.778 1.77777777778 3
15 0.8268 0.827 0.82682753726 -
16 0.7104 0.710 0.710397766923 -
17 1.4400 1.440 1.44 6
18 1.7442 1.744 1.74418604651 4
19 0.7251 0.725 0.725130806022 -
20 0.6239 0.624 0.623931623932 -

The result of the super-efficiency A-P is visualized in Figure 3.

8
5. CONCLUSIONS

In this paper some basic DEA models were presented, mainly CCR and BCC models
and the traditional super-efficiency Andersen and Petersen model. Those models were solved
using MATLAB, GAMS and PYTHON software packages and the results are visualized in
bar chart. As the above DEA models may be rewritten into a linear programming problem
(LPP), and according to the author, GAMS is better to use because the matrix constrains of
the LPP do not need to be constructed, thus GAMS offers enormous possibilities for DEA
models solving. Others DEA models are under study to be implemented, including the two-
stage model.

REFERENCES

Álvarez, I., Barbero, J. and Zofío, J. (2016). A Data Envelopment Analysis Toolbox for
MATLAB, Working Paper 3, Department of Economics, Universidad Autónoma de Madrid,
Spain.

Andersen, P. and Petersen, N., (1993), A procedure for ranking efficient units in data
envelopment analysis. Management Science, 39, (10), 1261 – 1264.

Banker, R., Charnes A. and Cooper, W., (1984), Some Models for Estimating Technical and
Scale Inefficiencies in Data Development Analysis. Management Science, 30(9), 1078 –
1092.

9
View publication stats

Charnes, A., Cooper, W. and Rhodes, E., (1978). Measuring the efficiency of decision units.
European Journal of Operational Research, 2(6), 429 – 444.

Cheng, G., (2014). Data Envelopment Analysis: Methods and MaxDEA Software. Intellectual
Property Publishing House Co. Ltd. Beijing.

Cooper, W., Seiford, L. and Tone, K.,(2007). Data Envelopment Analysis. A Comprehensive
Text with Models, Applications, References and DEA-Solver Software, Second Edition,
Springer, NY, USA.

Jablonsky, J., (2016). Ranking Models in Data Envelopment Analysis, Business Trends, 6(4),
36 – 42.

Kalvelagem, E., (2004), Efficiency solving DEA models with GAMS. GAMS Development
Corporation, Washington DC, USA.

Martic, M., Novakovic, M, and Baggia, A., (2009). Data Envelopment Analysis – Basic
Models and their Utilization. Organizacija, 42(2), 37 – 43.

10

Vous aimerez peut-être aussi