# Question about understanding irfs in dynare

Hi,
I have a question about understanding irfs in my model. I’ve seen several posts on the forum about it but I’m still confusing.
My question is: in my model, does the vertical axis in irfs’ graph represent percentage deviation from steady state value or just the difference b/w variable following a shock and its steady state value? For example, does y in irf graph represent (yt-y*)/y* or yt-y*, where yt is output following a shock and y* is the steady-state output ?

Thanks so much!
Best,RBC_baseline.mod (1.9 KB)

1 Like

Hi, It depends on the approximation. The default is linearization, in this case the IRFs are in deviations to the deterministic steady state. At first order you can use the option `loglinear`, Dynare log linearize the model and the IRFs are in percentage deviations to the deterministic steady state.

Best,
Stéphane.

2 Likes

To be more precise: it depends on how the variables in your model are measured. As @stepan-a says, Dynare conducts a linearization.

1. If you for example have a nonlinear model and your model variable is simply the level of output, the IRF will measure the difference between the variable and its steady state (or its mean at higher order). This is the case with https://github.com/DynareTeam/dynare/blob/master/examples/example1.mod

2. In contrast, if your model variable already measures percentages, you will get the percentage deviation from the steady state, because that is what the simple deviation from steady state measures in this case. This is for example the case when you entered an already log-linearized model where all variables are percentage deviations from trend.

3. Now there are cases where in a nonlinear model you want percentage deviations from steady state instead of simple deviations. There are three ways to do this:

1. Use the `loglinear` option. The downside is that all variables in the model will be log-linearized using a Jacobian transformation, leading to trouble if you have variables with 0 or negative steady states. See the example at https://github.com/DynareTeam/dynare/blob/master/tests/loglinear/example4_exp.mod
2. Perform an `exp()`-substitution, i.e. put the variable you want to be in percentage deviations consistently in `exp()` and adjust the steady state accordingly. Thereby, Dynare will do a linearization with respect to a variable that is effectively the log of the original variable, leading to a log-linearization instead of a linearization. See Section “4.4 Linearization vs. Log-linearization” in Pfeifer(2013): “A Guide to Specifying Observation Equations for the Estimation of DSGE Models” and as an example https://github.com/DynareTeam/dynare/blob/master/tests/loglinear/example4_loglinear.mod
3. You can simply append the logs of the variables that interest you as auxiliary variables to your nonlinear model and consider these variables, which then measure percentage deviations from trend. An example is https://github.com/JohannesPfeifer/DSGE_mod/blob/master/RBC_baseline/RBC_baseline.mod
11 Likes

Thanks so much for your detailed reply, Dr. Jpfeifer! This is so useful and helpful! Highly appreciate that！

If I were to use the third option above, would I still need to multiply all log-transformed variables by 100 to obtain percent deviations?

The multiplication with 100 is only for convenience in order to have a value of 1 denote 1 percent instead of the usual 0.01.

Hello @jpfeifer

Just wanted to confirm that the IRFs from your linear code in the following would be interpreted as a percentage deviation from steady state?

As it corresponds to category 2 in this Question about understanding irfs in dynare - #4 by jpfeifer

I’d really appreciate your help, thank you!

Yes, that model was log-linearized and therefore corresponds to percentage deviations from steady state.

Hello @jpfeifer !
Following up on this old thread: I just wanted to understand how to set the value of eps_a to get a 1 percentage deviation from the steady state in inflation on impact. If you could please elaborate on this for the code of Gali chapter 3 linear file? Thank you!

See

In addition to @jpfeifer’s answer, you may want to check out the code I have written for this purpose here.
The description is in the README file.

I have just uploaded a similar code that does not require grid search and accounts for correlations at

1 Like

@jpfeifer thank you for the generalization! This more versatile!

Hello,

I was just wondering about how to enter percentage shocks in a non linear model so when Dynare does the linearization, the shock will be to a 1% increase in the shocked variable.

One way to do it is by introducing the shock using exponential and solving the model at order 1:

``````Y = exp(A)*K(-1)^alpha
A = rho*A(-1) + e
``````

If we fix the `stderr` of e to 1, then we have a 1% shock over A right?

But do we obtain the same if one define the shock in a log like this ?

``````Y = A*K(-1)^alpha
log(A) = rho*log(A(-1)) + e
``````

Mathematically the expressions are equivalent with a transformation, but I’m wondering if Dynare will also interpret this as a 1% increase in A when using the `order=1` command and not the `loglinear` one.

At `order=1`, both formulation are equivalent and you can interpret that as a 1% shock to A.