# Unconditional versus conditional Welfare measure

**URL:** <https://forum.dynare.org/t/unconditional-versus-conditional-welfare-measure/12467>\
**Category:** General DSGE Modeling\
**Created:** [22 September 2018 13:26 UTC](https://forum.dynare.org/t/unconditional-versus-conditional-welfare-measure/12467 "2018-09-22T13:26:04Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![pepito\_bm](https://forum.dynare.org/user_avatar/forum.dynare.org/pepito_bm/32/5475_2.png) [@pepito\_bm](https://forum.dynare.org/u/pepito_bm)\
**Post date:** [22 September 2018 13:26 UTC](https://forum.dynare.org/t/unconditional-versus-conditional-welfare-measure/12467/1 "2018-09-22T13:26:04Z")

</div>

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:

Welfare\_pos=strmatch(‘Welfare’,M\_.endo\_names,‘exact’);  
Welfare\_uncon=oo\_.mean(Welfare\_pos);

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:

Welfare\_pos=strmatch(‘Welfare’,M\_.endo\_names,‘exact’);  
Welfare\_con = oo\_.dr.ys(Welfare\_pos)+0.5\*oo\_.dr.ghs2(oo\_.dr.inv\_order\_var(Welfare\_pos));

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.

Best,  
Peter

---

<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 2018 09:14 UTC](https://forum.dynare.org/t/unconditional-versus-conditional-welfare-measure/12467/2 "2018-09-24T09:14:21Z")

</div>

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

```auto
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

> **[JohannesPfeifer/DSGE\_mod](https://github.com/JohannesPfeifer/DSGE_mod/tree/master/Born_Pfeifer_2018/Welfare)**
>
> A collection of Dynare models. Contribute to JohannesPfeifer/DSGE\_mod development by creating an account on GitHub.

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.

---

<div class="post-metadata">

**Author:** ![pepito\_bm](https://forum.dynare.org/user_avatar/forum.dynare.org/pepito_bm/32/5475_2.png) [@pepito\_bm](https://forum.dynare.org/u/pepito_bm)\
**Post date:** [24 September 2018 13:24 UTC](https://forum.dynare.org/t/unconditional-versus-conditional-welfare-measure/12467/3 "2018-09-24T13:24:56Z")

</div>

> [@jpfeifer](#):
>
> 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

Perfect match, many thanks Johannes.

---

<div class="post-metadata">

**Author:** ![RaffaelRusso](https://forum.dynare.org/letter_avatar_proxy/v4/letter/r/57b2e6/32.png) [@RaffaelRusso](https://forum.dynare.org/u/RaffaelRusso)\
**Post date:** [10 February 2020 21:26 UTC](https://forum.dynare.org/t/unconditional-versus-conditional-welfare-measure/12467/4 "2020-02-10T21:26:51Z")

</div>

But Professor Johannes, isn’t what you just said the same as Valerio said in:

> [@Welfare cost of business cycles](https://forum.dynare.org/t/welfare-cost-of-business-cycles/3802/11):
>
> Dear Professor Pfeifer, I read this post and other discussions on this topic but still there is something that is not clear to me. I would like to do a very simple exercise, that is to find the parameter of a policy rule that maximizes conditional expected welfare, defined as Welfare = U + \beta\*Welfare(+1) where the condition is being in the deterministic steady state in the first period. Moreover, the parameter has no impact on the deterministic steady-state. I am using a 2nd order approxima…

Back there you said this is a wrong way of computing conditional welfare as we can see in:

> [@Welfare cost of business cycles](https://forum.dynare.org/t/welfare-cost-of-business-cycles/3802/12):
>
> Dear Valerio, that would not be correct. Because when you simulate without shocks, you end up at the stochastic steady state, which is different from the deterministic one where you want to evaluate welfare (except for first order). At second order, the policy function for welfare (defined in the model recursively as W\_t=U+beta\*W(+1) or something similar) will have the form y\_t=y\_bar + 0.25 g\_sssigma^2 + terms that depend on shocks and deviations from steady state (see section 4.13.4 of the man…

---

<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 February 2020 10:07 UTC](https://forum.dynare.org/t/unconditional-versus-conditional-welfare-measure/12467/5 "2020-02-11T10:07:30Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![RaffaelRusso](https://forum.dynare.org/letter_avatar_proxy/v4/letter/r/57b2e6/32.png) [@RaffaelRusso](https://forum.dynare.org/u/RaffaelRusso)\
**Post date:** [11 February 2020 21:54 UTC](https://forum.dynare.org/t/unconditional-versus-conditional-welfare-measure/12467/6 "2020-02-11T21:54:12Z")

</div>

Thank you for the response! That was indeed my question! 🙂

---

<div class="post-metadata">

**Author:** ![dypisgood](https://forum.dynare.org/letter_avatar_proxy/v4/letter/d/82dd89/32.png) [@dypisgood](https://forum.dynare.org/u/dypisgood)\
**Post date:** [10 October 2021 02:18 UTC](https://forum.dynare.org/t/unconditional-versus-conditional-welfare-measure/12467/7 "2021-10-10T02:18:08Z")

</div>

Hi Professor,

Is the unconditional welfare the risky steady state of welfare?

Best,  
Yunpeng

---

<div class="post-metadata">

**Author:** ![HelloDynare](https://forum.dynare.org/user_avatar/forum.dynare.org/hellodynare/32/12107_2.png) [@HelloDynare](https://forum.dynare.org/u/HelloDynare)\
**Post date:** [10 October 2021 07:00 UTC](https://forum.dynare.org/t/unconditional-versus-conditional-welfare-measure/12467/8 "2021-10-10T07:00:08Z")

</div>

Hi @dypisgood In my humble opinion, no.

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.

---

<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:** [10 October 2021 12:43 UTC](https://forum.dynare.org/t/unconditional-versus-conditional-welfare-measure/12467/9 "2021-10-10T12:43:24Z")

</div>

Yes, unconditional welfare is the average welfare with shocks.

---

<div class="post-metadata">

**Author:** ![kofiemma](https://forum.dynare.org/letter_avatar_proxy/v4/letter/k/439d5e/32.png) [@kofiemma](https://forum.dynare.org/u/kofiemma)\
**Post date:** [13 March 2022 18:22 UTC](https://forum.dynare.org/t/unconditional-versus-conditional-welfare-measure/12467/10 "2022-03-13T18:22:22Z")

</div>

> [@jpfeifer](#):
>
> 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!!

---

<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:** [14 March 2022 12:40 UTC](https://forum.dynare.org/t/unconditional-versus-conditional-welfare-measure/12467/11 "2022-03-14T12:40:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kofiemma](https://forum.dynare.org/letter_avatar_proxy/v4/letter/k/439d5e/32.png) [@kofiemma](https://forum.dynare.org/u/kofiemma)\
**Post date:** [7 April 2022 09:26 UTC](https://forum.dynare.org/t/unconditional-versus-conditional-welfare-measure/12467/12 "2022-04-07T09:26:17Z")

</div>

> [@jpfeifer](#):
>
> No, welfare at the steady state is conditional welfare (conditional on the steady state)

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?

![Screenshot from 2022-04-07 18-22-14](https://forum.dynare.org/uploads/default/original/2X/1/129c2a6f56c6fb3283c402d85af9c0feec543f74.png)

And the average welfare loss per period would be unconditional?

---

<div class="post-metadata">

**Author:** ![kofiemma](https://forum.dynare.org/letter_avatar_proxy/v4/letter/k/439d5e/32.png) [@kofiemma](https://forum.dynare.org/u/kofiemma)\
**Post date:** [7 April 2022 09:32 UTC](https://forum.dynare.org/t/unconditional-versus-conditional-welfare-measure/12467/13 "2022-04-07T09:32:48Z")

</div>

> [@HelloDynare](#):
>
> after a long-run period to compute the unconditional welfare.

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](https://forum.dynare.org/t/welfare-computation/308)). But if you take the mean in the long run, then you get unconditional welfare? Thanks!

---

<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:** [7 April 2022 11:30 UTC](https://forum.dynare.org/t/unconditional-versus-conditional-welfare-measure/12467/14 "2022-04-07T11:30:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kofiemma](https://forum.dynare.org/letter_avatar_proxy/v4/letter/k/439d5e/32.png) [@kofiemma](https://forum.dynare.org/u/kofiemma)\
**Post date:** [7 April 2022 19:42 UTC](https://forum.dynare.org/t/unconditional-versus-conditional-welfare-measure/12467/15 "2022-04-07T19:42:00Z")

</div>

> [@jpfeifer](#):
>
> time average

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?

---

<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:** [8 April 2022 09:30 UTC](https://forum.dynare.org/t/unconditional-versus-conditional-welfare-measure/12467/16 "2022-04-08T09:30:59Z")

</div>

1. That’s impossible to tell ex-ante. You would need to check for convergence or compute it analytically.
2. Conditional involves evaluating welfare at a particular point in the state space today.

---

<div class="post-metadata">

**Author:** ![kofiemma](https://forum.dynare.org/letter_avatar_proxy/v4/letter/k/439d5e/32.png) [@kofiemma](https://forum.dynare.org/u/kofiemma)\
**Post date:** [9 April 2022 09:09 UTC](https://forum.dynare.org/t/unconditional-versus-conditional-welfare-measure/12467/17 "2022-04-09T09:09:16Z")

</div>

> [@jpfeifer](#):
>
> You would need to check for convergence or compute it analytically.

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

> [@jpfeifer](#):
>
> Conditional involves evaluating welfare at a particular point in the state space today.

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:

```auto
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;

```auto
variance.y=oo_.var(y_pos,y_pos);
variance.pi=oo_.var(pi_pos,pi_pos);
L=0.5*((par.siggma+(par.varphi+par.alppha)/(1-par.alppha))*variance.y_gap+par.epsilon/par.lambda*variance.pi)/100;

```

Then `variance.y` and `variance.pi` are unconditional variances? What would be the conditional counterparts? Sorry for a long question.

---

<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:** [9 April 2022 15:34 UTC](https://forum.dynare.org/t/unconditional-versus-conditional-welfare-measure/12467/18 "2022-04-09T15:34:08Z")

</div>

1. The convergence of the average over periods to the expected value. If it still fluctuates considerably, it has not yet converged.
2. You can use the `simult_`-function to compute welfare at any given point in time of your simulations. See e.g.

> [@Two m files and two mod files](https://forum.dynare.org/t/two-m-files-and-two-mod-files/16093/17):
>
> Hello Prof. Pfeifer, I have some rudimentary doubts, after reading your github “Born\_Pfeifer\_2018/Welfare”. For UNconditional welfare, outvalue=1/(1-betta)\*oo\_.mean(strmatch('Utility',var\_list\_ ,'exact')) -oo\_.mean(strmatch('Recursive\_natural\_welfare\_equivalent',var\_list\_,'exact')) You compute both Utility and Recursive\_natural\_welfare\_equivalent via oo\_.mean. For CONDitional Welfare, y\_sim = simult\_(M\_,options\_,initial\_condition\_states,oo\_.dr,shock\_matrix,options\_.order); %simulat…

---

<div class="post-metadata">

**Author:** ![Deb](https://forum.dynare.org/letter_avatar_proxy/v4/letter/d/ecccb3/32.png) [@Deb](https://forum.dynare.org/u/Deb)\
**Post date:** [5 April 2024 12:12 UTC](https://forum.dynare.org/t/unconditional-versus-conditional-welfare-measure/12467/19 "2024-04-05T12:12:56Z")

</div>

Dear Forum,

I would like to calculate the welfare difference due to changing a particular parameter in my model and want to see is it welfare increasing or decreasing when I change the parameter. In order to do so, I am calculating consumption equivalent between two welfare values like this:  
\lambda = exp((1-\beta)(V\_1-V\_0))-1

Is this a legit method to calculate the welfare difference? I am keep all shocks in the model active in this case. Would conditional welfare would be the case where I keep just one shock active and switching off others?

Thank you very much in advance.

---

<div class="post-metadata">

**Author:** ![stepan-a](https://forum.dynare.org/user_avatar/forum.dynare.org/stepan-a/32/6652_2.png) [@stepan-a](https://forum.dynare.org/u/stepan-a)\
**Post date:** [5 April 2024 19:20 UTC](https://forum.dynare.org/t/unconditional-versus-conditional-welfare-measure/12467/20 "2024-04-05T19:20:09Z")

</div>

Hi,

Have you looked at this thread?

> [@Consumption Equivalence\_Welfare analysis](https://forum.dynare.org/t/consumption-equivalence-welfare-analysis/14268):
>
> Hi, I am trying to proceed with a welfare analysis. I have estimated the values of consumption equivalence for the 2 regimes as well as the values from the welfare equations, however i am not sure whether i need to compare the values of consumption equivalent or welfare values and determine the optimal policy. I read in previous posts that the change of sign matters, but for example in my case both regimes have negative sign for consumption equivalent. Which is the best policy, the one with…

Best,  
Stéphane.

[Next page](https://forum.dynare.org/t/unconditional-versus-conditional-welfare-measure/12467.md?page=2)
