Dear all,
I have a question regarding the proper way of calculating the value of both the unconditional and conditional (upon starting from the steady state) welfare measure. From what I see after browsing similar questions here in the forum, in Dynare the unconditional welfare corresponds to the unconditional ergodic mean of the welfare variable:

By contrast, the conditional welfare criterion (upon starting in the steady state) is given by the constant in the policy and transition functions output that Dynare produces. Guess its interpretation is…the conditional ergodic mean which in a 2nd order approximation is different from the steady state. The way I compute is:

Is that right? I am asking since I obtain very weird values for the conditional welfare both in sign and in values as they are very different from the unconditional welfare measure.

Yes, that is correct. If you are in the steady state, you can use the steady state plus the uncertainty correction. You can cross check this with

initial_condition_states = repmat(oo_.dr.ys,1,M_.maximum_lag); %get steady state as initial condition
shock_matrix = zeros(1,M_.exo_nbr); %create shock matrix with number of time periods in rows
y_sim = simult_(initial_condition_states,oo_.dr,shock_matrix,options_.order); %simulate one period to get value
Welfare_con_2=y_sim(Welfare_pos,2)*100; %read out gap

as in

The interpretation is that this is the welfare conditional on being in the steady state, but factoring in that the model is stochastic, i.e. that shocks in the future may happen.

I am not sure I understand your post. For conditional welfare, you take the first element of the simulation without shocks, not the last one of a long simulation.

Deterministic Steady State: when we want to compute the conditional welfare, usually we start/perturb the economy from this type of steady state. At the steady state, there are no shocks.

Risky Steady State: despite no shocks, the agent observes the distribution of the shocks that may hit the economy in future, e.g. standard deviation \sigma. In this context, we simulate long sequences of endogenous variables at a higher order to see they will converge to the risky steady state or the stochastic steady state.

Ergodic/unconditional mean: We get this value by simulating the economy with shocks after a long-run period to compute the unconditional welfare.

Is unconditional welfare another name for steady-state welfare as mentioned in other posts? Seems like it.

I guess steady-state welfare is something like Wss = Uss + bet* Uss?

Assuming you solved analytically for Uss, then I guess you don’t need to use simulated data of average welfare with shocks to compute unconditional welfare, right? Thanks!!

No, welfare at the steady state is conditional welfare (conditional on the steady state). In a nonlinear model, the average over all states and shocks is not the steady state, so unconditional welfare is different.

But the conditions underlying conditional welfare can be different, right?

Like in Gali’s book, welfare is conditioned, for example, on cost-push shocks, I guess. But we can also have conditional welfare conditioned on a stochastic steady-state, and conditional welfare conditioned on a deterministic steady-state and transitional path?

Whatever type is the conditional welfare, by taking the average, we get unconditional welfare? Like in Gali’s book, is this a conditional welfare loss function, conditioned on shocks?

And the average welfare loss per period would be unconditional?

Hi @HelloDynare, if I may ask. What is long-run here? If you create a variable W = U + bet* U(+1), simulate the model and compute mean of W, you get conditional welfare (per this thread Welfare computation). But if you take the mean in the long run, then you get unconditional welfare? Thanks!

The difference is about the information set of the expectations operator. Conditional welfare using conditional expectations, i.e. conditional on some information about the state today as well as potentially information on future shocks. For unconditional welfare, we use unconditional expectations.
If your system is ergodic, then the time average will correspond to expected value.

But how long should the time be for the average of (W = U + bet* U(+1)) be to be considered unconditional assuming the system is ergodic. And how short should the time be for W to be considered conditional?

I am lost here. Check the convergence of? The model?

I think I get the concept. Like on the other thread. E(welfare) is unconditional welfare, and it does not depend on any conditions or shocks. E_t(welfare), on the hand, is conditional welfare. But it is still not clear to me how to do that in dynare…

Say I have policy functions for utility and welfare in the mod file:

U = (1-sigma)*C
Welfare = U+ beta*Welfare(+1)

The unconditional welfare is saved in oo_.mean after simulation. Do I need to set periods=100000? And how to get conditional welfare from dynare?

I know we can rewrite welfare functions in other ways, but generally, all oo_ variables are unconditional? Say I have a different welfare function;