|
Home
Figure 4. Example of a GAMS program to solve an output-oriented DEA
model which measures technical efficiency.
1. $oninline
2. /*next define inputs and outputs*/
3. Set inout /spec1, spec2, fix1, fix2, var1, var2/
4. Output(inout) /spec1, spec2/
5. Input(inout) /fix1, fix2, var1, var2/
6. Obs /1*500/
7. Subobs(obs) /1*10/
8. Actobs(obs);
9. Alias (subobs, subobs1)
10. Table act(obs,inout) input output table
11. $ondelim
12. $include "data.csv"
13. $offdelim
14. Variables
15. Theta efficiency score
16. Weight(obs) weights;
17. Positive variable weight;
18. Equations
19. Constr1(output,obs) DEA constraint for each output
20. Constr2(input,obs) DEA constraint for each input;
21. Constr1(output, actobs).. sum(subobs,weight(subobs)*act(subobs, output))
=G= theta*act(actobs,output);
22. Constr2(input, actobs).. sum(subobs, weight(subobs)*act(subobs,input))
=L= act(actobs, input);
23. Parameter
24. Score1(obs) efficiency scores;
25. File primal /teout_res.txt/;
26. Model tedea /constr1, constr2/;
27. Loop (subobs1,
28. Actobs(obs)=no;
29. Actobs(subobs1)=yes;
30. Option LP=OSL;
31. Solve tedea maximizing theta using LP;
32. Score1(subobs1)=theta.l;
33. Put primal;
34. If ((tedea.modelstat eq 1 and tedea.solvestat eq 1),
35. Put @1, subobs1.tl, @10, "optimal", @20, "normal completion"/
36. Else put @1, subobs1.tl, @10, tedea.modelstat:>2:0,
37. @20, tedea.solvestat:>2:0/ );
38. );
39. File res /teoutput.csv/;
40. Res.pc=5;
41. Put res;
42. Loop (subobs1,
43. Put subobs1.tl, score1(subobs1)/ );
44. Putclose;
|