Declaring options_ fields outside the mod file

Hi All
I am interested in declaring a field of the options_ structure outside the mod file, in an m file.

For example, if I do not want to plot irfs, and

Case A

I use the code

clear all
options_.irf=0;
dynare minisimbasic.mod noclearall

the irfs are still plotted!

However, the alternative Case B when I code

clear
optirf=0;
save setoptions optirf
dynare minisimbasic.mod ( % loading setoptions in mod file before stoch_simul, and setting
options_.irf=optirf)

does work.

However, we are interested in Case A! Any suggestions would be very helpful.

Thanks
Reuben

Dear Reuben,
the proper way is to use a macro switch. Define within the mod-file

stoch_simul(order=1,irf=@{IRFswitch});

and then call the mod-file with

dynare minisimbasic -DIRFswitch=0

or any other number.

Usually, you also want to have in the file

@#ifndef IRFswitch
    @#define IRFswitch=20
@#endif  

in order to have a default.

1 Like