Page 1 of 1

Deterministic Simulation Issues

PostPosted: Sat Jul 20, 2013 5:04 pm
by akeinsley
Hello,

I'm having a bit of an issue with a deterministic simulation. I can solve for the initial and end values just fine, but the simulation keeps giving me vectors of NaN and telling me that some matrix is nearly singular. I can't for the life of me figure out why I'm having this issue.

I have attached the .mod file, but it won't let me attach the .mat file that I call on to set the parameter, initial, and end values. I would be willing to email said file to anyone who is willing to help me. I apologize for the inconvenience as this setup was an attempt to make the results more flexible to robustness checks.

Thank you!

Re: Deterministic Simulation Issues

PostPosted: Sat Jul 20, 2013 6:09 pm
by akeinsley
Here is a simpler .mod file with all the values included.

Re: Deterministic Simulation Issues

PostPosted: Sat Jul 20, 2013 9:18 pm
by jpfeifer
You set mu to 0 in the shocks block, but in the equations you have:
n = xi*mu^(theta-1)*m*(lam1/(lam2-beta*lam2(+1)*(1-delta)/pi(+1)))^theta;

with theta=0.5. This yields 0^-0.5=1/0^0.5=infinity.

Re: Deterministic Simulation Issues

PostPosted: Sun Jul 21, 2013 3:13 pm
by akeinsley
Wow, that's a little embarrassing. Thanks for the help! You're the best!