# Expectation of function,vs,function of expectations

**URL:** <https://forum.dynare.org/t/expectation-of-function-vs-function-of-expectations/2348>\
**Category:** Dynare help (legacy posts)\
**Created:** [9 February 2012 01:32 UTC](https://forum.dynare.org/t/expectation-of-function-vs-function-of-expectations/2348 "2012-02-09T01:32:32Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![hewei2004](https://forum.dynare.org/letter_avatar_proxy/v4/letter/h/ea666f/32.png) [@hewei2004](https://forum.dynare.org/u/hewei2004)\
**Post date:** [9 February 2012 01:32 UTC](https://forum.dynare.org/t/expectation-of-function-vs-function-of-expectations/2348/1 "2012-02-09T01:32:32Z")

</div>

Hi,

I am using dynare++ 4.2.4, however I am confused as to how dynare++ handle the expectations of functions.  
This is not a deterministic model and I wish to use order 3.

Suppose that I have the following:  
Et[Mt+1\*Rt+1]=1  
let mt+1=log(Mt+1), rt+1=log(rt+1)  
Then we have: Et[exp([mt+1]+[rt+1])=1

Question A , how do I write the above equation in dynare++?  
If I write in model statement that 1=exp(m(+1)+r(+1)), how do I know if dynare++ will interpret it as  
Et[exp{[mt+1]+[rt+1]}=1, versus, exp{Et[mt+1]+Et[rt+1]=1

Question B, a related question is, in general, how do I unambiguously tell dynare++ , that for a function of variable xt+1, I want f(Et(xt+1))=1 and not Et(f(xt+1))=1

Thank you.

---

_[View the full topic](https://forum.dynare.org/t/expectation-of-function-vs-function-of-expectations/2348)._
