examples/dea.mod
changeset 1 c445c931472f
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/examples/dea.mod	Mon Dec 06 13:09:21 2010 +0100
     1.3 @@ -0,0 +1,222 @@
     1.4 +/* Data Envelopment Analysis (DEA)
     1.5 + *
     1.6 + * DEA quantifies the relative efficiency of decision making units (DMUs) by
     1.7 + * finding the efficient frontier in multiple input multiple output data.  The
     1.8 + * inputs are resources (eg. number of employees, available machines, ...),
     1.9 + * the outputs are productive outputs (eg. contracts made, total sales, ...).
    1.10 + * The method is non-parametric.  More details are available in the paper
    1.11 + * below.
    1.12 + *
    1.13 + * Models according to: Seiford, Threall, "Recent developments in DEA", 1990.
    1.14 + *
    1.15 + * Implementation: Sebastian Nowozin <nowozin@gmail.com>
    1.16 + */
    1.17 +
    1.18 +### SETS ###
    1.19 +
    1.20 +set dmus;       # Decision Making Units (DMU)
    1.21 +set inputs;     # Input parameters
    1.22 +set outputs;    # Output parameters
    1.23 +
    1.24 +
    1.25 +### PARAMETERS ###
    1.26 +
    1.27 +param input_data{dmus,inputs} >= 0;
    1.28 +param output_data{dmus,outputs} >= 0;
    1.29 +
    1.30 +
    1.31 +### PROGRAM ###
    1.32 +
    1.33 +var theta{dmus} >= 0;
    1.34 +var lambda{dmus,dmus} >= 0;
    1.35 +
    1.36 +minimize inefficiency: sum{td in dmus} theta[td];
    1.37 +
    1.38 +s.t. output_lower_limit{o in outputs, td in dmus}:
    1.39 +    sum{d in dmus} lambda[d,td]*output_data[d,o] >= output_data[td,o];
    1.40 +s.t. input_upper_limit{i in inputs, td in dmus}:
    1.41 +    sum{d in dmus} lambda[d,td]*input_data[d,i] <= theta[td]*input_data[td,i];
    1.42 +
    1.43 +    s.t. PI1{td in dmus}:
    1.44 +        sum{d in dmus} lambda[d,td] = 1;
    1.45 +/*
    1.46 +possibilities:
    1.47 +      i) (no constraint)
    1.48 +     ii) s.t. PI1{td in dmus}:
    1.49 +        sum{d in dmus} lambda[d,td] <= 1;
    1.50 +    iii) s.t. PI1{td in dmus}:
    1.51 +        sum{d in dmus} lambda[d,td] >= 1;
    1.52 +*/
    1.53 +
    1.54 +
    1.55 +### SOLVE AND PRINT SOLUTION ###
    1.56 +
    1.57 +solve;
    1.58 +
    1.59 +printf "DMU\tEfficiency\n";
    1.60 +for {td in dmus} {
    1.61 +    printf "%s\t%1.4f\n", td, theta[td];
    1.62 +}
    1.63 +
    1.64 +### DATA ###
    1.65 +
    1.66 +data;
    1.67 +
    1.68 +set dmus := 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
    1.69 +    21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
    1.70 +    41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
    1.71 +    61 62 63 64 65 66 67 68 69 ;
    1.72 +set inputs := AvgInventory LaborCost OperatingCost Population ;
    1.73 +set outputs := PrescrVol kDollarValue ;
    1.74 +
    1.75 +param input_data default 0.0 :
    1.76 +
    1.77 +        AvgInventory LaborCost OperatingCost Population :=
    1.78 +
    1.79 +1 8000 17030 1280 1410
    1.80 +2 9000 25890 2779 1523
    1.81 +3 13694 29076 2372 1354
    1.82 +4 4250 17506 1385 822
    1.83 +5 6500 23208 639 746
    1.84 +6 7000 12946 802 1281
    1.85 +7 4500 18001 1130 1016
    1.86 +8 5000 14473 1097 1070
    1.87 +9 27000 31760 5559 1694
    1.88 +10 21560 50972 15010 1910
    1.89 +11 15000 39523 4799 1745
    1.90 +12 8500 13076 3489 1353
    1.91 +13 35000 35427 1704 500
    1.92 +14 18000 27554 2882 1016
    1.93 +15 59750 53848 14208 2500
    1.94 +16 19200 38253 1480 2293
    1.95 +17 40000 109404 83016 2718
    1.96 +18 8466 18198 1278 2877
    1.97 +19 16000 40891 7599 4150
    1.98 +20 10000 45444 5556 4421
    1.99 +21 25000 35623 2121 3883
   1.100 +22 14000 20192 5515 3519
   1.101 +23 12500 34973 10475 32366
   1.102 +24 17260 32284 14498 3393
   1.103 +25 7000 17920 7585 4489
   1.104 +26 14000 42094 3742 2217
   1.105 +27 16400 35422 14236 4641
   1.106 +28 13000 19100 3529 5968
   1.107 +29 30000 72167 8656 8715
   1.108 +30 12530 19970 1714 5968
   1.109 +31 31500 39183 4919 5607
   1.110 +32 10000 32048 3483 7324
   1.111 +33 22000 68877 12279 8685
   1.112 +34 10000 29812 3332 8685
   1.113 +35 16000 47686 2507 5420
   1.114 +36 10000 33415 4738 7703
   1.115 +37 9000 12359 4603 4665
   1.116 +38 16439 23614 2989 6317
   1.117 +39 14500 36069 1793 31839
   1.118 +40 39000 76307 9539 15619
   1.119 +41 24927 40706 12661 30213
   1.120 +42 13858 39267 4609 34719
   1.121 +43 33375 29509 11323 31839
   1.122 +44 29044 44482 5542 34719
   1.123 +45 32257 61365 20550 32366
   1.124 +46 8800 49671 3306 43561
   1.125 +47 47000 40425 10396 31263
   1.126 +48 12000 33034 4915 31263
   1.127 +49 28000 69163 4688 15173
   1.128 +50 13300 28931 16735 73064
   1.129 +51 13500 29758 4260 62309
   1.130 +52 24000 40927 8285 23166
   1.131 +53 16000 40403 2131 99836
   1.132 +54 17000 38730 2539 60348
   1.133 +55 25000 35978 2502 99836
   1.134 +56 16000 37509 6278 99836
   1.135 +57 20000 46950 10715 85925
   1.136 +58 14000 35966 3144 85925
   1.137 +59 22000 68318 8015 108987
   1.138 +60 21879 69537 7778 108987
   1.139 +61 15000 25425 2812 201404
   1.140 +62 10000 19508 2454 201404
   1.141 +63 20000 28191 3367 201404
   1.142 +64 18000 37073 8624 108987
   1.143 +65 19051 23763 3496 201404
   1.144 +66 15000 28642 3366 201404
   1.145 +67 10000 35919 3868 201404
   1.146 +68 24000 54653 26494 108987
   1.147 +69 1800 6276 3413 60348
   1.148 +        ;
   1.149 +
   1.150 +param output_data default 0.0 :
   1.151 +
   1.152 +        PrescrVol kDollarValue :=
   1.153 +
   1.154 +1 12293 61.00
   1.155 +2 18400 92.00
   1.156 +3 16789 92.65
   1.157 +4 10700 45.00
   1.158 +5 9800 50.00
   1.159 +6 6500 29.00
   1.160 +7 8200 56.00
   1.161 +8 8680 45.00
   1.162 +9 33800 183.00
   1.163 +10 23710 156.00
   1.164 +11 24000 120.00
   1.165 +12 17500 75.00
   1.166 +13 25000 130.00
   1.167 +14 26000 122.00
   1.168 +15 26830 178.513
   1.169 +16 16600 106.00
   1.170 +17 90000 450.00
   1.171 +18 11140 73.624
   1.172 +19 25868 136.00
   1.173 +20 32700 191.295
   1.174 +21 29117 152.864
   1.175 +22 18000 100.00
   1.176 +23 11100 60.00
   1.177 +24 23030 137.778
   1.178 +25 10656 58.00
   1.179 +26 24682 152.095
   1.180 +27 26908 120.00
   1.181 +28 16464 80.00
   1.182 +29 57000 321.00
   1.183 +30 17532 94.747
   1.184 +31 30035 168.00
   1.185 +32 16000 100.00
   1.186 +33 63700 277.00
   1.187 +34 18000 90.00
   1.188 +35 27339 139.134
   1.189 +36 19500 116.00
   1.190 +37 13000 80.00
   1.191 +38 15370 102.00
   1.192 +39 18446 90.00
   1.193 +40 56000 260.00
   1.194 +41 73845 364.951
   1.195 +42 28600 145.00
   1.196 +43 27000 243.00
   1.197 +44 52423 279.816
   1.198 +45 73759 363.388
   1.199 +46 20500 80.00
   1.200 +47 27100 115.00
   1.201 +48 15000 110.00
   1.202 +49 50895 277.852
   1.203 +50 19707 128.00
   1.204 +51 17994 78.80
   1.205 +52 36135 167.222
   1.206 +53 30000 153.00
   1.207 +54 26195 125.00
   1.208 +55 28000 216.00
   1.209 +56 24658 152.551
   1.210 +57 36850 190.00
   1.211 +58 29250 183.69
   1.212 +59 50000 250.00
   1.213 +60 40078 265.443
   1.214 +61 20200 110.00
   1.215 +62 12500 75.00
   1.216 +63 30890 195.00
   1.217 +64 31000 175.00
   1.218 +65 31277 192.992
   1.219 +66 11500 75.00
   1.220 +67 30000 175.668
   1.221 +68 38383 190.00
   1.222 +69 2075 8.650
   1.223 +        ;
   1.224 +
   1.225 +end;