Looping over an exogenous variable

Hello to all!!

I am working on a deterministic equilibrium model, and I would like to do a loop over an exogenous variable. Specifically, I want to calculate the steady-state and welfare over different levels of taxation. I have found some information about looping over parameters but nothing about exogenous variables. Where could I find information about this?

Thank you in advance!


In your case, you would need to modify oo_.exo_simul and oo_.endo_simul in between runs of perfect_foresight_solver.

Dear Professor jpfeifer,

Thank you so much for your reply. I dont understand well what you say. I need to calculate the steady-state values, and welfare “variable v” for each level of tau from values 0.1 to 0.9. I was running the program each time changing the tau, but it is time consuming. I tried to use something like:

tau_varexo = 0.1:0.05:0.9;

for i=1:length(tau_varexo)
tau = tau_varexo(i);

But of course it doesn’t work for tau since it is not a parameter.

Then, I would like to get the results of each steady state in latex. I used “write_latex_steady_state_model;” but it is not recognized.

function or variable

Error in Benchmark
(line 151)

Error in dynare
(line 235)

I am using Dynare 4.5.7 because it was the latest version that worked on my computer.

Thank you in advance for your help.

Best regards,

Benchmark.mod (867 Bytes)

I am not sure I understand. If tau does not change over time, you can define it as a parameter. Also, why do you need a perfect foresight simulation if you are only interested in the steady state?

Dear jpfeifer,

Right!! Previously I had a time varying tax so thats why I had it in exogenous variables. I didn’t think about changing it as a parameter. Now it is easier to do the loop.

Regarding the simulation, actually It I don’t need it anymore. I created it before because I had a technology shock and I was analyzing an impulse response.

Thanks you for your comments! It helped me to improve the code.

Best regards,