# Post-Covid interest rate analysis with Dynare

**URL:** <https://forum.dynare.org/t/post-covid-interest-rate-analysis-with-dynare/27530>\
**Category:** General DSGE Modeling\
**Created:** [4 May 2025 14:16 UTC](https://forum.dynare.org/t/post-covid-interest-rate-analysis-with-dynare/27530 "2025-05-04T14:16:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lukas03](https://forum.dynare.org/letter_avatar_proxy/v4/letter/l/9de0a6/32.png) [@Lukas03](https://forum.dynare.org/u/Lukas03)\
**Post date:** [4 May 2025 14:16 UTC](https://forum.dynare.org/t/post-covid-interest-rate-analysis-with-dynare/27530/1 "2025-05-04T14:16:10Z")

</div>

Hey,

I write my Bachelor Thesis about the interest rate after Covid (only ECB) and want to simulate the “best” interest rate according to my own model. Therefore I want to take the IS-Curve, the Philipps Curve and the Taylor rule. In addition I want to add two shocks (demand shock in 2020 and supply shock in 2022 because of the energy crisis).

I tried some simulations the last couple days on Dynare and I am slowly feeling comfortable with the program.  
My question is: Can you give me some access to information material, a similar model or some hints how to simulate this? I had a lot of errors due to instability of the model (at least ChatGPT says that 🙂 ).

Thanks a lot 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:** [5 May 2025 13:59 UTC](https://forum.dynare.org/t/post-covid-interest-rate-analysis-with-dynare/27530/2 "2025-05-05T13:59:34Z")

</div>

Without a lot more details it is impossible to know what you are trying to achieve. Various resources are at [Resources | Dynare](https://www.dynare.org/resources/)

---

<div class="post-metadata">

**Author:** ![Lukas03](https://forum.dynare.org/letter_avatar_proxy/v4/letter/l/9de0a6/32.png) [@Lukas03](https://forum.dynare.org/u/Lukas03)\
**Post date:** [5 May 2025 14:23 UTC](https://forum.dynare.org/t/post-covid-interest-rate-analysis-with-dynare/27530/3 "2025-05-05T14:23:16Z")

</div>

Hi jpfeifer,

I want to achieve a simulation of the optimal interest rate of the ECB between 2020 and 2024. Therefore I want to set up an easy New Keynesian Model with IS-Curve, Philipps-Curve, Taylor-Rule und Zero Lower Bound. In addition I want to simulate some exogenous shocks with realistic parameters (demand shock after covid-19 and supply shock because of the energy crisis).

I hope this helps to understand what I want to achieve.  
Thanks in advance,  
Lukas

---

<div class="post-metadata">

**Author:** ![Lukas03](https://forum.dynare.org/letter_avatar_proxy/v4/letter/l/9de0a6/32.png) [@Lukas03](https://forum.dynare.org/u/Lukas03)\
**Post date:** [5 May 2025 14:26 UTC](https://forum.dynare.org/t/post-covid-interest-rate-analysis-with-dynare/27530/4 "2025-05-05T14:26:21Z")

</div>

One more thing to add. In the end, it would be nice to state something about how a different interest rate policy could have led to a different development of Inflation but also output.

---

<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:** [5 May 2025 18:37 UTC](https://forum.dynare.org/t/post-covid-interest-rate-analysis-with-dynare/27530/5 "2025-05-05T18:37:19Z")

</div>

A starting point then would be an NK model with OccBin:

```auto
/*
 * This file implements a New Keynesian model subject to the ELB on interest rates
 * and solves it using OccBin.
 */

%-------------------------------------------------------
% Variable declarations
%----------------------------------------------------------------
var 
    pie ${\pi}$ (long_name = 'Quarterly inflation rate')
    y ${y}$ (long_name = 'Output gap')
    inom ${i}$ (long_name = 'Observed nom. interest rate')
    inomnot ${i^{not}}$ (long_name = 'Notional nom. interest rate')
    zeps_a ${\varepsilon_a}$ (long_name = 'Cost-push shock process')
    zeps_i ${\varepsilon_i}$ (long_name = 'Monetary policy shock process')
    zeps_c ${\varepsilon_c}$ (long_name = 'Demand shock process')   
    ;     

varexo 
    u_a ${u_a}$ (long_name='Cost-push shock')
    u_i ${u_i}$ (long_name='Monetary policy shock')
    u_c ${u_c}$ (long_name='Demand shock')
    ;

parameters 
    betta ${\beta}$ (long_name='Discount factor')
    eta ${\eta}$ (long_name='Labour supply elasticity')
    ilb ${i^{lb}}$ (long_name='ELB')
    sig ${\sigma}$ (long_name='IES')
    theta ${\theta}$ (long_name='Calvo parameter')
    phi_pi ${\phi_{\pi}}$ (long_name='Inflation feedback Taylor Rule')
    phi_y ${\phi_{y}}$ (long_name='Output feedback Taylor Rule')
    rho_a ${\rho_a}$ (long_name='Autocorrelation cost-push shock')
    rho_c ${\rho_c}$ (long_name='Autocorrelation demand shock')
    rho_i ${\rho_{i}}$ (long_name='Autocorrelation monetary policy shock')
    rhoinom ${\rho_{inom}}$ (long_name='Interest-rate smoothing')
    ;   
%----------------------------------------------------------------
% Parametrization, some from p. 52 in Gali ch 3
%----------------------------------------------------------------
betta = 0.995;
eta = 1;
ilb = -0.0055;
phi_pi = 1.5;
phi_y = 0.5/4;
rho_a = 0.8;
rho_c = 0.9;
rho_i = 0.5;
rhoinom = 0.8;
sig = 1;
theta = 0.78;

model_local_variable kappa ${\kappa}$;

%----------------------------------------------------------------
% Model declaration
%----------------------------------------------------------------
model(linear);
 
#kappa = (sig+eta)*(1-theta)*(1-betta*theta)/theta;

[name='Phillips Curve']   
pie=betta*pie(+1)+kappa*y+zeps_a;

[name='IS curve']
y=y(+1)-1/sig*(inom-pie(+1))+zeps_c;

[name='Notional rate Taylor rule']
inomnot=rhoinom*inomnot(-1)+(1-rhoinom)*(phi_pi*pie+phi_y*y)+zeps_i;   

[name = 'Observed interest rate',relax='zlb']
inom = inomnot;

[name = 'Observed interest rate',bind='zlb']
inom = ilb;

[name='Law of motion for cost-push shocks']
zeps_a=rho_a*zeps_a(-1)+u_a;

[name='Law of motion for demand shocks']
zeps_c=rho_c*zeps_c(-1)+u_c;

[name='Law of motion for interest-rate shocks']
zeps_i=rho_i*zeps_i(-1)+u_i;

end;
 
%----------------------------------------------------------------
% steady states: all 0 due to linear model (except obs)
%---------------------------------------------------------------
options_.TeX=1;

steady;
check;

%----------------------------------------------------------------
% Run Simulations
%----------------------------------------------------------------

occbin_constraints;
name 'zlb'; bind inomnot<=ilb; 
end;   

shockssequence = -0.01;

shocks(surprise);
    var u_c;
    periods 1;
    values(shockssequence);
end;

occbin_setup;

occbin_solver(simul_periods=20,simul_check_ahead_periods=50);
occbin_graph y inom inomnot pie;
occbin_write_regimes;
occbin.plot_regimes(oo_.occbin.simul.regime_history,M_,options_)

```
