Extract stand alone code for stochastic simulation?

I would like to be able to use the solution of a model obtained using Dynare to do simulations from the model at other parameter values, using the Julia language. Is there some reasonably simple way to do this? Is looking at dynare++ the proper approach?

Hi Michael,

you need to solve the model over and over again for each parameter set that you consider.

  1. At https://github.com/MichelJuillard/dynare.jl I have native Julia code for first and second order approximation. I’m currently working on k-order approximation. This is work in progress and not documented. But I can help you using what is there.
  2. There is a better integrated version of this code and more at https://github.com/DynareTeam/Dynare.jl/tree/with-preprocessor. @stepan-a can tell you more about it.
  3. You could write a Julia wrapper around dynare++, similar to the mex file that we did for order 3 in Dynare Matlab. Look at https://github.com/DynareTeam/Dynare.jl/tree/with-preprocessor and https://github.com/DynareTeam/dynare/tree/master/dynare%2B%2B
  4. Note also that the Dynare preprocessor that primarily translates the *.mod files into various *.m file has now also an option to translate the *.mod file in Julia files
    You can write me directly if you have more questions
    Best
    Michel

Thanks, Michel. Originally, I was solving the model from scratch for every parameter value, but Johannes P. gave me a steady_state file which got around part of that work. See https://github.com/mcreel/ABCDSGE/blob/master/GenData/make_simdata.m, around line 230, for how this is done. I don’t pretend to know exactly how this works, but I did verify that it gives the same results as solving from scratch for each parameter vector.

My belief is that it should be possible to make this part work outside of a Matlab/Octave session. I have some students who are interested in working on a Julia project this summer, and I was thinking that trying to do this might be useful and feasible. Thanks for the pointers!

Michael,

one line 242 of https://github.com/mcreel/ABCDSGE/blob/master/GenData/make_simdata.m, the call to Dynare Matlab function stoch_simul() not only computes the steady state, but also recomputes the approximation. From https://github.com/mcreel/ABCDSGE/blob/master/Common/TEMPLATEMODFILE.mod, I see that you are computing 3rd order approximation.

In order to in Julia what stoch_simul in currently doing in Matlab, you can either try to call dynare++ as the mex is doing in https://github.com/DynareTeam/Dynare.jl/tree/with-preprocessor or wait until I’m finished with k-order approximation in native Julia. I hope to have something by the Summer

Best