I am super new on Gams. It will be so nice for me if you can help me!
“I am encountering an issue in my GAMS model where the shadow prices for undesirable outputs (spb(k)
) are not being calculated correctly. I suspect the problem is due to defining spb(k)
as a parameter instead of a variable, which prevents the model from storing the dual values from the constraints (CON3.m(k)
). Could you please help me resolve this by reviewing my variable and constraint definitions?”
my code :
$onImplicitAssign
Sets
j “Centrales” /p1*p162/
g “Input and Outputs” /x1,x2,x3,yg,yb/
i(g) “Inputs” /x1, x2, x3/
d(g) “Outputs” /yg/
k(g) “Undesirable Outputs” /yb/;
alias(jj, j);
alias(kk,jj);
$offImplicitAssign
- Load the data for inputs and outputs
Table Data(j,g) Data for inputs and outputs
Variables efficiency objective function
Beta inefficiency score(Beta values)
Lambda(j) dual weights (Lambda values)
spb(k) “shadow price for undesirable outputs (CO2)”;
Positive Variables
Lambda(j)
Beta
spb(k);
Parameters DMU_data(g) slice of data
eff(j) Beta values
Lamres(j,j) peers for each DMU
slacks(j,g) slacks for inputs and outputs;
Equations OBJ objective function
CON1(i) input constraint
CON2(d) output constraint for desirable outputs
CON3(k) output dual
CON4 VRS constraint;
OBJ… efficiency =E= sum(j, Lambda(j));
CON1(i)… SUM(j, Lambda(j)*Data(j,i))=L=DMU_data(i);
CON2(d)… SUM(j, Lambda(j)Data(j,d))=G=DMU_data(d)+betaDMU_data(d);
CON3(k)… SUM(j, Lambda(j)Data(j,k))=L=DMU_data(k)-betaDMU_data(k);
CON4… SUM(j, Lambda(j))=E=1;
model Undesirable_output_DEA Undesirable output DEA model /OBJ, CON1, CON2, CON3, CON4/;
loop(jj,
DMU_data(g) = Data(jj,g);
solve Undesirable_output_DEA using LP maximizing efficiency;
eff(jj) = Beta.l;
loop(kk,
Lamres(jj,kk) = Lambda.l(kk);
);
spb(k) = CON3.m(k);
);
-
Display efficiency, lambda, peers, and shadow prices
Display eff, Lambda.l, Lamres, spb; -
Unload the results to a GDX file
execute_unload ‘results.gdx’, eff, Lamres, spb;