Input numbers from .m file to dynare

Hello, community!

I have ‘filename.m’ where I set ‘Mon_Pol_Shock=1’. How can I input the variable in this file to dynare such that I can write:

@#if Mon_Pol_Shock==1
stoch_simul(irf=12, irf_shocks=(epsilon_R)) y c i

In other words, I am having trouble loading external files to dynare.


Hi Nurdaulet,

In order to include a portion of a model file into another model file, use

@#include "myexternalfile.mod"

If you are wondering how to define that the macro Mon_Pol_Shock be equal to 1, you can define it so when you invoke Dynare:

dynare mymodelname -DMon_Pol_Shock = 1

See Declaring options_ fields outside the mod file - #2 by jpfeifer

Thank you, Professor! That was very useful!

Thank you so much! It worked!