Page 1 of 1

Is there a way to suppress *all* Dynare output in Matlab?

PostPosted: Sun Jun 26, 2011 12:35 am
by dsge_fool
I am using Dynare for an impulse response matching exercise. This requires running Dynare many times over for different parameter configurations in quick succession.

I know how to suppress all Dynare output related to the solution of the model, but is there a way to suppress the several lines of text it produces when you first call Dynare? You know, this part:


Starting Dynare (version 4.2.1).
Starting preprocessing of the model file ...
Found 13 equation(s).
Evaluating expressions...done
Computing static model derivatives:
- order 1
Computing dynamic model derivatives:
- order 1
Processing outputs ...done
Preprocessing completed.
Starting MATLAB/Octave computing.

I think eliminating this would speed up the exercise.

Thanks.

Re: Is there a way to suppress *all* Dynare output in Matlab

PostPosted: Fri Jul 01, 2011 6:19 am
by jpfeifer
Hi, suppressing the output is not really what you want (and it is not possible by the way). In the end, you want to avoid preprocessing the model file in each run, because this is what takes the time and needs to be done only once. What you could do is either

1. Integrate the IRF matching into the Dynare mod-file by looping over a stoch_simul command that generates the IRFs.

2. Run Dynare with the preprocessor once. Then directly modify the m-file generated by this run. This has essentially the same effect as 1.

The trick is to use
Code: Select all
set_param('parameter_name',parametervalue)
before running stoch_simul again. If you use approach 2, you can replace the single stoch_simul command in the m-file by your code looping over the parameter-value setting and the stoch_simul IRF generation to minimize the distance.
IMPORTANT: If you use approach 2, you should add the folder with the Dynare mex-file to your path as this is usually done by the Dynare preprocessor and will be missing if you directly run the m-file.

Re: Is there a way to suppress *all* Dynare output in Matlab

PostPosted: Sun Mar 13, 2016 4:18 pm
by fededipa
Hi there,

I am trying to code impulse response matching but the parameter that I want to loop over affect the steady state of the model? Do I have run dynare every time I loop over a set of parameters? I am not sure looping over stoch_simul is what I should be doing?

Help is much appreciated. Many thanks.

Fede

Re: Is there a way to suppress *all* Dynare output in Matlab

PostPosted: Mon Mar 14, 2016 8:01 pm
by jpfeifer
Yes, you should be looping over stoch_simul using the construction outlined in
http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=4891
Whenever resol (or stoch_simul) is called, the steady state is recomputed.
You can also work from the replication codes to Born/Pfeifer (2014): "Risk Matters: A comment" at https://www.aeaweb.org/articles.php?doi=10.1257/aer.104.12.4231. Essentially, instead of solving the model and simulating it within the objective function to compute the distance between simulated and empirical moments, you retrieve the model IRFs and then compute the distance.

I plan on providing an example of this soon.