# Policy function incomplete - only linear terms are computed

**URL:** <https://forum.dynare.org/t/policy-function-incomplete-only-linear-terms-are-computed/566>\
**Category:** Dynare v4 (legacy)\
**Created:** [30 January 2008 10:57 UTC](https://forum.dynare.org/t/policy-function-incomplete-only-linear-terms-are-computed/566 "2008-01-30T10:57:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ansgar](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@Ansgar](https://forum.dynare.org/u/Ansgar)\
**Post date:** [30 January 2008 10:57 UTC](https://forum.dynare.org/t/policy-function-incomplete-only-linear-terms-are-computed/566/1 "2008-01-30T10:57:10Z")

</div>

Dear all,  
I have encountered the following problem while using the second order approximation: When computing the policy function, the the computer stops after having computed the linear approximation. I let it run and after more than nine hours, it then returned the theoretical moments with “NaN” entries - still not having computed the second order parts of the policy function. What does this mean? Would be great if anyone gave me a hint what is going on. Taking the first order approximation worked fine.  
I have attached the code. Many Thanks for your help.

Best,  
Ansgar  
[NGstochastic2.mod](https://forum.dynare.org/uploads/default/original/1X/40e1b26574072827430c0b0c8203ee78cae315b0.mod) (3.32 KB)

---

<div class="post-metadata">

**Author:** ![MichelJuillard](https://forum.dynare.org/user_avatar/forum.dynare.org/micheljuillard/32/5318_2.png) [@MichelJuillard](https://forum.dynare.org/u/MichelJuillard)\
**Post date:** [9 February 2008 09:43 UTC](https://forum.dynare.org/t/policy-function-incomplete-only-linear-terms-are-computed/566/2 "2008-02-09T09:43:44Z")

</div>

Dear Ansgar,

the expression (pi(-1))^chi, with pi = 0 et chi=1, results in a bug in the parser.  
We need to fix the bug, but it is alos either a bug in the model or a little weird modeling:

pi(-1) can be negative and if chi isn’t an integer, (pi(-1)^chi will be complex.

Best

Michel

---

<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 July 2017 13:30 UTC](https://forum.dynare.org/t/policy-function-incomplete-only-linear-terms-are-computed/566/3 "2017-07-24T13:30:57Z")

</div>


