Merge pull request #497 from JohannesPfeifer/get_IRF_shocks_unique
Filter out shocks specified twice for IRF generationtime-shift
commit
025f0d5bf8
|
@ -1,6 +1,14 @@
|
||||||
function irf_shocks_indx=getIrfShocksIndx()
|
function irf_shocks_indx=getIrfShocksIndx()
|
||||||
|
% irf_shocks_indx=getIrfShocksIndx()
|
||||||
% Copyright (C) 2011 Dynare Team
|
% 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.
|
% This file is part of Dynare.
|
||||||
%
|
%
|
||||||
|
@ -26,4 +34,10 @@ else
|
||||||
for i=1:size(options_.irf_shocks,1)
|
for i=1:size(options_.irf_shocks,1)
|
||||||
irf_shocks_indx(i) = find(strcmp(deblank(options_.irf_shocks(i,:)), cellstr(M_.exo_names)));
|
irf_shocks_indx(i) = find(strcmp(deblank(options_.irf_shocks(i,:)), cellstr(M_.exo_names)));
|
||||||
end
|
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
|
end
|
||||||
|
|
Loading…
Reference in New Issue