# Expectation variables

**URL:** https://forum.dynare.org/t/expectation-variables/14352
**Category:** Stochastic simulations
**Created:** [19 August 2019 02:32 UTC](https://forum.dynare.org/t/expectation-variables/14352 "2019-08-19T02:32:11Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![jiang](https://forum.dynare.org/letter_avatar_proxy/v4/letter/j/3e96dc/32.png) [@jiang](https://forum.dynare.org/u/jiang)
#### Post date: [19 August 2019 02:32 UTC](https://forum.dynare.org/t/expectation-variables/14352/1 "2019-08-19T02:32:11Z")

</div>

Dear dynare team, if I have a expression like this,  
 ![20190819](https://forum.dynare.org/uploads/default/original/2X/3/399bcfdfe9f118a0fbaae019fb20d20d1ff382a2.png)  
Then how to write in dynare model block, thanks a lot.

My best,  
ZL, Jiang

---

<div class="post-metadata">

### Author: ![pb2415](https://forum.dynare.org/letter_avatar_proxy/v4/letter/p/6f9a4e/32.png) [@pb2415](https://forum.dynare.org/u/pb2415)
#### Post date: [19 August 2019 12:29 UTC](https://forum.dynare.org/t/expectation-variables/14352/2 "2019-08-19T12:29:25Z")

</div>

My take on this is that you should use your model to derive an expression for the conditional expectation term in terms of observable and input it.

---

<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: [22 August 2019 08:18 UTC](https://forum.dynare.org/t/expectation-variables/14352/3 "2019-08-22T08:18:54Z")

</div>

Either you manually introduce auxiliary variables (see e.g. [Expected value of a power](https://forum.dynare.org/t/expected-value-of-a-power/2200/2)) or you use Dynare’s `EXPECTATION()()` operator (see the manual).
