Commit e192f739 authored by Johannes Pfeifer's avatar Johannes Pfeifer
Browse files

Filter out shocks specified twice for IRF generation

parent f6cacbd4
function irf_shocks_indx=getIrfShocksIndx()
% Copyright (C) 2011 Dynare Team
% irf_shocks_indx=getIrfShocksIndx()
% returns the unique indices of the exogenous shocks specified for IRF
% generation using the irf_shocks-command
%
% Inputs:
% none
% Outputs:
% irf_shocks_indx: [1 by n_irf_shocks] vector storing the indices
%
% Copyright (C) 2011-13 Dynare Team
%
% This file is part of Dynare.
%
......@@ -26,4 +34,10 @@ else
for i=1:size(options_.irf_shocks,1)
irf_shocks_indx(i) = find(strcmp(deblank(options_.irf_shocks(i,:)), cellstr(M_.exo_names)));
end
irf_shocks_indx_unique=unique(irf_shocks_indx);
if options_.debug && (length(irf_shocks_indx_unique) ~= length(irf_shocks_indx))
fprintf('\nSTOCH_SIMUL: Warning: The IRFs for some shocks have been requested twice.\n')
fprintf('STOCH_SIMUL: The redundant entries will be ignored.\n')
end
irf_shocks_indx=irf_shocks_indx_unique;
end
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