# Estimate the Laffer curve with a DSGE on Dynare

**URL:** <https://forum.dynare.org/t/estimate-the-laffer-curve-with-a-dsge-on-dynare/18945>\
**Category:** General DSGE Modeling\
**Created:** [23 September 2021 17:11 UTC](https://forum.dynare.org/t/estimate-the-laffer-curve-with-a-dsge-on-dynare/18945 "2021-09-23T17:11:53Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![E.Ahmed](https://forum.dynare.org/letter_avatar_proxy/v4/letter/e/e19b73/32.png) [@E.Ahmed](https://forum.dynare.org/u/E.Ahmed)\
**Post date:** [23 September 2021 17:11 UTC](https://forum.dynare.org/t/estimate-the-laffer-curve-with-a-dsge-on-dynare/18945/1 "2021-09-23T17:11:54Z")

</div>

Dear Professors and Colleagues,  
Once again, I come here to ask for your help. I wanted to estimate the Laffer curve in my DSGE analysis. Some of you suggested me to review “F-de-Córdoba and Torres (2012)”, but the latter did not show the useful technique well.  
Finally, I thought of asking you again for help on this; what are the steps to take to bring out the laffer curve that concerns VAT for example.  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [24 September 2021 06:39 UTC](https://forum.dynare.org/t/estimate-the-laffer-curve-with-a-dsge-on-dynare/18945/2 "2021-09-24T06:39:39Z")

</div>

What exactly are you trying to do? What do you mean with “estimate the Laffer curve”?

---

<div class="post-metadata">

**Author:** ![E.Ahmed](https://forum.dynare.org/letter_avatar_proxy/v4/letter/e/e19b73/32.png) [@E.Ahmed](https://forum.dynare.org/u/E.Ahmed)\
**Post date:** [25 September 2021 02:05 UTC](https://forum.dynare.org/t/estimate-the-laffer-curve-with-a-dsge-on-dynare/18945/3 "2021-09-25T02:05:06Z")

</div>

In fact, the exact question is asked about looping a dynare.mod around a parameter. Is this possible? If yes, and if you allow it, can you give a simple example.

I mentioned the Laffer curve as an example, how to show stationary states when tax rates vary from 0 to 1.

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [25 September 2021 17:29 UTC](https://forum.dynare.org/t/estimate-the-laffer-curve-with-a-dsge-on-dynare/18945/4 "2021-09-25T17:29:36Z")

</div>

Have a look at

> [@Loop over parameters](https://forum.dynare.org/t/loop-over-parameters/3335/2):
>
> You are not actually setting the parameter. What you should do is use the the set\_param\_value command. Moreover, if you have an analytic steady state, use a steady\_state\_model block instead of initval. You can find an example for such a loop here: [[Need help to check Matlab compatibility](http://forum.dynare.org/t/need-help-to-check-matlab-compatibility/3192/1)). Basically, you need to write a Matlab m-file with the following parts: rhos = 0.8:0.05:1.05; first\_time = 1; for i=1:length(rhos) if first\_time set\_param\_value('rho',rhos(i)); dynare your\_…

---

<div class="post-metadata">

**Author:** ![E.Ahmed](https://forum.dynare.org/letter_avatar_proxy/v4/letter/e/e19b73/32.png) [@E.Ahmed](https://forum.dynare.org/u/E.Ahmed)\
**Post date:** [25 September 2021 22:54 UTC](https://forum.dynare.org/t/estimate-the-laffer-curve-with-a-dsge-on-dynare/18945/5 "2021-09-25T22:54:30Z")

</div>

Very important, Thank You very much Professor.

---

<div class="post-metadata">

**Author:** ![E.Ahmed](https://forum.dynare.org/letter_avatar_proxy/v4/letter/e/e19b73/32.png) [@E.Ahmed](https://forum.dynare.org/u/E.Ahmed)\
**Post date:** [26 September 2021 15:58 UTC](https://forum.dynare.org/t/estimate-the-laffer-curve-with-a-dsge-on-dynare/18945/6 "2021-09-26T15:58:38Z")

</div>

Dear Professor @jpfeifer ,  
Knowing that I have seen all the similar publications that have already been posted here on the forum, I still have two problems:  
1- I don’t know how to export the steady state results in Excel format.  
2- The second problem is the most important one. Indeed, I now need to plot the evolution of the variables around the parameter, but I don’t know how to do it on dynare.  
Thank you in advance.

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [27 September 2021 08:10 UTC](https://forum.dynare.org/t/estimate-the-laffer-curve-with-a-dsge-on-dynare/18945/7 "2021-09-27T08:10:17Z")

</div>

1. Use `xlswrite`. See [(Not recommended) Write spreadsheet file - MATLAB xlswrite - MathWorks Deutschland](https://de.mathworks.com/help/matlab/ref/xlswrite.html)
2. What do you mean with

> [@E.Ahmed](#):
>
> evolution of the variables around the parameter

?

---

<div class="post-metadata">

**Author:** ![E.Ahmed](https://forum.dynare.org/letter_avatar_proxy/v4/letter/e/e19b73/32.png) [@E.Ahmed](https://forum.dynare.org/u/E.Ahmed)\
**Post date:** [27 September 2021 12:42 UTC](https://forum.dynare.org/t/estimate-the-laffer-curve-with-a-dsge-on-dynare/18945/8 "2021-09-27T12:42:37Z")

</div>

Dear @jpfeifer  
After calculating the different values of Y at equilibrium, giving varpi=0.001, 0.002, 0.003, …, 1 using just dynare, I want to plot the (Y, varpi) but I don’t know how to do it.  
Thank you very much

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [27 September 2021 12:45 UTC](https://forum.dynare.org/t/estimate-the-laffer-curve-with-a-dsge-on-dynare/18945/9 "2021-09-27T12:45:58Z")

</div>

You save both into a vector and then plot them using Matlab functions.

---

<div class="post-metadata">

**Author:** ![E.Ahmed](https://forum.dynare.org/letter_avatar_proxy/v4/letter/e/e19b73/32.png) [@E.Ahmed](https://forum.dynare.org/u/E.Ahmed)\
**Post date:** [27 September 2021 13:06 UTC](https://forum.dynare.org/t/estimate-the-laffer-curve-with-a-dsge-on-dynare/18945/10 "2021-09-27T13:06:40Z")

</div>

It is not clear. how I record the equilibrium matrix, then select the vectors to plot them. If you allow me to give a simple example, I really need it. I just looked at similar publications, but no case is appropriate for me.

In case of need, you will find attached my code [solt.mod](https://forum.dynare.org/uploads/short-url/26IKGkYQL8BazxM1oLQNQSIqJt8.mod) (2.1 KB)

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [28 September 2021 08:19 UTC](https://forum.dynare.org/t/estimate-the-laffer-curve-with-a-dsge-on-dynare/18945/11 "2021-09-28T08:19:52Z")

</div>

It should be something along the lines of

```auto
tau_parameters = 0.1:0.3:0.8;
temp_mat=NaN(size(oo_.steady_state,1),length(tau_parameters));
for i=1:length(tau_parameters)
    set_param_value('varpi',tau_parameters(i));
    [oo_.steady_state,M_.params,info] = steady_(M_,options_,oo_);
    if ~info
        temp_mat(:,i)=oo_.steady_state;
    end
end;

plot(tau_parameters,temp_mat(strmatch('Y',M_.endo_names,'exact'),:))

```

---

<div class="post-metadata">

**Author:** ![E.Ahmed](https://forum.dynare.org/letter_avatar_proxy/v4/letter/e/e19b73/32.png) [@E.Ahmed](https://forum.dynare.org/u/E.Ahmed)\
**Post date:** [29 September 2021 21:23 UTC](https://forum.dynare.org/t/estimate-the-laffer-curve-with-a-dsge-on-dynare/18945/12 "2021-09-29T21:23:15Z")

</div>

Dear @jpfeifer ,  
Your answer is appropriate. I tested this code and the result was very good.  
Thank you very much for your help.  
Best Regards  
Ahmed

---

<div class="post-metadata">

**Author:** ![E.Ahmed](https://forum.dynare.org/letter_avatar_proxy/v4/letter/e/e19b73/32.png) [@E.Ahmed](https://forum.dynare.org/u/E.Ahmed)\
**Post date:** [8 January 2022 13:43 UTC](https://forum.dynare.org/t/estimate-the-laffer-curve-with-a-dsge-on-dynare/18945/13 "2022-01-08T13:43:33Z")

</div>

Dear Professor @jpfeifer ,  
I need to do the previous looping for two parameters (varpi & psi).

tau\_parameters = 0.1:0.3:0.8;  
temp\_mat=NaN(size(oo\_.steady\_state,1),length(tau\_parameters));  
for i=1:length(tau\_parameters)  
for j=1:length(tau\_parameters)  
set\_param\_value(‘varpi’,tau\_parameters(i));  
set\_param\_value(‘psi’,tau\_parameters(j));  
[oo\_.steady\_state,M\_.params,info] = steady\_(M\_,options\_,oo\_);  
if ~info  
temp\_mat(:,i,j)=oo\_.steady\_state;  
end  
end  
end;

Then plot the isocurve of Y. On matlab, we usually do  
“contour(varpi,psi,Y)”

But on Dynare, which I need, I don’t know what to do and thanks in advance.

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [11 January 2022 07:58 UTC](https://forum.dynare.org/t/estimate-the-laffer-curve-with-a-dsge-on-dynare/18945/14 "2022-01-11T07:58:06Z")

</div>

See my reply at

> [@Contour function in dynareg](https://forum.dynare.org/t/contour-function-in-dynareg/19598/2):
>
> No. Dynare relies on Matlab plotting capabilities. You would need to use the Matlab function on the data object you want to plot.
