I have done some computations using Julia for example a vector of countries. In what form should I save this data to be accessible to the mod files. For example I have a vector:
ctry=[“SOM”; “FDG”] and generated using Julia.
When I go to the dynare mod file I do this:
@#define country = ctry;
The mod file cannot see the variable generated in Julia.
What is best way of sharing Julia data with mod files??
file Calib: The file calib is where I do a lot of data manipulations but all in Julia. Ultimately I end up with a dictionary called calib and a vector string called countries. I save these dictionaries using the JLD2 package.
file: Under modeldriver i load my data into the Julia workspace for example Countries. I have included the data for Countries as well in this zip package
I then finally try to load the mod file through dynare. I would like this mod file to access the loaded vector of countries in the workspace but it can’t work. Thats where am stuck. My understanding is that with MATLAB MOD files can access the “MAT” data files through the set_param_data() command. Am not sure how to do this in Julia and with which data formats.
Your files were missing dependencies so I couldn’t run them. I made a simpler version
In your code, country is a Dynare macro variable. Such a variable is passed to Dynare by the driver with the -D option. Watch for the " that need to be escaped
For the parameter values, I added a new function set_parameters!(). For now it is in a separate file, but I will add it soon to DynareJulia
I send an example using both syntaxes forum_mj.zip (1 KB)
Greetings Michel–I have now attempted to extend the example to a multi-country model. My biggest challenge is to access the deserialized dictionaries in the MOD file and set the parameters to values in the dictionaries. This is what I have attempted to do–but with some challenges. Attached are the modified files with a dictionary. temp1.zip (2.0 KB)