I have written some Matlab code “eval_dyn_pol_beta” (see attachment) that can evaluate the Dynare policy function or decision rules. It can be especially useful for computing simulations yourself, or evaluating the Euler residuals.
I called it a “beta” version, because I only tested it for a standard RBC model with TFP shocks. I compared the simulation results with the results of my own CSD toolbox (based on Prof. Maussners CoRRAM), and they are almost identical (differences <1e-12 after 1000 periods) for order 1 to 3.
I do not know if the function will work for more complex models, so any feedback is more than welcome.
In the attachments you find:
“eval_dyn_pol_beta.m” - the Matlab function used to evaluate the Dynare policy function. It uses polynomials, so computations should be fast (also for multiple series).
“TEST_EVAL_DYN_POL.zip” which includes several files to compute the simulation of a standard RBC model using the Dynare decision rules and the above file to evaluate these policy functions. It also compares the simulation results with the solution of my own CSD toolbox.
Thank you! The function simult_.m does seem very similar indeed, although the function I supplied can handle multiple values of one state variable (ie. n by cols input), whereas simult_ only handles n by 1 inputs according to the dscription.
And the values of y0 that are not state variables will be ignored, right?