Home

Figure 6. Example of a GAMS program to solve an output-oriented DEA model which measures technical efficiency, and which allows slack variables to be included by modifying the constraints and incorporating them explicitly.

1. Set inout /spec1, spec2, fix1, fix2, var1, var2/
2. Output(inout) /spec1, spec2/
3. Input(inout) /fix1, fix2, var1, var2/
4. Obs /1*500/
5. Subobs(obs) /1*10/
6. Actobs(obs);
7. Alias (subobs, subobs1)
8. $offlisting
9. Table act(obs,inout) input output table
10. $ondelim
11. $Include "data.csv"
12. $offdelim
13. $onlisting
14. Variables
15. Theta efficiency score
16. Weight(obs) weights
17. Slack1(output) output slack
18. Slack2(input) input slack;
19. Positive variable weight, slack1, slack2;
20. Equations
21. Constr1(output,obs) DEA constraint for each output
22. Constr2(input,obs) DEA constraint for each input;
23. Constr1(output,actobs).. sum(subobs, weight(subobs)*act(subobs, output))-slack1(output) =E= theta*act(actobs, output);
24. Constr2(input, actobs).. sum(subobs,weight(subobs)*act(subobs,input)) +slack2(input) =E= act(actobs, input);
25. Parameter
26. Score1(obs) efficiency scores
27. Score2(obs,output) output slack values;
28. File primal /teout_res.txt/;
29. Model tedea /constr1, constr2/;
30. Loop (subobs1,
31. Actobs(obs)=no;
32. Actobs(subobs1)=yes;
33. Option LP=OSL;
34. Solve tedea maximizing theta using LP;
35. Score1(subobs1)=theta.l;
36. Score2(subobs1,output)=slack1.l(output);
37. Put primal;
38. If ((tedea.modelstat eq 1 and tedea.solvestat eq 1),
39. Put @1, subobs1.tl, @10, "optimal", @20, "normal completion"/
40. Else
41. Put @1, subobs1.tl, @10, tedea.modelstat:>2:0,
42. @20, tedea.solvestat:>2:0/
43. );
44. );
45. File res /teslack.csv/;
46. Res.pc=5;
47. Res.pw=160;
48. Put res;
49. Put 'obs', 'theta',
50. Loop (output,
51. Put output.tl);
52. Put 'sp1slack', 'sp2slack',
53. Loop (subobs1,
54. Put /
55. Put subobs1.tl, score1(subobs1),
56. Loop (output,
57. Put act(subobs1,output));
58. Loop (output,
59. Put score2(subobs1,output));
60. );
61. Putclose;

www.nefsc.noaa.gov
NMFS Search
Link Disclaimer
webMASTER
Privacy Policy
(File Modified Nov. 19 2010)