Iterations of the Value Function:
Note the jump up in the optimal savings policy.
The Optimal Policy:
The plot of output above assumes that the shock takes its average value. You can clearly see the two steady-state levels of output (they occur where the blue line cuts the 45 degree line from above).
I am not quite sure what to make of this...I wasn't expecting the output and the optimal policy lines to cross...maybe a bug in my code. Thoughts and interpretations are welcome! The code has been posted to my Google Code repository. Try it with a different (bounded and continuous) utility function and let me know your results...
I am not quite sure what to make of this...I wasn't expecting the output and the optimal policy lines to cross...maybe a bug in my code. Thoughts and interpretations are welcome! The code has been posted to my Google Code repository. Try it with a different (bounded and continuous) utility function and let me know your results...
I think the lines cross because you aren't restricting consumption to be positive. You could do this by adding a penalty function to the utility function, e.g.
ReplyDeletedef U(c): return 1 - exp(- theta * c) - 1e6*(c<=0)
Thanks, I'll give it a try and see. I thought I had restricted consumption to be greater than zero. I didn't have any problems with other implementations that I tried, but the graphic clearly doesn't make sense.
ReplyDeleteI also think I worked out the code for simulating the marginal distributions. I will see if I can get both bugs fixed this evening and post the new code.