Commit 80a2a6b7 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Merge remote-tracking branch 'jpfeifer/irf_debug_feedback'

parents de666652 fe24f800
......@@ -3328,6 +3328,10 @@ The exogenous variables for which to compute IRFs. Default: all.
Requests the computation of normalized IRFs in percentage of the
standard error of each shock.
@item irf_plot_threshold = @var{DOUBLE}
@anchor{irf_plot_threshold}
Threshold size for plotting IRFs. All IRFs for a particular variable with a maximum absolute deviation from the steady state smaller than this value are not displayed. Default: @code{1e-10}.
@item nocorr
Don't print the correlation matrix (printing them is the default).
......@@ -4875,6 +4879,9 @@ using a standard Kalman filter.
@xref{irf_shocks}. Only used if @ref{bayesian_irf} is passed. Cannot be used
with @ref{dsge_var}.
@item irf_plot_threshold = @var{DOUBLE}
@xref{irf_plot_threshold}. Only used if @ref{bayesian_irf} is passed.
@item aim_solver
@xref{aim_solver}.
......
......@@ -404,7 +404,7 @@ if options_.TeX
TEXNAMES = [];
for j=1:nvar
if max(abs(MeanIRF(:,j,i))) > 10^(-6)
if max(abs(MeanIRF(:,j,i))) > options_.impulse_responses.plot_threshold
name = deblank(varlist(j,:));
texname = deblank(varlist_TeX(j,:));
......
function myoutput=PosteriorIRF_core1(myinputs,fpar,B,whoiam, ThisMatlab)
% Generates and stores Posterior IRFs
% PARALLEL CONTEXT
% This function perfom in parallel a portion of PosteriorIRF.m code.
% This function perfoms in parallel execution a portion of the PosteriorIRF.m code.
% This is a special kind of parallel function. Unlike of other parallel functions,
% that running in parallel a 'for' cycle, this function run in parallel a
% 'while' loop! The parallelization of 'while' loop (when possible) is a more
......
function myoutput=PosteriorIRF_core2(myinputs,fpar,npar,whoiam, ThisMatlab)
% Generates the Posterior IRFs plot from the IRFs generated in
% PosteriorIRF_core1
% PARALLEL CONTEXT
% Perfome in parallel a portion of PosteriorIRF.m code.
% Perform in parallel execution a portion of the PosteriorIRF.m code.
% See also the comment in random_walk_metropolis_hastings_core.m funtion.
%
% INPUTS
......@@ -17,7 +19,7 @@ function myoutput=PosteriorIRF_core2(myinputs,fpar,npar,whoiam, ThisMatlab)
% SPECIAL REQUIREMENTS.
% None.
%
% Copyright (C) 2006-2012 Dynare Team
% Copyright (C) 2006-2013 Dynare Team
%
% This file is part of Dynare.
%
......@@ -87,7 +89,7 @@ for i=fpar:npar,
figunumber = 0;
for j=1:nvar
if max(abs(MeanIRF(:,j,i))) > 10^(-6)
if max(abs(MeanIRF(:,j,i))) > options_.impulse_responses.plot_threshold
subplotnum = subplotnum+1;
if subplotnum == 1 && options_.relative_irf
hh = dyn_figure(options_,'Name',['Relative response to orthogonalized shock to ' tit(i,:)]);
......@@ -131,6 +133,10 @@ for i=fpar:npar,
end
name = deblank(varlist(j,:));
title(name,'Interpreter','none')
else
if options_.debug
fprintf('POSTERIOR_IRF: The IRF of %s to %s is smaller than the irf_plot_threshold of %4.3f and will not be displayed.\n',deblank(varlist(j,:)),tit(i,:),options_.impulse_responses.plot_threshold)
end
end
if subplotnum == MaxNumberOfPlotPerFigure || (j == nvar && subplotnum> 0)
......
......@@ -140,6 +140,7 @@ end
% IRFs & other stoch_simul output
options_.irf = 40;
options_.impulse_responses.plot_threshold=1e-10;
options_.relative_irf = 0;
options_.ar = 5;
options_.hp_filter = 0;
......
......@@ -195,7 +195,7 @@ if options_.irf
y(i_var(j),:)');
eval(['oo_.irfs.' deblank(M_.endo_names(i_var(j),:)) '_' ...
deblank(M_.exo_names(i,:)) ' = y(i_var(j),:);']);
if max(y(i_var(j),:)) - min(y(i_var(j),:)) > 1e-10
if max(y(i_var(j),:)) - min(y(i_var(j),:)) > options_.impulse_responses.plot_threshold
irfs = cat(1,irfs,y(i_var(j),:));
if isempty(mylist)
mylist = deblank(var_list(j,:));
......@@ -209,6 +209,10 @@ if options_.irf
mylistTeX = char(mylistTeX,deblank(var_listTeX(j,:)));
end
end
else
if options_.debug
fprintf('STOCH_SIMUL: The IRF of %s to %s is smaller than the irf_plot_threshold of %4.3f and will not be displayed.\n',deblank(M_.endo_names(i_var(j),:)),deblank(M_.exo_names(i,:)),options_.impulse_responses.plot_threshold)
end
end
end
if options_.nograph == 0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment