I have a dynare code that runs fine. The dynare code generates a simulation with 1000 periods.
I am trying to replicate that exact simulation using the policy functions dynare outputs to the screen as well as the shocks that dynare stores in
However, for some reason I cannot replicate the exact same results that dynare has. I am attaching the dynare code and the matlab code that tries to replicate the dynare simulation for my first variable (p2).
There must be something that I am not understanding in the way dynare stores the coefficients of the policy functions and uses them to compute the decisions.
Edit: After reading this other topic, I removed the +1e-14 part of line 164 of stoch_sim. The differences indeed decreased but are still there …