2008-05-19 15:22:57 +02:00
function PosteriorIRF ( type)
% Builds posterior IRFs after the MH algorithm.
%
% INPUTS
% o type [char] string specifying the joint density of the
% deep parameters ('prior','posterior').
%
% OUTPUTS
% None (oo_ and plots).
%
% SPECIAL REQUIREMENTS
% None
2008-08-01 20:53:30 +02:00
2010-05-31 11:50:48 +02:00
% PARALLEL CONTEXT
% This funtion has been parallelized in two different points. Then we have two core
% functions associated with it(the _core1 and _core2).
% See also the comments random_walk_metropolis_hastings.m funtion.
2010-02-15 16:52:36 +01:00
% Copyright (C) 2006-2008,2010 Dynare Team
2008-08-01 20:53:30 +02:00
%
% This file is part of Dynare.
%
% Dynare is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% Dynare is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
2008-05-19 15:22:57 +02:00
2010-02-10 18:46:24 +01:00
2008-05-19 15:22:57 +02:00
global options_ estim_params_ oo_ M_ bayestopt_
% Set the number of periods
if isempty ( options_ . irf ) | ~ options_ . irf
options_ . irf = 40 ;
end
% Set varlist if necessary
varlist = options_ . varlist ;
if isempty ( varlist )
varlist = options_ . varobs ;
end
options_ . varlist = varlist ;
nvar = size ( varlist , 1 ) ;
IndxVariables = [ ] ;
for i = 1 : nvar
idx = strmatch ( deblank ( varlist ( i , : ) ) , M_ . endo_names , ' exact' ) ;
if isempty ( idx )
disp ( [ ' PosteriorIRF :: ' deblank ( varlist ( i , : ) ) ' is not a declared endogenous variable!' ] )
else
IndxVariables = [ IndxVariables , idx ] ;
end
end
% Set various parameters & Check or create directories
nvx = estim_params_ . nvx ;
nvn = estim_params_ . nvn ;
ncx = estim_params_ . ncx ;
ncn = estim_params_ . ncn ;
np = estim_params_ . np ;
npar = nvx + nvn + ncx + ncn + np ;
offset = npar - np ;
clear ( ' nvx' , ' nvn' , ' ncx' , ' ncn' , ' np' ) ;
nvobs = size ( options_ . varobs , 1 ) ;
gend = options_ . nobs ;
MaxNumberOfPlotPerFigure = 9 ;
nn = sqrt ( MaxNumberOfPlotPerFigure ) ;
MAX_nirfs_dsge = ceil ( options_ . MaxNumberOfBytes / ( options_ . irf * nvar * M_ . exo_nbr ) / 8 ) ;
MAX_nruns = ceil ( options_ . MaxNumberOfBytes / ( npar + 2 ) / 8 ) ;
if ~ isempty ( strmatch ( ' dsge_prior_weight' , M_ . param_names ) )
MAX_nirfs_dsgevar = ceil ( options_ . MaxNumberOfBytes / ( options_ . irf * nvobs * M_ . exo_nbr ) / 8 ) ;
else
MAX_nirfs_dsgevar = 0 ;
end
DirectoryName = CheckPath ( ' Output' ) ;
if strcmpi ( type , ' posterior' )
2010-02-10 18:46:24 +01:00
MhDirectoryName = CheckPath ( ' metropolis' ) ;
2008-05-19 15:22:57 +02:00
elseif strcmpi ( type , ' gsa' )
2010-02-10 18:46:24 +01:00
MhDirectoryName = CheckPath ( ' GSA' ) ;
2008-05-19 15:22:57 +02:00
else
2010-02-10 18:46:24 +01:00
MhDirectoryName = CheckPath ( ' prior' ) ;
2008-05-19 15:22:57 +02:00
end
if strcmpi ( type , ' posterior' )
2010-02-12 19:31:39 +01:00
load ( [ MhDirectoryName filesep M_ . fname ' _mh_history.mat' ] )
2010-02-10 18:46:24 +01:00
TotalNumberOfMhDraws = sum ( record . MhDraws ( : , 1 ) ) ;
NumberOfDraws = TotalNumberOfMhDraws - floor ( options_ . mh_drop * TotalNumberOfMhDraws ) ;
2008-05-19 15:22:57 +02:00
elseif strcmpi ( type , ' gsa' )
2010-02-12 19:31:39 +01:00
load ( [ MhDirectoryName filesep M_ . fname ' _prior.mat' ] , ' lpmat0' , ' lpmat' , ' istable' )
2010-02-10 18:46:24 +01:00
x = [ lpmat0 ( istable , : ) lpmat ( istable , : ) ] ;
clear lpmat istable
NumberOfDraws = size ( x , 1 ) ;
B = NumberOfDraws ; options_ . B = B ;
2008-05-19 15:22:57 +02:00
else % type = 'prior'
2010-02-10 18:46:24 +01:00
NumberOfDraws = 500 ;
2008-05-19 15:22:57 +02:00
end
if ~ strcmpi ( type , ' gsa' )
2010-02-10 18:46:24 +01:00
B = min ( [ round ( . 5 * NumberOfDraws ) , 500 ] ) ; options_ . B = B ;
2008-05-19 15:22:57 +02:00
end
2010-02-12 19:31:39 +01:00
try delete ( [ MhDirectoryName filesep M_ . fname ' _irf_dsge*.mat' ] )
2008-05-19 15:22:57 +02:00
catch disp ( ' No _IRFs (dsge) files to be deleted!' )
end
2010-02-12 19:31:39 +01:00
try delete ( [ MhDirectoryName filesep M_ . fname ' _irf_bvardsge*.mat' ] )
2008-05-19 15:22:57 +02:00
catch disp ( ' No _IRFs (bvar-dsge) files to be deleted!' )
end
irun = 0 ;
IRUN = 0 ;
irun2 = 0 ;
NumberOfIRFfiles_dsge = 1 ;
NumberOfIRFfiles_dsgevar = 1 ;
ifil2 = 1 ;
% Create arrays
if B < = MAX_nruns
2010-02-10 18:46:24 +01:00
stock_param = zeros ( B , npar ) ;
2008-05-19 15:22:57 +02:00
else
2010-02-10 18:46:24 +01:00
stock_param = zeros ( MAX_nruns , npar ) ;
2008-05-19 15:22:57 +02:00
end
if B > = MAX_nirfs_dsge
2010-02-10 18:46:24 +01:00
stock_irf_dsge = zeros ( options_ . irf , nvar , M_ . exo_nbr , MAX_nirfs_dsge ) ;
2008-05-19 15:22:57 +02:00
else
2010-02-10 18:46:24 +01:00
stock_irf_dsge = zeros ( options_ . irf , nvar , M_ . exo_nbr , B ) ;
2008-05-19 15:22:57 +02:00
end
if MAX_nirfs_dsgevar
if B > = MAX_nirfs_dsgevar
stock_irf_bvardsge = zeros ( options_ . irf , nvobs , M_ . exo_nbr , MAX_nirfs_dsgevar ) ;
else
stock_irf_bvardsge = zeros ( options_ . irf , nvobs , M_ . exo_nbr , B ) ;
end
[ mYY , mXY , mYX , mXX , Ydata , Xdata ] = ...
2008-06-17 23:44:00 +02:00
var_sample_moments ( options_ . first_obs , options_ . first_obs + options_ . nobs - 1 , ...
2009-07-09 17:03:11 +02:00
options_ . varlag , - 1 , options_ . datafile , options_ . varobs , ...
options_ . xls_sheet , options_ . xls_range ) ;
2008-05-19 15:22:57 +02:00
NumberOfLags = options_ . varlag ;
NumberOfLagsTimesNvobs = NumberOfLags * nvobs ;
if options_ . noconstant
NumberOfParametersPerEquation = NumberOfLagsTimesNvobs ;
else
NumberOfParametersPerEquation = NumberOfLagsTimesNvobs + 1 ;
end
Companion_matrix = diag ( ones ( nvobs * ( NumberOfLags - 1 ) , 1 ) , - nvobs ) ;
end
2010-02-10 18:46:24 +01:00
2010-05-31 11:50:48 +02:00
% First block of code executed in parallel. The function devoted to do it is PosteriorIRF_core1.m
% function.
2010-02-10 18:46:24 +01:00
2008-05-19 15:22:57 +02:00
b = 0 ;
nosaddle = 0 ;
2010-02-10 18:46:24 +01:00
localVars = [ ] ;
% Save the local variables.
2010-02-12 17:41:38 +01:00
localVars . IRUN = IRUN ;
2010-02-10 18:46:24 +01:00
localVars . irun = irun ;
localVars . irun2 = irun2 ;
localVars . nosaddle = nosaddle ;
2010-05-31 11:50:48 +02:00
localVars . type = type ;
2010-02-10 18:46:24 +01:00
if strcmpi ( type , ' posterior' ) ,
2010-05-31 11:50:48 +02:00
while b < B
2008-05-19 15:22:57 +02:00
b = b + 1 ;
2010-02-10 18:46:24 +01:00
x ( b , : ) = GetOneDraw ( type ) ;
end
end
if ~ strcmpi ( type , ' prior' ) ,
localVars . x = x ;
end
b = 0 ;
localVars . nvar = nvar ;
localVars . IndxVariables = IndxVariables ;
localVars . MAX_nirfs_dsgevar = MAX_nirfs_dsgevar ;
localVars . MAX_nirfs_dsge = MAX_nirfs_dsge ;
localVars . MAX_nruns = MAX_nruns ;
localVars . NumberOfIRFfiles_dsge = NumberOfIRFfiles_dsge ;
localVars . NumberOfIRFfiles_dsgevar = NumberOfIRFfiles_dsgevar ;
localVars . ifil2 = ifil2 ;
2010-05-31 11:50:48 +02:00
% Like sequential execution!
if isnumeric ( options_ . parallel ) , % | isunix, % For the moment exclude unix platform from parallel implementation.
2010-02-10 18:46:24 +01:00
[ fout ] = PosteriorIRF_core1 ( localVars , 1 , B , 0 ) ;
else
2010-05-31 11:50:48 +02:00
% Parallel execution!
2010-02-10 18:46:24 +01:00
[ nCPU , totCPU , nBlockPerCPU ] = distributeJobs ( options_ . parallel , 1 , B ) ;
for j = 1 : totCPU - 1 ,
nfiles = ceil ( nBlockPerCPU ( j ) / MAX_nirfs_dsge ) ;
NumberOfIRFfiles_dsge ( j + 1 ) = NumberOfIRFfiles_dsge ( j ) + nfiles ;
nfiles = ceil ( nBlockPerCPU ( j ) / MAX_nirfs_dsgevar ) ;
NumberOfIRFfiles_dsgevar ( j + 1 ) = NumberOfIRFfiles_dsgevar ( j ) + nfiles ;
nfiles = ceil ( nBlockPerCPU ( j ) / MAX_nruns ) ;
ifil2 ( j + 1 ) = ifil2 ( j ) + nfiles ;
2008-05-19 15:22:57 +02:00
end
2010-02-10 18:46:24 +01:00
localVars . NumberOfIRFfiles_dsge = NumberOfIRFfiles_dsge ;
localVars . NumberOfIRFfiles_dsgevar = NumberOfIRFfiles_dsgevar ;
localVars . ifil2 = ifil2 ;
globalVars = struct ( ' M_' , M_ , ...
' options_' , options_ , ...
' bayestopt_' , bayestopt_ , ...
' estim_params_' , estim_params_ , ...
' oo_' , oo_ ) ;
% which files have to be copied to run remotely
NamFileInput ( 1 , : ) = { ' ' , [ M_ . fname ' _static.m' ] } ;
NamFileInput ( 2 , : ) = { ' ' , [ M_ . fname ' _dynamic.m' ] } ;
if options_ . steadystate_flag ,
NamFileInput ( length ( NamFileInput ) + 1 , : ) = { ' ' , [ M_ . fname ' _steadystate.m' ] } ;
2008-05-19 15:22:57 +02:00
end
2010-02-12 17:41:38 +01:00
[ fout ] = masterParallel ( options_ . parallel , 1 , B , NamFileInput , ' PosteriorIRF_core1' , localVars , globalVars , options_ . parallel_info ) ;
2010-02-10 18:46:24 +01:00
2008-05-19 15:22:57 +02:00
end
2010-02-10 18:46:24 +01:00
2010-05-31 11:50:48 +02:00
% END first parallel section!
2010-02-10 18:46:24 +01:00
2008-05-19 15:22:57 +02:00
if nosaddle
2010-02-10 18:46:24 +01:00
disp ( [ ' PosteriorIRF :: Percentage of discarded posterior draws = ' num2str ( nosaddle / ( B + nosaddle ) ) ] )
end
2008-05-19 15:22:57 +02:00
ReshapeMatFiles ( ' irf_dsge' )
if MAX_nirfs_dsgevar
ReshapeMatFiles ( ' irf_bvardsge' )
end
if strcmpi ( type , ' gsa' )
2010-02-10 18:46:24 +01:00
return
2008-05-19 15:22:57 +02:00
end
2010-02-12 19:31:39 +01:00
IRF_DSGEs = dir ( [ MhDirectoryName filesep M_ . fname ' _IRF_DSGEs*.mat' ] ) ;
2008-05-19 15:22:57 +02:00
NumberOfIRFfiles_dsge = length ( IRF_DSGEs ) ;
2010-02-12 19:31:39 +01:00
IRF_BVARDSGEs = dir ( [ MhDirectoryName filesep M_ . fname ' _IRF_BVARDSGEs*.mat' ] ) ;
2008-05-19 15:22:57 +02:00
NumberOfIRFfiles_dsgevar = length ( IRF_BVARDSGEs ) ;
MeanIRF = zeros ( options_ . irf , nvar , M_ . exo_nbr ) ;
MedianIRF = zeros ( options_ . irf , nvar , M_ . exo_nbr ) ;
VarIRF = zeros ( options_ . irf , nvar , M_ . exo_nbr ) ;
DistribIRF = zeros ( options_ . irf , 9 , nvar , M_ . exo_nbr ) ;
HPDIRF = zeros ( options_ . irf , 2 , nvar , M_ . exo_nbr ) ;
if options_ . TeX
2010-02-10 18:46:24 +01:00
varlist_TeX = [ ] ;
for i = 1 : nvar
varlist_TeX = strvcat ( varlist_TeX , M_ . endo_names_tex ( IndxVariables ( i ) , : ) ) ;
end
2008-05-19 15:22:57 +02:00
end
fprintf ( ' MH: Posterior (dsge) IRFs...\n' ) ;
tit ( M_ . exo_names_orig_ord , : ) = M_ . exo_names ;
kdx = 0 ;
for file = 1 : NumberOfIRFfiles_dsge
2010-02-12 19:31:39 +01:00
load ( [ MhDirectoryName filesep M_ . fname ' _IRF_DSGEs' int2str ( file ) ' .mat' ] ) ;
2010-02-10 18:46:24 +01:00
for i = 1 : M_ . exo_nbr
for j = 1 : nvar
for k = 1 : size ( STOCK_IRF_DSGE , 1 )
kk = k + kdx ;
[ MeanIRF ( kk , j , i ) , MedianIRF ( kk , j , i ) , VarIRF ( kk , j , i ) , HPDIRF ( kk , : , j , i ) , ...
DistribIRF ( kk , : , j , i ) ] = posterior_moments ( squeeze ( STOCK_IRF_DSGE ( k , j , i , : ) ) , 0 , options_ . mh_conf_sig ) ;
2008-05-19 15:22:57 +02:00
end
end
2010-02-10 18:46:24 +01:00
end
kdx = kdx + size ( STOCK_IRF_DSGE , 1 ) ;
2008-05-19 15:22:57 +02:00
end
clear STOCK_IRF_DSGE ;
for i = 1 : M_ . exo_nbr
2010-02-10 18:46:24 +01:00
for j = 1 : nvar
name = [ deblank ( M_ . endo_names ( IndxVariables ( j ) , : ) ) ' _' deblank ( tit ( i , : ) ) ] ;
eval ( [ ' oo_.PosteriorIRF.dsge.Mean.' name ' = MeanIRF(:,j,i);' ] ) ;
eval ( [ ' oo_.PosteriorIRF.dsge.Median.' name ' = MedianIRF(:,j,i);' ] ) ;
eval ( [ ' oo_.PosteriorIRF.dsge.Var.' name ' = VarIRF(:,j,i);' ] ) ;
eval ( [ ' oo_.PosteriorIRF.dsge.Distribution.' name ' = DistribIRF(:,:,j,i);' ] ) ;
eval ( [ ' oo_.PosteriorIRF.dsge.HPDinf.' name ' = HPDIRF(:,1,j,i);' ] ) ;
eval ( [ ' oo_.PosteriorIRF.dsge.HPDsup.' name ' = HPDIRF(:,2,j,i);' ] ) ;
end
2008-05-19 15:22:57 +02:00
end
if MAX_nirfs_dsgevar
MeanIRFdsgevar = zeros ( options_ . irf , nvar , M_ . exo_nbr ) ;
MedianIRFdsgevar = zeros ( options_ . irf , nvar , M_ . exo_nbr ) ;
VarIRFdsgevar = zeros ( options_ . irf , nvar , M_ . exo_nbr ) ;
DistribIRFdsgevar = zeros ( options_ . irf , 9 , nvar , M_ . exo_nbr ) ;
HPDIRFdsgevar = zeros ( options_ . irf , 2 , nvar , M_ . exo_nbr ) ;
fprintf ( ' MH: Posterior (bvar-dsge) IRFs...\n' ) ;
tit ( M_ . exo_names_orig_ord , : ) = M_ . exo_names ;
kdx = 0 ;
for file = 1 : NumberOfIRFfiles_dsgevar
2010-02-12 19:31:39 +01:00
load ( [ MhDirectoryName filesep M_ . fname ' _IRF_BVARDSGEs' int2str ( file ) ' .mat' ] ) ;
2008-05-19 15:22:57 +02:00
for i = 1 : M_ . exo_nbr
for j = 1 : nvar
for k = 1 : size ( STOCK_IRF_BVARDSGE , 1 )
kk = k + kdx ;
[ MeanIRFdsgevar ( kk , j , i ) , MedianIRFdsgevar ( kk , j , i ) , VarIRFdsgevar ( kk , j , i ) , ...
HPDIRFdsgevar ( kk , : , j , i ) , DistribIRFdsgevar ( kk , : , j , i ) ] = ...
posterior_moments ( squeeze ( STOCK_IRF_BVARDSGE ( k , j , i , : ) ) , 0 , options_ . mh_conf_sig ) ;
end
end
end
kdx = kdx + size ( STOCK_IRF_BVARDSGE , 1 ) ;
end
clear STOCK_IRF_BVARDSGE ;
for i = 1 : M_ . exo_nbr
for j = 1 : nvar
name = [ deblank ( M_ . endo_names ( IndxVariables ( j ) , : ) ) ' _' deblank ( tit ( i , : ) ) ] ;
eval ( [ ' oo_.PosteriorIRF.bvardsge.Mean.' name ' = MeanIRFdsgevar(:,j,i);' ] ) ;
eval ( [ ' oo_.PosteriorIRF.bvardsge.Median.' name ' = MedianIRFdsgevar(:,j,i);' ] ) ;
eval ( [ ' oo_.PosteriorIRF.bvardsge.Var.' name ' = VarIRFdsgevar(:,j,i);' ] ) ;
eval ( [ ' oo_.PosteriorIRF.bvardsge.Distribution.' name ' = DistribIRFdsgevar(:,:,j,i);' ] ) ;
eval ( [ ' oo_.PosteriorIRF.bvardsge.HPDinf.' name ' = HPDIRFdsgevar(:,1,j,i);' ] ) ;
eval ( [ ' oo_.PosteriorIRF.bvardsge.HPDsup.' name ' = HPDIRFdsgevar(:,2,j,i);' ] ) ;
end
end
end
%%
2010-02-10 18:46:24 +01:00
%% Finally I build the plots.
2008-05-19 15:22:57 +02:00
%%
2010-02-10 18:46:24 +01:00
2010-05-31 11:50:48 +02:00
% Second block of code executed in parallel, with the exception of file
% .tex generation always run in sequentially. This portion of code is execute in parallel by
% PosteriorIRF_core2.m function.
2010-02-10 18:46:24 +01:00
% Save the local variables.
localVars = [ ] ;
Check = options_ . TeX
if ( Check )
localVars . varlist_TeX = varlist_TeX ;
end
localVars . nvar = nvar ;
localVars . MeanIRF = MeanIRF ;
localVars . tit = tit ;
localVars . nn = nn ;
localVars . MAX_nirfs_dsgevar = MAX_nirfs_dsgevar ;
localVars . HPDIRF = HPDIRF ;
localVars . varlist = varlist ;
localVars . MaxNumberOfPlotPerFigure = MaxNumberOfPlotPerFigure ;
2010-05-31 11:50:48 +02:00
%%% The files .TeX are genereted in sequential way always!
2010-02-10 18:46:24 +01:00
2008-05-19 15:22:57 +02:00
if options_ . TeX
2010-02-12 19:31:39 +01:00
fidTeX = fopen ( [ DirectoryName filesep M_ . fname ' _BayesianIRF.TeX' ] , ' w' ) ;
2010-02-10 18:46:24 +01:00
fprintf ( fidTeX , ' %% TeX eps-loader file generated by PosteriorIRF.m (Dynare).\n' ) ;
fprintf ( fidTeX , [ ' %% ' datestr ( now , 0 ) ' \n' ] ) ;
fprintf ( fidTeX , ' \n' ) ;
titTeX ( M_ . exo_names_orig_ord , : ) = M_ . exo_names_tex ;
for i = 1 : M_ . exo_nbr
NAMES = [ ] ;
2009-12-16 18:17:34 +01:00
TEXNAMES = [ ] ;
2010-02-10 18:46:24 +01:00
for j = 1 : nvar
if max ( abs ( MeanIRF ( : , j , i ) ) ) > 10 ^( - 6 )
2009-12-16 18:17:34 +01:00
name = deblank ( varlist ( j , : ) ) ;
NAMES = strvcat ( NAMES , name ) ;
2010-02-10 18:46:24 +01:00
texname = deblank ( varlist_TeX ( j , : ) ) ;
TEXNAMES = strvcat ( TEXNAMES , [ ' $' texname ' $' ] ) ;
end
end
fprintf ( fidTeX , ' \\begin{figure}[H]\n' ) ;
for jj = 1 : size ( TEXNAMES , 1 )
fprintf ( fidTeX , [ ' \\psfrag{%s}[1][][0.5][0]{%s}\n' ] , deblank ( NAMES ( jj , : ) ) , deblank ( TEXNAMES ( jj , : ) ) ) ;
2009-12-16 18:17:34 +01:00
end
2010-02-10 18:46:24 +01:00
fprintf ( fidTeX , ' \\centering \n' ) ;
fprintf ( fidTeX , ' \\includegraphics[scale=0.5]{%s_Bayesian_IRF_%s}\n' , M_ . fname , deblank ( tit ( i , : ) ) ) ;
if options_ . relative_irf
fprintf ( fidTeX , [ ' \\caption{Bayesian relative IRF.}' ] ) ;
else
fprintf ( fidTeX , ' \\caption{Bayesian IRF.}' ) ;
2009-12-16 18:17:34 +01:00
end
2010-02-10 18:46:24 +01:00
fprintf ( fidTeX , ' \\label{Fig:BayesianIRF:%s}\n' , deblank ( tit ( i , : ) ) ) ;
fprintf ( fidTeX , ' \\end{figure}\n' ) ;
fprintf ( fidTeX , ' \n' ) ;
end
fprintf ( fidTeX , ' %% End of TeX file.\n' ) ;
fclose ( fidTeX ) ;
2008-05-19 15:22:57 +02:00
end
2010-02-10 18:46:24 +01:00
2010-05-31 11:50:48 +02:00
% The others file format are generated in parallel by PosteriorIRF_core2!
2010-02-10 18:46:24 +01:00
2010-05-31 11:50:48 +02:00
% Comment for testing!
if isnumeric ( options_ . parallel ) % || (M_.exo_nbr*ceil(size(varlist,1)/MaxNumberOfPlotPerFigure))<8,% | isunix, % for the moment exclude unix platform from parallel implementation
2010-02-10 18:46:24 +01:00
[ fout ] = PosteriorIRF_core2 ( localVars , 1 , M_ . exo_nbr , 0 ) ;
else
2010-02-12 17:41:38 +01:00
globalVars = struct ( ' M_' , M_ , ...
' options_' , options_ ) ;
2010-02-10 18:46:24 +01:00
2010-02-12 17:41:38 +01:00
[ fout ] = masterParallel ( options_ . parallel , 1 , M_ . exo_nbr , NamFileInput , ' PosteriorIRF_core2' , localVars , globalVars , options_ . parallel_info ) ;
2010-02-10 18:46:24 +01:00
end
% END parallel code!
fprintf ( ' MH: Posterior IRFs, done!\n' ) ;