Hello everyone!
I hope that you are all having a good week.
I have been wondering if you could give me some GAMS insights on the following issue whenever you can.
I mainly need GAMS to build a random intercountry input-output coefficients table (Matrix) a “loops” number of times. I am mainly using this code (you can also find it enclosed):
Parameter
Matrix(loops,regions,industries,regions2,industries2)=uniform(0,1);
Where the following sets “regions” and “regions 2” stand for regions (5 in total) and “industries” and “industries2” stand for activities. Enclosed, you can find a picture of how that coefficients matrix should look like
Afterward, I want to calculate the Leontief Inverse of that matrix in this way:
Variable
DUM1 ‘Dummy’
INVA1(loops,regions3,industries2,regions,industries) ‘Leontief inverse Matrix’;
Equations
EQM(loops,regions,industries,regions3,industries3)
DUMEQM1;
EQM(loops,regions,industries,regions3,industries3)… SUM(industries2,Matrix(loops,regions,industries,regions3,industries2)*INVA1(loops,regions3,industries2,regions,industries))=E=Id(loops,regions,industries,regions3,industries3);
DUMEQM1… DUM1 =E= 1;
MODEL INVERSEM1 /EQM, DUMEQM1/;
SOLVE INVERSEM1 USING NLP MAXIMIZING DUM1;
Where “Id” is an identity matrix.
However, no matter how hard I try, I always get an infeasible solution. Would you have any idea of where the mistake could come from?
Leontief.gms (1.1 KB)
Thank you very much!
Best,
Alberto