Simulation: Big shocks and NaN

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Simulation: Big shocks and NaN

Postby ella » Fri Nov 28, 2008 12:44 am

Hi,
I'm trying to solve a dynamic portfolio choice problem by Dynare 4.
The problem is, when I do the simulation (2nd order), the system always generate some very big exogenous random shocks. Then I get "NaN' in the simulation result.

It is weired since the variance of my shock is 0.0001. but in simulation the system generates some big shocks (not only once). The typical process is: in some period,(say, 102th period), the shock is 1.500, then the 103th period is e06, the 104th period the shock is e18, etc...finally it gets to NaN... Not only the endogenous variables go to NaN, but also the exogenous shocks go to NaN...


I worked on it for 2 days but I still cannot figure out the reason. The only finding is, if I enlarge a parameter in my code named "cost"(which is just a penalty parameter in the model, has nothing to do with the shock), then it's less likely to get a NaN in simulation.

Can anyone tell me how to fix it?

I attach my .mod and .m file here.
Attachments
portfolio.mod
(1.83 KiB) Downloaded 185 times
portfolio_steadystate.m
(506 Bytes) Downloaded 188 times
ella
 
Posts: 1
Joined: Fri Nov 28, 2008 12:26 am

Return to Dynare help

Who is online

Users browsing this forum: No registered users and 7 guests