Page 1 of 1

Set a large number of parameters

PostPosted: Tue Jun 13, 2017 6:29 pm
by E.Tolva
Hi everybody,

I am currently trying to simulate a DGE model in international trade, it consists in 5 non-linear equation for each country that in my dataset are 67. This vast number of equations requires that I have to set values for an even larger number of parameters: I have all the values already define in an xlsx files and I was wandering if there is a way to avoid to set them manually
e.g.
parameter alpha beta;
alpha = 0.55;
beta = 0.98;
but instead to upload the vector of all the values and just recall the specific value in the equation when it is needed.

I hope that I made myself clear,

Thank you all for the help,

Edoardo

Re: Set a large number of parameters

PostPosted: Wed Jun 14, 2017 4:48 pm
by jpfeifer
If your Excel file contains the names of the parameters and the values, you can easily write a small script writing the corresponding variable definitions. If the ordering in the Excel file conforms with the one in the parameters statement, you can also load the parameter vector from Excel and assign it to M_.params wholesale. The latter, however, is more errorprone than the first one.