# Welfare and Pruning

Hi!

I am working with a medium-scale two-agent New Keynesian model with government spending and want to analyse the welfare effects of a 1% increase in fiscal spending using the methodology set out in Schmitt-Grohe and Uribe (2004). The approach I’m using is summarised below and the associated Dynare code is as follows:

Vold=lambdaVLold+(1-lambda)VRold;
UR=ln(CR)-nu
(NR^(1+varphi))/(1+varphi);
UL=ln(CL)-nu
(NL^(1+varphi))/(1+varphi);
VR=UR+bettaVR(+1);
VL=UL+betta
VL(+1);
V=lambdaVL+(1-lambda)VR;
WG=V-Vold;
kl=1-exp((1-betta)
(VL-VLold));
kr=1-exp((1-betta)
(VR-VRold));
k=lambda*kl+(1-lambda)*kr;

I then simulate the model at second order; to avoid explosive simulations, I turn on the pruning option.

I have two questions arising from this exercise

1. 2nd order + pruning leads to sizeable differences in the simulated IRFs, including a sign change for one of the variables. In addition, while G (normalised by steady state) is 1 at t=0 for order=1, I instead get g>1 for order=2. Is there a way of avoiding this result (without resorting to the simulation of very small shocks)?
2. I am not entirely sure whether my code properly implements the use of a conditional welfare metric correctly – any feedback would be very valuable.

I’d greatly appreciate any help with this!

Best wishes,
Lukas

Hi Lukas,

did you see this discussion: Welfare cost of business cycles

I don’t use pruning when I run the second-order approx. for the calculation of welfare, instead, I just set irf=0. If I don’t set irf=0, I get the message:
stoch_simul:: The simulations conducted for generating IRFs to eps_A1 were explosive.
stoch_simul:: No IRFs will be displayed. Either reduce the shock size,
stoch_simul:: use pruning, or set the approximation order to 1.

To be honest, I don’t know why exactly it works this way and whether setting irf=0 does the job in general or just in my model. And I’m also a bit confused regarding the phrase “The simulations conducted…” given that in the FAQ section of Dynare it is written that “Solutions are technically not simulations (although the literature commonly refers to impulse response functions as being “simulated”). They are instead straightforwardly “solutions” to a constrained maximization problem (initiating a system of difference equations).”

Maybe someone could help to clarify this issue as well?

Hi,

I agree that the FAQ is not very clear (at best)… Actually this is very old material, I do not remember who wrote this section, and would not rely on this (maybe we should remove this FAQ from the website, since we do not have time to maintain it). If I understand the quote correctly I am forced to disagree. In a rational expectation context, IRFs are simulations. The solution of a rational expectation model is a reduced form model, which in turn is used to simulate the model (stochastic simulations or IRFs) or compute theoretical moments. My understanding is that there is here a confusion with the perfect foresight context (where the generated paths for the endogenous variables are solution of large system of non linear equations).

When you put `irf=0`, since `periods` is equal to zero by default, you instruct Dynare not to perform any simulations with the computed reduced form. That’s why it works. The pruning is only used to prevent explosive paths for the simulations, which are not required to compute the welfare cost of fluctuations.

Best,
Stéphane.

You can evaluate conditional and unconditional welfare without simulations. I will try to upload an example in the next couple of days.

Fantastic, thank you very much indeed!

Thank you for the clarification!

The files are now available at

Thank you for uploading the files. Does it have a particular reason why you calculate conditional welfare based on a simulation instead of calculating the steady state plus the uncertainty correction as described in https://forum.dynare.org/t/welfare-cost-of-business-cycles/3802/12? Is it because you are not actually extracting welfare from the Dynare output, but already the welfare gain/loss in consumption equivalents?

It is not really a simulation. The function generally does simulations, but the way I use it is to just compute the left-hand-side of the policy function given the provided values for states and shocks on the right-hand-side. That way, you can evaluate conditional welfare at any given point. The linked post is only concerned with the steady state and is quite error prone if you do it manually.

Fantastic! Thank you, Professor Pfeifer.