Using an array to assign a lot of parameters

Dear all,

I’ve been working with a mutli-sectoral dsge model but I want to extend the number of sectors. However, since I want to include a lot of sectors (at least 15), I find myself with a great number of parameters and equations. Thus I want to use macro-processing loops to assign the values of the parameters. But I can’t manage to calibrate the parameters when using arrays.

As you can see in the mod file, endo is a list of parameters but using the line 95 to calibrate it doesn’t work.

Do you have an idea of how to manage this ?

Thank you so much !

Best regardsSecteur_N.mod (6.3 KB)

Can you explain a bit more what you are actually trying to achieve? Where do the values come from that you want to set?

Yes sorry Professor.

So I have a set of parameters let’s say ALPHA = (ALPHA_i)_{with i between 1 and N}, N being the number of sectors I have.

I would like to store them in a vector before they are calibrated and then write :

ALPHA = VECTOR

where VECTOR is a vector imported from excel with the calibration I want to put.

The problem is that I don’t find a way to store the parameters in an array such that I can calibrate them all in one shot such as in this example. Since I will have a lot of sectors, I would like to avoid having to write :

ALPHA_1 = 0.3
ALPHA_2 = 0.2
etc.

Is it possible ?

Thank you so much professor

So you have a vector of parameter values from outside of Dynare and want to assign these to the parameters in Dynare before calling other commands? In that case, I seems the best way is to use Matlab code to set the values. What is the pattern behind the parameter names and the place of the corresponding values in the vector?

Professor,
I used a Matlab code to set the values and it worked, thank you very much !