Help me in CES, CET estimate, please

Solver related questions
Nguyen Xuan
Posts: 6
Joined: 2 weeks ago

Re: Help me in CES, CET estimate, please

Post by Nguyen Xuan » 2 weeks ago

Dear Renger,
Could you show me how to test the infeasible to give the same results as you (code, step, etc.) or give me your file with code for check?
Thanks a lot!
Nguyen Xuan.

User avatar
Posts: 360
Joined: 2 years ago

Re: Help me in CES, CET estimate, please

Post by Renger » 2 weeks ago


If you use conopt you get a warning that your data is badly scaled:

Code: Select all

 ** Warning **  The variance of the derivatives in the initial
                point is large (= 4.5 ). A better initial
                point, a better scaling, or better bounds on the
                variables will probably help the optimization.
Here it says that a better starting initial point could help. Your starting points are sometimes a factor 10 away from the upper and lower bounds.

You get lots of information if you comment out the first few lines of your code and as the model doesn't seem to converge, you can stop it after iteration 0. The equations listing shows you the size of infeasibilities

Code: Select all

*option limcol=0, limrow=0;
*$offsymxref offsymlist
*option solprint = off;
*option reslim = 20000;
option iterlim = 0;
Now you can check in the equation listing how your first initialization differs from the bounds and if it makes sense to set upper and lower bounds for certain variables.

I would suggest the following:
[*] Scale your parameters, 
[*] Initialize your variables better.
[*] Run your estimation for just one year for debugging purposes as I suspect that you might find more easily a solution with one time period and debugging your code gets also easier. If you don't find a solution, you might have made some mistakes in your equations/model. 
If you want to run your model for one year, I would move the data out of your gams file to an excel sheet and read them with gdxxrw. You can then easily adjust your commands to read one or more years from the excel sheet.

Hope this helps

Enjoy modeling even more: The lazy economist

Post Reply