How to reach the benchmark? Topic is solved

Problems with syntax of GAMS
Post Reply
Rodrigue
User
User
Posts: 11
Joined: 1 year ago

How to reach the benchmark?

Post by Rodrigue » 1 week ago

Hi all,

I’m implementing a CGE model in GAMS using NONOPT for NLP programming. The model worked well until I decided to incorporate the external sector taking into account the imports and exports. Indeed, the benchmark was reached properly without the external sector. Now that I incorporate it into the model the benchmark equilibrium is no longer found even though the process window displays no error. The behaviour of exports (ex(i)) has been modelled by

eqex(i).. ex(i) =e= coefex(i)*pm*nivex;

where coefex(i) is a parameter which captures the proportion of good I exported, nivex is a variable representant the total exports in volume. Pm is the price of exportation.
Concerning the imports, I derived it demand function from a cobb Douglas utility function that follows the Armington assumption

y(i) = mu(i)*(Q(i)**eta(i)*im(i)**(1-eta(i)))

The solution of the minimisation program p(i)*Qt(i) + pm*(1+r(i))*im(i)
gave im(i) and Qt(i) equations representing respectively the import and composite demands of good I as follows:


eqm(i).. im(i) =e= (y(i)/mu(i))*(p(i)*(1-eta(i))/(pm*(1+r(i))*eta(i)))**(eta(i));
eqQ(i).. =e= im(i)*pm*(1+r(i))**(eta(i))/(p(i)*(1-eta(i)));

I calibrated eqm(i) from technological parameter mu(i) by:

mu(i) = y0(i)*(1/im0(i))*(p0(i)*(1-eta(i))/(pm0*(1+r(i))*eta(i)))**eta(i);

where y0(i), p0(i), pm0(i) are the benchmark values of total production y, the price of local good p(i) and the price of imported good pm. r(i) represents the tariff rate.

The question is why is the benchmark equilibrium not established? For example, prices at the first simulation should be unity but it is not the case. Is it the problem of calibration? Or the issue of incorporating of the three previous equations?


I will really appreciate any suggestion to overcome this

The Gams file is given in attached

Rodrigue
Attachments
CGE5.gms
(10.1 KiB) Downloaded 3 times

User avatar
Renger
Posts: 378
Joined: 3 years ago

Re: How to reach the benchmark?

Post by Renger » 1 week ago

Hi Rodrigue

I have a "3am-question" when teaching CGE. This is question that every student should be able to answer immediately and without hesitation when I would wake them at that time. The question is "What is the most important point when debugging your benchmark?" The answer is: set your iteration limit to zero and initialize your variables properly. If you made no mistakes, GAMS will report a correct solution even without trying to solve the model.
In your case, when I set the iteration limit to 0, I get many infeasibilities (you can find them in the listing under the heading "Equation listing").
For example

Code: Select all

---- PRICES  =E=  price formation for goods

PRICES(1)..  0.814814814814815*P(1) - 0.277777777777778*P(2) - 0.462962962962963*PVA(1)
      =E= 0 ; (LHS = 0.0740740740740741, INFES = 0.0740740740740741 ****)
     
PRICES(2)..  - 0.446428571428571*P(1) + 0.776785714285714*P(2) - 0.223214285714286*PVA(2)
      =E= 0 ; (LHS = 0.107142857142857, INFES = 0.107142857142857 ****)
Other infeasiblities can be found in the following equations: FACPRICES, HOUSDEM, SAVPRIV, eqgdp, and eqq.
This is an indication that either you did not calibrate your equations properly, or you forgot to initialize the variables, or you made a mistake in the equation.
Using the information on the infeasible equation, you can, if you have initialized all your variables, gain information where the problem lies.

I hope this helps.

Renger
____________________________________
Enjoy modeling even more: The lazy economist

Rodrigue
User
User
Posts: 11
Joined: 1 year ago

Re: How to reach the benchmark?

Post by Rodrigue » 1 week ago

Hi Renger

Thank you very much for your reply.

By setting iterlim to 0 I saw where the probem lies. It is really interesting by doing so. I'm going to debugg it step by step following your suggestions and I hope I will succeed.

Rodrigue

Rodrigue
User
User
Posts: 11
Joined: 1 year ago

Re: How to reach the benchmark?

Post by Rodrigue » 1 week ago

Hi Renger

I thank you again. By following your guide, I got the best solution. Everything is working well now. I observed that there were some variables that I had to scale and likewise, some equations were wrongly calibrated.

Thank you for your help

Rodrigue

Post Reply