Storage of results: use subfolder

Ref. #1758
trust-region-mex
Johannes Pfeifer 2021-07-22 17:46:08 +02:00 committed by Sébastien Villemot
parent 263e97dabe
commit 440a0e460b
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
91 changed files with 173 additions and 171 deletions

View File

@ -548,7 +548,8 @@ by the ``dynare`` command.
results in the workspace available for further processing. More results in the workspace available for further processing. More
details are given under the relevant computing tasks. The details are given under the relevant computing tasks. The
``M_``,``oo_``, and ``options_`` structures are saved in a file ``M_``,``oo_``, and ``options_`` structures are saved in a file
called ``FILENAME_results.mat``. If they exist, ``estim_params_``, called ``FILENAME_results.mat`` located in the ``MODFILENAME/Output`` folder.
If they exist, ``estim_params_``,
``bayestopt_``, ``dataset_``, ``oo_recursive_`` and ``bayestopt_``, ``dataset_``, ``oo_recursive_`` and
``estimation_info`` are saved in the same file. Note that Matlab ``estimation_info`` are saved in the same file. Note that Matlab
by default only allows ``.mat``-files up to 2GB. You can lift this by default only allows ``.mat``-files up to 2GB. You can lift this

View File

@ -3890,7 +3890,8 @@ Computing the stochastic solution
requested (i.e. ``periods`` :math:`>` 0). Note that if this requested (i.e. ``periods`` :math:`>` 0). Note that if this
option is greater than 1, the additional series will not be option is greater than 1, the additional series will not be
used for computing the empirical moments but will simply be used for computing the empirical moments but will simply be
saved in binary form to the file ``FILENAME_simul``. Default: saved in binary form to the file ``FILENAME_simul`` in the
``FILENAME/Output``-folder. Default:
``1``. ``1``.
.. option:: solve_algo = INTEGER .. option:: solve_algo = INTEGER
@ -5297,7 +5298,8 @@ block decomposition of the model (see :opt:`block`).
achieve an acceptance rate of achieve an acceptance rate of
:ref:`AcceptanceRateTarget<art>`. The resulting scale parameter :ref:`AcceptanceRateTarget<art>`. The resulting scale parameter
will be saved into a file named will be saved into a file named
``MODEL_FILENAME_mh_scale.mat.`` This file can be loaded in ``MODEL_FILENAME_mh_scale.mat`` in the ``FILENAME/Output``-folder.
This file can be loaded in
subsequent runs via the ``posterior_sampler_options`` option subsequent runs via the ``posterior_sampler_options`` option
:ref:`scale_file <scale-file>`. Both ``mode_compute=6`` and :ref:`scale_file <scale-file>`. Both ``mode_compute=6`` and
``scale_file`` will overwrite any value specified in ``scale_file`` will overwrite any value specified in
@ -5378,7 +5380,8 @@ block decomposition of the model (see :opt:`block`).
Name of the file containing previous value for the mode. When Name of the file containing previous value for the mode. When
computing the mode, Dynare stores the mode (``xparam1``) and computing the mode, Dynare stores the mode (``xparam1``) and
the hessian (``hh``, only if ``cova_compute=1``) in a file the hessian (``hh``, only if ``cova_compute=1``) in a file
called ``MODEL_FILENAME_mode.mat``. After a successful run of called ``MODEL_FILENAME_mode.mat`` in the ``FILENAME/Output``-folder.
After a successful run of
the estimation command, the ``mode_file`` will be disabled to the estimation command, the ``mode_file`` will be disabled to
prevent other function calls from implicitly using an updated prevent other function calls from implicitly using an updated
``mode-file``. Thus, if the mod-file contains subsequent ``mode-file``. Thus, if the mod-file contains subsequent

View File

@ -78,4 +78,4 @@ hh = inv(posterior_covariance);
fval = posterior_kernel_at_the_mode; fval = posterior_kernel_at_the_mode;
parameter_names = bayestopt_.name; parameter_names = bayestopt_.name;
save([M_.fname '_mh_mode.mat'],'xparam1','hh','fval','parameter_names'); save([M_.dname filesep 'Output' filesep M_.fname '_mh_mode.mat'],'xparam1','hh','fval','parameter_names');

View File

@ -101,7 +101,7 @@ if nnobs>1 || nfirstobs > 1
end end
dynare_estimation_1(var_list,M_.dname); dynare_estimation_1(var_list,M_.dname);
if isequal(i,1) && options_.mode_compute ~= 0 if isequal(i,1) && options_.mode_compute ~= 0
options_.mode_file = [M_.fname '_mode']; options_.mode_file = [M_.dname filesep 'Output' filesep M_.fname '_mode'];
end end
if options_.recursive_estimation_restart if options_.recursive_estimation_restart
for j=1:options_.recursive_estimation_restart for j=1:options_.recursive_estimation_restart

View File

@ -31,6 +31,10 @@ function dynare_estimation_1(var_list_,dname)
global M_ options_ oo_ estim_params_ bayestopt_ dataset_ dataset_info global M_ options_ oo_ estim_params_ bayestopt_ dataset_ dataset_info
if ~exist([M_.dname filesep 'Output'],'dir')
mkdir(M_.dname,'Output');
end
if isempty(estim_params_) if isempty(estim_params_)
mode_compute_o = options_.mode_compute; mode_compute_o = options_.mode_compute;
mh_replic_o = options_.mh_replic; mh_replic_o = options_.mh_replic;
@ -206,7 +210,7 @@ if ~isequal(options_.mode_compute,0) && ~options_.mh_posterior_mode_estimation
newratflag = new_rat_hess_info.newratflag; newratflag = new_rat_hess_info.newratflag;
new_rat_hess_info = new_rat_hess_info.new_rat_hess_info; new_rat_hess_info = new_rat_hess_info.new_rat_hess_info;
elseif isnumeric(options_.mode_compute) && options_.mode_compute==6 %save scaling factor elseif isnumeric(options_.mode_compute) && options_.mode_compute==6 %save scaling factor
save([M_.fname '_optimal_mh_scale_parameter.mat'],'Scale'); save([M_.dname filesep 'Output' filesep M_.fname '_optimal_mh_scale_parameter.mat'],'Scale');
options_.mh_jscale = Scale; options_.mh_jscale = Scale;
bayestopt_.jscale(:) = options_.mh_jscale; bayestopt_.jscale(:) = options_.mh_jscale;
end end
@ -260,9 +264,9 @@ if ~isequal(options_.mode_compute,0) && ~options_.mh_posterior_mode_estimation
end end
parameter_names = bayestopt_.name; parameter_names = bayestopt_.name;
if options_.cova_compute || options_.mode_compute==5 || options_.mode_compute==6 if options_.cova_compute || options_.mode_compute==5 || options_.mode_compute==6
save([M_.fname '_mode.mat'],'xparam1','hh','parameter_names','fval'); save([M_.dname filesep 'Output' filesep M_.fname '_mode.mat'],'xparam1','hh','parameter_names','fval');
else else
save([M_.fname '_mode.mat'],'xparam1','parameter_names','fval'); save([M_.dname filesep 'Output' filesep M_.fname '_mode.mat'],'xparam1','parameter_names','fval');
end end
end end
@ -375,7 +379,7 @@ end
if np > 0 if np > 0
pindx = estim_params_.param_vals(:,1); pindx = estim_params_.param_vals(:,1);
save([M_.fname '_params.mat'],'pindx'); save([M_.dname filesep 'Output' filesep M_.fname '_params.mat'],'pindx');
end end
switch options_.MCMC_jumping_covariance switch options_.MCMC_jumping_covariance
@ -472,7 +476,7 @@ if (any(bayestopt_.pshape >0 ) && options_.mh_replic) || ...
else else
%get stored results if required %get stored results if required
if options_.load_mh_file && options_.load_results_after_load_mh if options_.load_mh_file && options_.load_results_after_load_mh
oo_load_mh=load([M_.fname '_results'],'oo_'); oo_load_mh=load([M_.dname filesep 'Output' filesep M_.fname '_results'],'oo_');
end end
if ~options_.nodiagnostic if ~options_.nodiagnostic
if (options_.mh_replic>0 || (options_.load_mh_file && ~options_.load_results_after_load_mh)) if (options_.mh_replic>0 || (options_.load_mh_file && ~options_.load_results_after_load_mh))
@ -778,7 +782,7 @@ end
if np > 0 if np > 0
pindx = estim_params_.param_vals(:,1); pindx = estim_params_.param_vals(:,1);
save([M_.fname '_pindx.mat'] ,'pindx'); save([M_.dname filesep 'Output' filesep M_.fname '_pindx.mat'] ,'pindx');
end end
%reset qz_criterium %reset qz_criterium

View File

@ -92,11 +92,11 @@ if ~isempty(options_.mode_file)
load(options_.mode_file,'xparam1') load(options_.mode_file,'xparam1')
end end
if options_.opt_gsa.ppost if options_.opt_gsa.ppost
c=load([fname_,'_mean.mat'],'xparam1'); c=load([M_.dname filesep 'Output' filesep fname_,'_mean.mat'],'xparam1');
xparam1_mean=c.xparam1; xparam1_mean=c.xparam1;
clear c clear c
elseif ~isempty(options_.mode_file) && exist([fname_,'_mean.mat'])==2 elseif ~isempty(options_.mode_file) && exist([M_.dname filesep 'Output' filesep fname_,'_mean.mat'])==2
c=load([fname_,'_mean.mat'],'xparam1'); c=load([M_.dname filesep 'Output' filesep fname_,'_mean.mat'],'xparam1');
xparam1_mean=c.xparam1; xparam1_mean=c.xparam1;
clear c clear c
end end

View File

@ -66,7 +66,7 @@ end
% (usefull if the user wants to perform some computations using % (usefull if the user wants to perform some computations using
% the posterior mean instead of the posterior mode ==> ). % the posterior mean instead of the posterior mode ==> ).
parameter_names = bayestopt_.name; parameter_names = bayestopt_.name;
save([M_.fname '_mean.mat'],'xparam1','hh','parameter_names','SIGMA'); save([M_.dname filesep 'Output' filesep M_.fname '_mean.mat'],'xparam1','hh','parameter_names','SIGMA');
fprintf('Estimation::marginal density: I''m computing the posterior log marginal density (modified harmonic mean)... '); fprintf('Estimation::marginal density: I''m computing the posterior log marginal density (modified harmonic mean)... ');
logdetSIGMA = log(det(SIGMA)); logdetSIGMA = log(det(SIGMA));

View File

@ -81,9 +81,9 @@ for i=1:NumberOfModels
mstruct.oo_ = oo; mstruct.oo_ = oo;
else else
if strcmpi(ModelNames{i}(end-3:end),'.mod') || strcmpi(ModelNames{i}(end-3:end),'.dyn') if strcmpi(ModelNames{i}(end-3:end),'.mod') || strcmpi(ModelNames{i}(end-3:end),'.dyn')
mstruct = load([ModelNames{i}(1:end-4) '_results.mat' ],'oo_'); mstruct = load([ModelNames{i}(1:end-4) filesep 'Output' ModelNames{i}(1:end-4) '_results.mat' ],'oo_');
else else
mstruct = load([ModelNames{i} '_results.mat' ],'oo_'); mstruct = load([ModelNames{i} filesep 'Output' filesep ModelNames{i} '_results.mat' ],'oo_');
end end
end end
try try

View File

@ -154,7 +154,7 @@ else
end end
if options_.debug if options_.debug
save([M_.fname '_debug.mat'],'jacobia_') save([M_.dname filesep 'Output' filesep M_.fname '_debug.mat'],'jacobia_')
end end
dr=set_state_space(dr,M_,options_); dr=set_state_space(dr,M_,options_);

View File

@ -66,7 +66,7 @@ order = DynareOptions.order;
replic = DynareOptions.simul_replic; replic = DynareOptions.simul_replic;
if replic > 1 if replic > 1
fname = [DynareModel.fname,'_simul']; fname = [DynareModel.dname filesep 'Output' DynareModel.fname,'_simul'];
fh = fopen(fname,'w+'); fh = fopen(fname,'w+');
end end

View File

@ -128,7 +128,7 @@ elseif local_order == 2
if ~isempty(infrow) if ~isempty(infrow)
fprintf('\nSTOCHASTIC_SOLVER: The Hessian of the dynamic model contains Inf.\n') fprintf('\nSTOCHASTIC_SOLVER: The Hessian of the dynamic model contains Inf.\n')
fprintf('STOCHASTIC_SOLVER: Try running model_diagnostics to find the source of the problem.\n') fprintf('STOCHASTIC_SOLVER: Try running model_diagnostics to find the source of the problem.\n')
save([M_.fname '_debug.mat'],'hessian1') save([M_.dname filesep 'Output' filesep M_.fname '_debug.mat'],'hessian1')
end end
end end
if ~isempty(infrow) if ~isempty(infrow)
@ -140,7 +140,7 @@ elseif local_order == 2
if ~isempty(nanrow) if ~isempty(nanrow)
fprintf('\nSTOCHASTIC_SOLVER: The Hessian of the dynamic model contains NaN.\n') fprintf('\nSTOCHASTIC_SOLVER: The Hessian of the dynamic model contains NaN.\n')
fprintf('STOCHASTIC_SOLVER: Try running model_diagnostics to find the source of the problem.\n') fprintf('STOCHASTIC_SOLVER: Try running model_diagnostics to find the source of the problem.\n')
save([M_.fname '_debug.mat'],'hessian1') save([M_.dname filesep 'Output' filesep M_.fname '_debug.mat'],'hessian1')
end end
end end
if ~isempty(nanrow) if ~isempty(nanrow)
@ -155,7 +155,7 @@ if options_.debug
if ~isempty(infrow) if ~isempty(infrow)
fprintf('\nSTOCHASTIC_SOLVER: The Jacobian of the dynamic model contains Inf. The problem is associated with:\n\n') fprintf('\nSTOCHASTIC_SOLVER: The Jacobian of the dynamic model contains Inf. The problem is associated with:\n\n')
display_problematic_vars_Jacobian(infrow,infcol,M_,dr.ys,'dynamic','STOCHASTIC_SOLVER: ') display_problematic_vars_Jacobian(infrow,infcol,M_,dr.ys,'dynamic','STOCHASTIC_SOLVER: ')
save([M_.fname '_debug.mat'],'jacobia_') save([M_.dname filesep 'Output' filesep M_.fname '_debug.mat'],'jacobia_')
end end
end end
@ -184,7 +184,7 @@ if options_.debug
if ~isempty(nanrow) if ~isempty(nanrow)
fprintf('\nSTOCHASTIC_SOLVER: The Jacobian of the dynamic model contains NaN. The problem is associated with:\n\n') fprintf('\nSTOCHASTIC_SOLVER: The Jacobian of the dynamic model contains NaN. The problem is associated with:\n\n')
display_problematic_vars_Jacobian(nanrow,nancol,M_,dr.ys,'dynamic','STOCHASTIC_SOLVER: ') display_problematic_vars_Jacobian(nanrow,nancol,M_,dr.ys,'dynamic','STOCHASTIC_SOLVER: ')
save([M_.fname '_debug.mat'],'jacobia_') save([M_.dname filesep 'Output' filesep M_.fname '_debug.mat'],'jacobia_')
end end
end end

@ -1 +1 @@
Subproject commit 5cfe6303e26fcaeff204e6d2ca3988b169621f46 Subproject commit bb19d98712f2599380dfc704f98b33531d7414de

View File

@ -92,7 +92,7 @@ steady(nocheck);
stoch_simul(aim_solver, order=1, irf=0); stoch_simul(aim_solver, order=1, irf=0);
benchmark = load('fs2000_b1L1L_results'); benchmark = load(['fs2000_b1L1L' filesep 'Output' filesep 'fs2000_b1L1L_results']);
threshold = 1e-8; threshold = 1e-8;
if max(max(abs(benchmark.oo_.dr.ghx-oo_.dr.ghx) > threshold)); if max(max(abs(benchmark.oo_.dr.ghx-oo_.dr.ghx) > threshold));

View File

@ -76,7 +76,7 @@ check;
stoch_simul(aim_solver, order=1,irf=0); stoch_simul(aim_solver, order=1,irf=0);
benchmark = load('fs2000x10L9_L_results'); benchmark = load(['fs2000x10L9_L' filesep 'Output' filesep 'fs2000x10L9_L_results']);
threshold = 1e-8; threshold = 1e-8;
if max(max(abs(benchmark.oo_.dr.ghx-oo_.dr.ghx) > threshold)); if max(max(abs(benchmark.oo_.dr.ghx-oo_.dr.ghx) > threshold));

View File

@ -57,7 +57,7 @@ steady;
stoch_simul(aim_solver, order=1,irf=0); stoch_simul(aim_solver, order=1,irf=0);
benchmark = load('fs2000x10_L9_L_results'); benchmark = load(['fs2000x10_L9_L' filesep 'Output' filesep 'fs2000x10_L9_L_results']);
threshold = 1e-8; threshold = 1e-8;
if max(max(abs(benchmark.oo_.dr.ghx-oo_.dr.ghx) > threshold)); if max(max(abs(benchmark.oo_.dr.ghx-oo_.dr.ghx) > threshold));

View File

@ -45,7 +45,7 @@ end;
stoch_simul(aim_solver, order=1,irf=0); stoch_simul(aim_solver, order=1,irf=0);
benchmark = load('ls2003_2L0L_results'); benchmark = load(['ls2003_2L0L' filesep 'Output' filesep 'ls2003_2L0L_results']);
threshold = 1e-8; threshold = 1e-8;
if max(max(abs(benchmark.oo_.dr.ghx-oo_.dr.ghx) > threshold)); if max(max(abs(benchmark.oo_.dr.ghx-oo_.dr.ghx) > threshold));

View File

@ -43,7 +43,7 @@ end;
stoch_simul(aim_solver, order=1,irf=0); stoch_simul(aim_solver, order=1,irf=0);
benchmark = load('ls2003_2L2L_results'); benchmark = load(['ls2003_2L2L' filesep 'Output' filesep 'ls2003_2L2L_results']);
threshold = 1e-8; threshold = 1e-8;
if max(max(abs(benchmark.oo_.dr.ghx-oo_.dr.ghx) > threshold)); if max(max(abs(benchmark.oo_.dr.ghx-oo_.dr.ghx) > threshold));

View File

@ -1412,13 +1412,6 @@ clean-local:
rm -f $(patsubst %.trs, %.json, $(O_TRS_FILES)) rm -f $(patsubst %.trs, %.json, $(O_TRS_FILES))
rm -f $(patsubst %.trs, %.json, $(O_XFAIL_TRS_FILES)) rm -f $(patsubst %.trs, %.json, $(O_XFAIL_TRS_FILES))
rm -f $(patsubst %.mod, %_results.mat, $(MODFILES))
rm -f $(patsubst %.mod, %_mode.mat, $(MODFILES))
rm -f $(patsubst %.mod, %_mh_mode.mat, $(MODFILES))
rm -f $(patsubst %.mod, %_mean.mat, $(MODFILES))
rm -f $(patsubst %.mod, %_pindx.mat, $(MODFILES))
rm -f $(patsubst %.mod, %_params.mat, $(MODFILES))
rm -f $(patsubst %.mod, %_simul, $(MODFILES))
rm -f $(patsubst %.mod, %.log, $(MODFILES)) rm -f $(patsubst %.mod, %.log, $(MODFILES))
rm -rf $(patsubst %.mod, %, $(MODFILES)) rm -rf $(patsubst %.mod, %, $(MODFILES))

View File

@ -78,22 +78,22 @@ options_.solve_tolf = 1e-12;
estimation(order=1,mode_compute=9,analytic_derivation,kalman_algo=1,datafile=my_data,nobs=192,mh_replic=0,mh_nblocks=2,mh_jscale=0.8,plot_priors=0,prior_trunc=0); estimation(order=1,mode_compute=9,analytic_derivation,kalman_algo=1,datafile=my_data,nobs=192,mh_replic=0,mh_nblocks=2,mh_jscale=0.8,plot_priors=0,prior_trunc=0);
if (isoctave && user_has_octave_forge_package('optim', '1.6')) || (~isoctave && user_has_matlab_license('optimization_toolbox')) if (isoctave && user_has_octave_forge_package('optim', '1.6')) || (~isoctave && user_has_matlab_license('optimization_toolbox'))
estimation(order=1,mode_compute=1,mode_file=fs2000_analytic_derivation_mode,analytic_derivation,kalman_algo=1,datafile=my_data,nobs=192,mh_replic=0,mh_nblocks=2,mh_jscale=0.8,plot_priors=0 estimation(order=1,mode_compute=1,mode_file='fs2000_analytic_derivation/Output/fs2000_analytic_derivation_mode',analytic_derivation,kalman_algo=1,datafile=my_data,nobs=192,mh_replic=0,mh_nblocks=2,mh_jscale=0.8,plot_priors=0
%,optim = ('DerivativeCheck', 'on','FiniteDifferenceType','central') %,optim = ('DerivativeCheck', 'on','FiniteDifferenceType','central')
); );
estimation(order=1,mode_compute=3,mode_file=fs2000_analytic_derivation_mode,analytic_derivation,kalman_algo=1,datafile=my_data,nobs=192,mh_replic=0,mh_nblocks=2,mh_jscale=0.8,plot_priors=0); estimation(order=1,mode_compute=3,mode_file='fs2000_analytic_derivation/Output/fs2000_analytic_derivation_mode',analytic_derivation,kalman_algo=1,datafile=my_data,nobs=192,mh_replic=0,mh_nblocks=2,mh_jscale=0.8,plot_priors=0);
estimation(order=1,mode_compute=101,mode_file=fs2000_analytic_derivation_mode,analytic_derivation,kalman_algo=1,datafile=my_data,nobs=192,mh_replic=0,mh_nblocks=2,mh_jscale=0.8,plot_priors=0); estimation(order=1,mode_compute=101,mode_file='fs2000_analytic_derivation/Output/fs2000_analytic_derivation_mode',analytic_derivation,kalman_algo=1,datafile=my_data,nobs=192,mh_replic=0,mh_nblocks=2,mh_jscale=0.8,plot_priors=0);
end end
estimation(order=1,mode_compute=5,mode_file=fs2000_analytic_derivation_mode,analytic_derivation,kalman_algo=2,datafile=my_data,nobs=192,mh_replic=0,mh_nblocks=2,mh_jscale=0.8,plot_priors=0); estimation(order=1,mode_compute=5,mode_file='fs2000_analytic_derivation/Output/fs2000_analytic_derivation_mode',analytic_derivation,kalman_algo=2,datafile=my_data,nobs=192,mh_replic=0,mh_nblocks=2,mh_jscale=0.8,plot_priors=0);
estimation(order=1,mode_compute=4,mode_file=fs2000_analytic_derivation_mode,analytic_derivation,kalman_algo=1,datafile=my_data,nobs=192,mh_replic=0,mh_nblocks=2,mh_jscale=0.8,plot_priors=0); estimation(order=1,mode_compute=4,mode_file='fs2000_analytic_derivation/Output/fs2000_analytic_derivation_mode',analytic_derivation,kalman_algo=1,datafile=my_data,nobs=192,mh_replic=0,mh_nblocks=2,mh_jscale=0.8,plot_priors=0);
estimation(order=1,mode_compute=4,mode_file=fs2000_analytic_derivation_mode,analytic_derivation,kalman_algo=2,datafile=my_data,nobs=192,mh_replic=0,mh_nblocks=2,mh_jscale=0.8,plot_priors=0); estimation(order=1,mode_compute=4,mode_file='fs2000_analytic_derivation/Output/fs2000_analytic_derivation_mode',analytic_derivation,kalman_algo=2,datafile=my_data,nobs=192,mh_replic=0,mh_nblocks=2,mh_jscale=0.8,plot_priors=0);
options_.debug=1; options_.debug=1;
estimation(order=1,mode_compute=0,mode_file=fs2000_analytic_derivation_mode,analytic_derivation,kalman_algo=1,datafile=my_data,nobs=192,mh_replic=0,plot_priors=0); estimation(order=1,mode_compute=0,mode_file='fs2000_analytic_derivation/Output/fs2000_analytic_derivation_mode',analytic_derivation,kalman_algo=1,datafile=my_data,nobs=192,mh_replic=0,plot_priors=0);
fval_ML_1=oo_.likelihood_at_initial_parameters; fval_ML_1=oo_.likelihood_at_initial_parameters;
estimation(order=1,mode_compute=0,mode_file=fs2000_analytic_derivation_mode,analytic_derivation,kalman_algo=2,datafile=my_data,nobs=192,mh_replic=0,plot_priors=0); estimation(order=1,mode_compute=0,mode_file='fs2000_analytic_derivation/Output/fs2000_analytic_derivation_mode',analytic_derivation,kalman_algo=2,datafile=my_data,nobs=192,mh_replic=0,plot_priors=0);
fval_ML_2=oo_.likelihood_at_initial_parameters; fval_ML_2=oo_.likelihood_at_initial_parameters;
options_.analytic_derivation=0; options_.analytic_derivation=0;
estimation(order=1,mode_compute=0,mode_file=fs2000_analytic_derivation_mode,kalman_algo=1,datafile=my_data,nobs=192,mh_replic=0,plot_priors=0); estimation(order=1,mode_compute=0,mode_file='fs2000_analytic_derivation/Output/fs2000_analytic_derivation_mode',kalman_algo=1,datafile=my_data,nobs=192,mh_replic=0,plot_priors=0);
fval_ML_3=oo_.likelihood_at_initial_parameters; fval_ML_3=oo_.likelihood_at_initial_parameters;
if abs(fval_ML_1-fval_ML_2)>1e-5 || abs(fval_ML_1-fval_ML_3)>1e-5 if abs(fval_ML_1-fval_ML_2)>1e-5 || abs(fval_ML_1-fval_ML_3)>1e-5
@ -111,22 +111,22 @@ end;
estimation(order=1,mode_compute=9,analytic_derivation,kalman_algo=1,datafile=my_data,nobs=192,mh_replic=0,mh_nblocks=2,mh_jscale=0.8,plot_priors=0,prior_trunc=0); estimation(order=1,mode_compute=9,analytic_derivation,kalman_algo=1,datafile=my_data,nobs=192,mh_replic=0,mh_nblocks=2,mh_jscale=0.8,plot_priors=0,prior_trunc=0);
if (isoctave && user_has_octave_forge_package('optim', '1.6')) || (~isoctave && user_has_matlab_license('optimization_toolbox')) if (isoctave && user_has_octave_forge_package('optim', '1.6')) || (~isoctave && user_has_matlab_license('optimization_toolbox'))
estimation(order=1,mode_compute=1,mode_file=fs2000_analytic_derivation_mode,analytic_derivation,kalman_algo=1,datafile=my_data,nobs=192,mh_replic=0,mh_nblocks=2,mh_jscale=0.8,plot_priors=0 estimation(order=1,mode_compute=1,mode_file='fs2000_analytic_derivation/Output/fs2000_analytic_derivation_mode',analytic_derivation,kalman_algo=1,datafile=my_data,nobs=192,mh_replic=0,mh_nblocks=2,mh_jscale=0.8,plot_priors=0
%,optim = ('DerivativeCheck', 'on','FiniteDifferenceType','central') %,optim = ('DerivativeCheck', 'on','FiniteDifferenceType','central')
); );
estimation(order=1,mode_compute=3,mode_file=fs2000_analytic_derivation_mode,analytic_derivation,kalman_algo=1,datafile=my_data,nobs=192,mh_replic=0,mh_nblocks=2,mh_jscale=0.8,plot_priors=0); estimation(order=1,mode_compute=3,mode_file='fs2000_analytic_derivation/Output/fs2000_analytic_derivation_mode',analytic_derivation,kalman_algo=1,datafile=my_data,nobs=192,mh_replic=0,mh_nblocks=2,mh_jscale=0.8,plot_priors=0);
estimation(order=1,mode_compute=101,mode_file=fs2000_analytic_derivation_mode,analytic_derivation,kalman_algo=1,datafile=my_data,nobs=192,mh_replic=0,mh_nblocks=2,mh_jscale=0.8,plot_priors=0); estimation(order=1,mode_compute=101,mode_file='fs2000_analytic_derivation/Output/fs2000_analytic_derivation_mode',analytic_derivation,kalman_algo=1,datafile=my_data,nobs=192,mh_replic=0,mh_nblocks=2,mh_jscale=0.8,plot_priors=0);
end end
estimation(order=1,mode_compute=5,mode_file=fs2000_analytic_derivation_mode,analytic_derivation,kalman_algo=2,datafile=my_data,nobs=192,mh_replic=0,mh_nblocks=2,mh_jscale=0.8,plot_priors=0); estimation(order=1,mode_compute=5,mode_file='fs2000_analytic_derivation/Output/fs2000_analytic_derivation_mode',analytic_derivation,kalman_algo=2,datafile=my_data,nobs=192,mh_replic=0,mh_nblocks=2,mh_jscale=0.8,plot_priors=0);
estimation(order=1,mode_compute=4,mode_file=fs2000_analytic_derivation_mode,analytic_derivation,kalman_algo=1,datafile=my_data,nobs=192,mh_replic=0,mh_nblocks=2,mh_jscale=0.8,plot_priors=0); estimation(order=1,mode_compute=4,mode_file='fs2000_analytic_derivation/Output/fs2000_analytic_derivation_mode',analytic_derivation,kalman_algo=1,datafile=my_data,nobs=192,mh_replic=0,mh_nblocks=2,mh_jscale=0.8,plot_priors=0);
estimation(order=1,mode_compute=4,mode_file=fs2000_analytic_derivation_mode,analytic_derivation,kalman_algo=2,datafile=my_data,nobs=192,mh_replic=0,mh_nblocks=2,mh_jscale=0.8,plot_priors=0); estimation(order=1,mode_compute=4,mode_file='fs2000_analytic_derivation/Output/fs2000_analytic_derivation_mode',analytic_derivation,kalman_algo=2,datafile=my_data,nobs=192,mh_replic=0,mh_nblocks=2,mh_jscale=0.8,plot_priors=0);
options_.debug=1; options_.debug=1;
estimation(order=1,mode_compute=0,mode_file=fs2000_analytic_derivation_mode,analytic_derivation,kalman_algo=1,datafile=my_data,nobs=192,mh_replic=0,plot_priors=0); estimation(order=1,mode_compute=0,mode_file='fs2000_analytic_derivation/Output/fs2000_analytic_derivation_mode',analytic_derivation,kalman_algo=1,datafile=my_data,nobs=192,mh_replic=0,plot_priors=0);
fval_Bayes_1=oo_.likelihood_at_initial_parameters; fval_Bayes_1=oo_.likelihood_at_initial_parameters;
estimation(order=1,mode_compute=0,mode_file=fs2000_analytic_derivation_mode,analytic_derivation,kalman_algo=2,datafile=my_data,nobs=192,mh_replic=0,plot_priors=0); estimation(order=1,mode_compute=0,mode_file='fs2000_analytic_derivation/Output/fs2000_analytic_derivation_mode',analytic_derivation,kalman_algo=2,datafile=my_data,nobs=192,mh_replic=0,plot_priors=0);
fval_Bayes_2=oo_.likelihood_at_initial_parameters; fval_Bayes_2=oo_.likelihood_at_initial_parameters;
options_.analytic_derivation=0; options_.analytic_derivation=0;
estimation(order=1,mode_compute=0,mode_file=fs2000_analytic_derivation_mode,kalman_algo=1,datafile=my_data,nobs=192,mh_replic=0,plot_priors=0); estimation(order=1,mode_compute=0,mode_file='fs2000_analytic_derivation/Output/fs2000_analytic_derivation_mode',kalman_algo=1,datafile=my_data,nobs=192,mh_replic=0,plot_priors=0);
fval_Bayes_3=oo_.likelihood_at_initial_parameters; fval_Bayes_3=oo_.likelihood_at_initial_parameters;
if abs(fval_Bayes_1-fval_Bayes_2)>1e-5 || abs(fval_Bayes_1-fval_Bayes_3)>1e-5 if abs(fval_Bayes_1-fval_Bayes_2)>1e-5 || abs(fval_Bayes_1-fval_Bayes_3)>1e-5

View File

@ -5,7 +5,7 @@
@#define mfs = 1 @#define mfs = 1
@#include "lola_common.inc" @#include "lola_common.inc"
mfs0=load('lola_solve_one_boundary_results'); mfs0=load(['lola_solve_one_boundary' filesep 'Output' filesep 'lola_solve_one_boundary_results']);
if max(max(oo_.endo_simul-mfs0.oo_.endo_simul)) > options_.dynatol.x if max(max(oo_.endo_simul-mfs0.oo_.endo_simul)) > options_.dynatol.x
error('Inconsistency with mfs=0') error('Inconsistency with mfs=0')

View File

@ -5,7 +5,7 @@
@#define mfs = 2 @#define mfs = 2
@#include "lola_common.inc" @#include "lola_common.inc"
mfs0=load('lola_solve_one_boundary_results'); mfs0=load(['lola_solve_one_boundary' filesep 'Output' filesep 'lola_solve_one_boundary_results']);
if max(max(oo_.endo_simul-mfs0.oo_.endo_simul)) > options_.dynatol.x if max(max(oo_.endo_simul-mfs0.oo_.endo_simul)) > options_.dynatol.x
error('Inconsistency with mfs=0') error('Inconsistency with mfs=0')

View File

@ -5,7 +5,7 @@
@#define mfs = 3 @#define mfs = 3
@#include "lola_common.inc" @#include "lola_common.inc"
mfs0=load('lola_solve_one_boundary_results'); mfs0=load(['lola_solve_one_boundary' filesep 'Output' filesep 'lola_solve_one_boundary_results']);
if max(max(oo_.endo_simul-mfs0.oo_.endo_simul)) > options_.dynatol.x if max(max(oo_.endo_simul-mfs0.oo_.endo_simul)) > options_.dynatol.x
error('Inconsistency with mfs=0') error('Inconsistency with mfs=0')

View File

@ -8,7 +8,7 @@
[~, state_reorder] = sort(oo_.dr.state_var); [~, state_reorder] = sort(oo_.dr.state_var);
ref = load('lola_stochastic_results.mat'); ref = load(['lola_stochastic' filesep 'Output' filesep 'lola_stochastic_results.mat']);
[~, ref_state_reorder] = sort(ref.oo_.dr.state_var); [~, ref_state_reorder] = sort(ref.oo_.dr.state_var);

View File

@ -70,7 +70,7 @@ if max(abs(junk(M_.maximum_lag+1:end)-oo_.endo_simul(strmatch('y_backward',M_.en
error('Solution of purely backwards model not correct') error('Solution of purely backwards model not correct')
end end
ramst_results=load('../../ramst_results.mat'); ramst_results=load('../../ramst/Output/ramst_results.mat');
if max(abs(ramst_results.oo_.endo_simul(strmatch('k',ramst_results.M_.endo_names,'exact'),1:end-M_.maximum_lead)-oo_.endo_simul(strmatch('k',M_.endo_names,'exact'),1:end-M_.maximum_lead)))>1e-10 if max(abs(ramst_results.oo_.endo_simul(strmatch('k',ramst_results.M_.endo_names,'exact'),1:end-M_.maximum_lead)-oo_.endo_simul(strmatch('k',M_.endo_names,'exact'),1:end-M_.maximum_lead)))>1e-10
error('Solution of forward part of the model not correct') error('Solution of forward part of the model not correct')
end end

View File

@ -44,7 +44,7 @@ if ~oo_.deterministic_simulation.status
error('Perfect foresight simulation failed') error('Perfect foresight simulation failed')
end end
base_results=load('sim_base_results.mat'); base_results=load(['sim_base' filesep 'Output' filesep 'sim_base_results.mat']);
if max(abs(base_results.oo_.endo_simul(strmatch('c',base_results.M_.endo_names,'exact'),1+base_results.M_.maximum_endo_lag:end-base_results.M_.maximum_endo_lead) -... if max(abs(base_results.oo_.endo_simul(strmatch('c',base_results.M_.endo_names,'exact'),1+base_results.M_.maximum_endo_lag:end-base_results.M_.maximum_endo_lead) -...
oo_.endo_simul(strmatch('c',M_.endo_names,'exact'),1+M_.maximum_endo_lag:end-M_.maximum_endo_lead)))>1e-8 || ... oo_.endo_simul(strmatch('c',M_.endo_names,'exact'),1+M_.maximum_endo_lag:end-M_.maximum_endo_lead)))>1e-8 || ...
max(abs(base_results.oo_.endo_simul(strmatch('k',base_results.M_.endo_names,'exact'),1+base_results.M_.maximum_endo_lag:end-base_results.M_.maximum_endo_lead) -... max(abs(base_results.oo_.endo_simul(strmatch('k',base_results.M_.endo_names,'exact'),1+base_results.M_.maximum_endo_lag:end-base_results.M_.maximum_endo_lead) -...
@ -58,7 +58,7 @@ if max(abs(base_results.oo_.exo_simul(1:end-base_results.M_.maximum_lead-base_re
end end
clear base_results; clear base_results;
base_results_aux_vars=load('sim_endo_lead_lag_aux_vars_results.mat'); base_results_aux_vars=load(['sim_exo_lead_lag_aux_vars' filesep 'Output' filesep 'sim_exo_lead_lag_aux_vars_results.mat']);
if max(abs(base_results_aux_vars.oo_.endo_simul(strmatch('z_backward_lag_2',base_results_aux_vars.M_.endo_names,'exact'),1:end-base_results_aux_vars.M_.maximum_lead) -... if max(abs(base_results_aux_vars.oo_.endo_simul(strmatch('z_backward_lag_2',base_results_aux_vars.M_.endo_names,'exact'),1:end-base_results_aux_vars.M_.maximum_lead) -...
oo_.endo_simul(strmatch('AUX_ENDO_LAG_2_2',M_.endo_names,'exact'),1:end-M_.maximum_lag)))>1e-8 oo_.endo_simul(strmatch('AUX_ENDO_LAG_2_2',M_.endo_names,'exact'),1:end-M_.maximum_lag)))>1e-8
error('Translation of endogenous variables is wrong') error('Translation of endogenous variables is wrong')

View File

@ -47,7 +47,7 @@ if ~oo_.deterministic_simulation.status
error('Perfect foresight simulation failed') error('Perfect foresight simulation failed')
end end
base_results=load('sim_base_results.mat'); base_results=load(['sim_base' filesep 'Output' filesep 'sim_base_results.mat']);
if max(abs(base_results.oo_.endo_simul(strmatch('c',base_results.M_.endo_names,'exact'),1+base_results.M_.maximum_endo_lag:end-base_results.M_.maximum_endo_lead) -... if max(abs(base_results.oo_.endo_simul(strmatch('c',base_results.M_.endo_names,'exact'),1+base_results.M_.maximum_endo_lag:end-base_results.M_.maximum_endo_lead) -...
oo_.endo_simul(strmatch('c',M_.endo_names,'exact'),1+M_.maximum_endo_lag:end-M_.maximum_endo_lead)))>1e-8 || ... oo_.endo_simul(strmatch('c',M_.endo_names,'exact'),1+M_.maximum_endo_lag:end-M_.maximum_endo_lead)))>1e-8 || ...
max(abs(base_results.oo_.endo_simul(strmatch('k',base_results.M_.endo_names,'exact'),1+base_results.M_.maximum_endo_lag:end-base_results.M_.maximum_endo_lead) -... max(abs(base_results.oo_.endo_simul(strmatch('k',base_results.M_.endo_names,'exact'),1+base_results.M_.maximum_endo_lag:end-base_results.M_.maximum_endo_lead) -...

View File

@ -42,7 +42,7 @@ if ~oo_.deterministic_simulation.status
error('Perfect foresight simulation failed') error('Perfect foresight simulation failed')
end end
base_results=load('sim_base_results.mat'); base_results=load(['sim_base' filesep 'Output' filesep 'sim_base_results.mat']);
if max(abs(base_results.oo_.endo_simul(strmatch('c',base_results.M_.endo_names,'exact'),1+base_results.M_.maximum_endo_lag:end-base_results.M_.maximum_endo_lead) -... if max(abs(base_results.oo_.endo_simul(strmatch('c',base_results.M_.endo_names,'exact'),1+base_results.M_.maximum_endo_lag:end-base_results.M_.maximum_endo_lead) -...
oo_.endo_simul(strmatch('c',M_.endo_names,'exact'),1+M_.maximum_lag:end-M_.maximum_lead)))>1e-8 || ... oo_.endo_simul(strmatch('c',M_.endo_names,'exact'),1+M_.maximum_lag:end-M_.maximum_lead)))>1e-8 || ...
max(abs(base_results.oo_.endo_simul(strmatch('k',base_results.M_.endo_names,'exact'),1+base_results.M_.maximum_endo_lag:end-base_results.M_.maximum_endo_lead) -... max(abs(base_results.oo_.endo_simul(strmatch('k',base_results.M_.endo_names,'exact'),1+base_results.M_.maximum_endo_lag:end-base_results.M_.maximum_endo_lead) -...
@ -51,7 +51,7 @@ if max(abs(base_results.oo_.endo_simul(strmatch('c',base_results.M_.endo_names,'
end end
clear base_results clear base_results
base_results_aux_vars=load('sim_exo_lead_lag_aux_vars_results.mat'); base_results_aux_vars=load(['sim_exo_lead_lag_aux_vars' filesep 'Output' filesep 'sim_exo_lead_lag_aux_vars_results.mat']);
if max(abs(base_results_aux_vars.oo_.endo_simul(strmatch('x_lag_3',base_results_aux_vars.M_.endo_names,'exact'),base_results_aux_vars.M_.maximum_lag+3:end-base_results_aux_vars.M_.maximum_lead)' -... if max(abs(base_results_aux_vars.oo_.endo_simul(strmatch('x_lag_3',base_results_aux_vars.M_.endo_names,'exact'),base_results_aux_vars.M_.maximum_lag+3:end-base_results_aux_vars.M_.maximum_lead)' -...
oo_.exo_simul(M_.maximum_lag:end-M_.maximum_lead-3,strmatch('x', M_.exo_names, 'exact'))))>1e-8 oo_.exo_simul(M_.maximum_lag:end-M_.maximum_lead-3,strmatch('x', M_.exo_names, 'exact'))))>1e-8

View File

@ -47,7 +47,7 @@ if ~oo_.deterministic_simulation.status
error('Perfect foresight simulation failed') error('Perfect foresight simulation failed')
end end
base_results=load('sim_base_results.mat'); base_results=load(['sim_base' filesep 'Output' filesep 'sim_base_results.mat']);
if max(abs(base_results.oo_.endo_simul(strmatch('c',base_results.M_.endo_names,'exact'),1+base_results.M_.maximum_endo_lag:end-base_results.M_.maximum_endo_lead) -... if max(abs(base_results.oo_.endo_simul(strmatch('c',base_results.M_.endo_names,'exact'),1+base_results.M_.maximum_endo_lag:end-base_results.M_.maximum_endo_lead) -...
oo_.endo_simul(strmatch('c',M_.endo_names,'exact'),1+M_.maximum_endo_lag:end-M_.maximum_endo_lead)))>1e-8 || ... oo_.endo_simul(strmatch('c',M_.endo_names,'exact'),1+M_.maximum_endo_lag:end-M_.maximum_endo_lead)))>1e-8 || ...
max(abs(base_results.oo_.endo_simul(strmatch('k',base_results.M_.endo_names,'exact'),1+base_results.M_.maximum_endo_lag:end-base_results.M_.maximum_endo_lead) -... max(abs(base_results.oo_.endo_simul(strmatch('k',base_results.M_.endo_names,'exact'),1+base_results.M_.maximum_endo_lag:end-base_results.M_.maximum_endo_lead) -...

View File

@ -46,7 +46,7 @@ if ~oo_.deterministic_simulation.status
error('Perfect foresight simulation failed') error('Perfect foresight simulation failed')
end end
base_results=load('sim_base_results.mat'); base_results=load(['sim_base' filesep 'Output' filesep 'sim_base_results.mat']);
if max(abs(base_results.oo_.endo_simul(strmatch('c',base_results.M_.endo_names,'exact'),1+base_results.M_.maximum_endo_lag:end-base_results.M_.maximum_endo_lead) -... if max(abs(base_results.oo_.endo_simul(strmatch('c',base_results.M_.endo_names,'exact'),1+base_results.M_.maximum_endo_lag:end-base_results.M_.maximum_endo_lead) -...
oo_.endo_simul(strmatch('c',M_.endo_names,'exact'),1+M_.maximum_lag:end-M_.maximum_lead)))>1e-8 || ... oo_.endo_simul(strmatch('c',M_.endo_names,'exact'),1+M_.maximum_lag:end-M_.maximum_lead)))>1e-8 || ...
max(abs(base_results.oo_.endo_simul(strmatch('k',base_results.M_.endo_names,'exact'),1+base_results.M_.maximum_endo_lag:end-base_results.M_.maximum_endo_lead) -... max(abs(base_results.oo_.endo_simul(strmatch('k',base_results.M_.endo_names,'exact'),1+base_results.M_.maximum_endo_lag:end-base_results.M_.maximum_endo_lead) -...
@ -55,7 +55,7 @@ if max(abs(base_results.oo_.endo_simul(strmatch('c',base_results.M_.endo_names,'
end end
clear base_results clear base_results
base_results_aux_vars=load('sim_lead_lag_aux_vars_results.mat'); base_results_aux_vars=load(['sim_exo_lead_lag_aux_vars' filesep 'Output' filesep 'sim_exo_lead_lag_aux_vars_results.mat']);
if max(abs(base_results_aux_vars.oo_.endo_simul(strmatch('x_lag_3',base_results_aux_vars.M_.endo_names,'exact'),base_results_aux_vars.M_.maximum_lag+3:end-base_results_aux_vars.M_.maximum_lead)' -... if max(abs(base_results_aux_vars.oo_.endo_simul(strmatch('x_lag_3',base_results_aux_vars.M_.endo_names,'exact'),base_results_aux_vars.M_.maximum_lag+3:end-base_results_aux_vars.M_.maximum_lead)' -...
oo_.exo_simul(M_.maximum_lag:end-M_.maximum_lead-3,strmatch('x', M_.exo_names, 'exact'))))>1e-8 oo_.exo_simul(M_.maximum_lag:end-M_.maximum_lead-3,strmatch('x', M_.exo_names, 'exact'))))>1e-8

View File

@ -57,7 +57,7 @@ if ~oo_.deterministic_simulation.status
error('Perfect foresight simulation failed') error('Perfect foresight simulation failed')
end end
base_results=load('sim_base_results.mat'); base_results=load(['sim_base' filesep 'Output' filesep 'sim_base_results.mat']);
if max(abs(base_results.oo_.endo_simul(strmatch('c',base_results.M_.endo_names,'exact'),1+base_results.M_.maximum_endo_lag:end-base_results.M_.maximum_endo_lead) -... if max(abs(base_results.oo_.endo_simul(strmatch('c',base_results.M_.endo_names,'exact'),1+base_results.M_.maximum_endo_lag:end-base_results.M_.maximum_endo_lead) -...
oo_.endo_simul(strmatch('c',M_.endo_names,'exact'),1+M_.maximum_endo_lag:end-M_.maximum_endo_lead)))>1e-8 || ... oo_.endo_simul(strmatch('c',M_.endo_names,'exact'),1+M_.maximum_endo_lag:end-M_.maximum_endo_lead)))>1e-8 || ...
max(abs(base_results.oo_.endo_simul(strmatch('k',base_results.M_.endo_names,'exact'),1+base_results.M_.maximum_endo_lag:end-base_results.M_.maximum_endo_lead) -... max(abs(base_results.oo_.endo_simul(strmatch('k',base_results.M_.endo_names,'exact'),1+base_results.M_.maximum_endo_lag:end-base_results.M_.maximum_endo_lead) -...

View File

@ -79,6 +79,6 @@ end
rplot Consumption; rplot Consumption;
rplot Capital; rplot Capital;
O=load('rbc_det_exo_lag_2a_results'); O=load(['rbc_det_exo_lag_2a' filesep 'Output' filesep 'rbc_det_exo_lag_2a_results']);
fataltest(oo_.endo_simul(1:M_.orig_endo_nbr,:),O.oo_.endo_simul(1:O.M_.orig_endo_nbr,:),1); fataltest(oo_.endo_simul(1:M_.orig_endo_nbr,:),O.oo_.endo_simul(1:O.M_.orig_endo_nbr,:),1);

View File

@ -79,6 +79,6 @@ end
rplot Consumption; rplot Consumption;
rplot Capital; rplot Capital;
O=load('rbc_det_exo_lag_2a_results'); O=load(['rbc_det_exo_lag_2a' filesep 'Output' filesep 'rbc_det_exo_lag_2a_results']);
fataltest(oo_.endo_simul(1:M_.orig_endo_nbr,:),O.oo_.endo_simul(1:O.M_.orig_endo_nbr,:),1); fataltest(oo_.endo_simul(1:M_.orig_endo_nbr,:),O.oo_.endo_simul(1:O.M_.orig_endo_nbr,:),1);

View File

@ -81,7 +81,7 @@ end
rplot Consumption; rplot Consumption;
rplot Capital; rplot Capital;
D = load('rbc_det_results'); D = load(['rbc_det' filesep 'Output' filesep 'rbc_det_results']);
if norm(D.oo_.endo_simul - oo_.endo_simul) > 1e-30; if norm(D.oo_.endo_simul - oo_.endo_simul) > 1e-30;
disp(norm(D.oo_.endo_simul - oo_.endo_simul)); disp(norm(D.oo_.endo_simul - oo_.endo_simul));
@ -102,7 +102,7 @@ end
rplot Consumption; rplot Consumption;
rplot Capital; rplot Capital;
D = load('rbc_det_results'); D = load(['rbc_det' filesep 'Output' filesep 'rbc_det_results']);
if isoctave && options_.solve_algo==0 if isoctave && options_.solve_algo==0
%%acount for somehow weaker convergence criterion in Octave's fsolve %%acount for somehow weaker convergence criterion in Octave's fsolve
tol_crit=1e-4; tol_crit=1e-4;

View File

@ -81,7 +81,7 @@ end
rplot Consumption; rplot Consumption;
rplot Capital; rplot Capital;
D = load('rbc_det_results'); D = load(['rbc_det' filesep 'Output' filesep 'rbc_det_results']);
if norm(D.oo_.endo_simul(1:D.M_.orig_endo_nbr,D.M_.maximum_lag+1:end-D.M_.maximum_lead) - oo_.endo_simul(1:M_.orig_endo_nbr,M_.maximum_lag+1:end-M_.maximum_lead)) > 1e-30; if norm(D.oo_.endo_simul(1:D.M_.orig_endo_nbr,D.M_.maximum_lag+1:end-D.M_.maximum_lead) - oo_.endo_simul(1:M_.orig_endo_nbr,M_.maximum_lag+1:end-M_.maximum_lead)) > 1e-30;
disp(D.oo_.endo_simul(1:D.M_.orig_endo_nbr,D.M_.maximum_lag+1:end-D.M_.maximum_lead) - oo_.endo_simul(1:M_.orig_endo_nbr,M_.maximum_lag+1:end-M_.maximum_lead)); disp(D.oo_.endo_simul(1:D.M_.orig_endo_nbr,D.M_.maximum_lag+1:end-D.M_.maximum_lead) - oo_.endo_simul(1:M_.orig_endo_nbr,M_.maximum_lag+1:end-M_.maximum_lead));
@ -102,7 +102,7 @@ end
rplot Consumption; rplot Consumption;
rplot Capital; rplot Capital;
D = load('rbc_det_results'); D = load(['rbc_det' filesep 'Output' filesep 'rbc_det_results']);
if isoctave && options_.solve_algo==0 if isoctave && options_.solve_algo==0
%%acount for somehow weaker convergence criterion in Octave's fsolve %%acount for somehow weaker convergence criterion in Octave's fsolve
tol_crit=1e-4; tol_crit=1e-4;

View File

@ -81,7 +81,7 @@ end
rplot Consumption; rplot Consumption;
rplot Capital; rplot Capital;
D = load('rbc_det_results'); D = load(['rbc_det' filesep 'Output' filesep 'rbc_det_results']);
if norm(D.oo_.endo_simul(1:D.M_.orig_endo_nbr,D.M_.maximum_lag+1:end-D.M_.maximum_lead) - oo_.endo_simul(1:M_.orig_endo_nbr,M_.maximum_lag+1:end-M_.maximum_lead)) > 1e-30; if norm(D.oo_.endo_simul(1:D.M_.orig_endo_nbr,D.M_.maximum_lag+1:end-D.M_.maximum_lead) - oo_.endo_simul(1:M_.orig_endo_nbr,M_.maximum_lag+1:end-M_.maximum_lead)) > 1e-30;
disp(D.oo_.endo_simul(1:D.M_.orig_endo_nbr,D.M_.maximum_lag+1:end-D.M_.maximum_lead) - oo_.endo_simul(1:M_.orig_endo_nbr,M_.maximum_lag+1:end-M_.maximum_lead)); disp(D.oo_.endo_simul(1:D.M_.orig_endo_nbr,D.M_.maximum_lag+1:end-D.M_.maximum_lead) - oo_.endo_simul(1:M_.orig_endo_nbr,M_.maximum_lag+1:end-M_.maximum_lead));
@ -102,7 +102,7 @@ end
rplot Consumption; rplot Consumption;
rplot Capital; rplot Capital;
D = load('rbc_det_results'); D = load(['rbc_det' filesep 'Output' filesep 'rbc_det_results']);
if isoctave && options_.solve_algo==0 if isoctave && options_.solve_algo==0
%%acount for somehow weaker convergence criterion in Octave's fsolve %%acount for somehow weaker convergence criterion in Octave's fsolve
tol_crit=1e-4; tol_crit=1e-4;

View File

@ -219,7 +219,7 @@ end;
planner_objective 0.5*((siggma+(varphi+alppha)/(1-alppha))*y_hat^2+epsilon/0.0215*pi^2)/100; planner_objective 0.5*((siggma+(varphi+alppha)/(1-alppha))*y_hat^2+epsilon/0.0215*pi^2)/100;
discretionary_policy(order=1,instruments=(R),irf=20,planner_discount=betta, periods=0) y_hat pi_ann log_y log_N log_W_real log_P; discretionary_policy(order=1,instruments=(R),irf=20,planner_discount=betta, periods=0) y_hat pi_ann log_y log_N log_W_real log_P;
temp=load('Gali_2015_chapter_3_results.mat'); temp=load(['Gali_2015_chapter_3' filesep 'Output' filesep 'Gali_2015_chapter_3_results.mat']);
if abs(oo_.planner_objective_value-temp.oo_.planner_objective_value)>1e-6 if abs(oo_.planner_objective_value-temp.oo_.planner_objective_value)>1e-6
warning('Planner objective does not match linear model') warning('Planner objective does not match linear model')
end end

View File

@ -8,7 +8,7 @@ copyfile([M_.dname filesep 'metropolis' filesep M_.dname '_mh1_blck1.mat'],[M_.d
copyfile([M_.dname filesep 'metropolis' filesep M_.dname '_mh2_blck2.mat'],[M_.dname '_mh2_blck2.mat']) copyfile([M_.dname filesep 'metropolis' filesep M_.dname '_mh2_blck2.mat'],[M_.dname '_mh2_blck2.mat'])
delete([M_.dname filesep 'metropolis' filesep M_.dname '_mh2_blck2.mat']) delete([M_.dname filesep 'metropolis' filesep M_.dname '_mh2_blck2.mat'])
estimation(order=1, datafile='../fsdat_simul',mode_compute=0,mode_file=fs2000_recover_mode, nobs=192, loglinear, mh_replic=2000, mh_nblocks=2, mh_jscale=0.8,mh_recover); estimation(order=1, datafile='../fsdat_simul',mode_compute=0,mode_file='fs2000_recover/Output/fs2000_recover_mode', nobs=192, loglinear, mh_replic=2000, mh_nblocks=2, mh_jscale=0.8,mh_recover);
%check first unaffected chain %check first unaffected chain
temp1=load([M_.dname '_mh1_blck1.mat']); temp1=load([M_.dname '_mh1_blck1.mat']);

View File

@ -5,7 +5,7 @@
options_.MaxNumberOfBytes=2000*11*8/4; options_.MaxNumberOfBytes=2000*11*8/4;
estimation(order=1, datafile='../fsdat_simul',nobs=192, loglinear, mh_replic=999, mh_nblocks=2, mh_jscale=0.8); estimation(order=1, datafile='../fsdat_simul',nobs=192, loglinear, mh_replic=999, mh_nblocks=2, mh_jscale=0.8);
estimation(order=1,mode_compute=0,mode_file=fs2000_recover_2_mode, datafile='../fsdat_simul',nobs=192, loglinear, load_mh_file,mh_replic=1002, mh_nblocks=2, mh_jscale=0.8); estimation(order=1,mode_compute=0,mode_file='fs2000_recover_2/Output/fs2000_recover_2_mode', datafile='../fsdat_simul',nobs=192, loglinear, load_mh_file,mh_replic=1002, mh_nblocks=2, mh_jscale=0.8);
copyfile([M_.dname filesep 'metropolis' filesep M_.dname '_mh1_blck1.mat'],[M_.dname '_mh1_blck1.mat']) copyfile([M_.dname filesep 'metropolis' filesep M_.dname '_mh1_blck1.mat'],[M_.dname '_mh1_blck1.mat'])
copyfile([M_.dname filesep 'metropolis' filesep M_.dname '_mh3_blck2.mat'],[M_.dname '_mh3_blck2.mat']) copyfile([M_.dname filesep 'metropolis' filesep M_.dname '_mh3_blck2.mat'],[M_.dname '_mh3_blck2.mat'])
copyfile([M_.dname filesep 'metropolis' filesep M_.dname '_mh4_blck2.mat'],[M_.dname '_mh4_blck2.mat']) copyfile([M_.dname filesep 'metropolis' filesep M_.dname '_mh4_blck2.mat'],[M_.dname '_mh4_blck2.mat'])
@ -14,7 +14,7 @@ delete([M_.dname filesep 'metropolis' filesep M_.dname '_mh3_blck2.mat'])
delete([M_.dname filesep 'metropolis' filesep M_.dname '_mh4_blck2.mat']) delete([M_.dname filesep 'metropolis' filesep M_.dname '_mh4_blck2.mat'])
delete([M_.dname filesep 'metropolis' filesep M_.dname '_mh5_blck2.mat']) delete([M_.dname filesep 'metropolis' filesep M_.dname '_mh5_blck2.mat'])
estimation(order=1, datafile='../fsdat_simul',mode_compute=0,mode_file=fs2000_recover_2_mode, nobs=192, loglinear, mh_replic=2000, mh_nblocks=2, mh_jscale=0.8,mh_recover); estimation(order=1, datafile='../fsdat_simul',mode_compute=0,mode_file='fs2000_recover_2/Output/fs2000_recover_2_mode', nobs=192, loglinear, mh_replic=2000, mh_nblocks=2, mh_jscale=0.8,mh_recover);
%check first unaffected chain %check first unaffected chain
temp1=load([M_.dname '_mh1_blck1.mat']); temp1=load([M_.dname '_mh1_blck1.mat']);

View File

@ -5,14 +5,14 @@
options_.MaxNumberOfBytes=2000*11*8/4; options_.MaxNumberOfBytes=2000*11*8/4;
estimation(order=1, datafile='../fsdat_simul',nobs=192, loglinear, mh_replic=1000, mh_nblocks=2, mh_jscale=0.8); estimation(order=1, datafile='../fsdat_simul',nobs=192, loglinear, mh_replic=1000, mh_nblocks=2, mh_jscale=0.8);
estimation(order=1,mode_compute=0,mode_file=fs2000_recover_3_mode, datafile='../fsdat_simul',nobs=192, loglinear, load_mh_file,mh_replic=1000, mh_nblocks=2, mh_jscale=0.8); estimation(order=1,mode_compute=0,mode_file='fs2000_recover_3/Output/fs2000_recover_3_mode', datafile='../fsdat_simul',nobs=192, loglinear, load_mh_file,mh_replic=1000, mh_nblocks=2, mh_jscale=0.8);
copyfile([M_.dname filesep 'metropolis' filesep M_.dname '_mh1_blck1.mat'],[M_.dname '_mh1_blck1.mat']) copyfile([M_.dname filesep 'metropolis' filesep M_.dname '_mh1_blck1.mat'],[M_.dname '_mh1_blck1.mat'])
copyfile([M_.dname filesep 'metropolis' filesep M_.dname '_mh3_blck2.mat'],[M_.dname '_mh3_blck2.mat']) copyfile([M_.dname filesep 'metropolis' filesep M_.dname '_mh3_blck2.mat'],[M_.dname '_mh3_blck2.mat'])
copyfile([M_.dname filesep 'metropolis' filesep M_.dname '_mh4_blck2.mat'],[M_.dname '_mh4_blck2.mat']) copyfile([M_.dname filesep 'metropolis' filesep M_.dname '_mh4_blck2.mat'],[M_.dname '_mh4_blck2.mat'])
delete([M_.dname filesep 'metropolis' filesep M_.dname '_mh3_blck2.mat']) delete([M_.dname filesep 'metropolis' filesep M_.dname '_mh3_blck2.mat'])
delete([M_.dname filesep 'metropolis' filesep M_.dname '_mh4_blck2.mat']) delete([M_.dname filesep 'metropolis' filesep M_.dname '_mh4_blck2.mat'])
estimation(order=1, datafile='../fsdat_simul',mode_compute=0,mode_file=fs2000_recover_3_mode, nobs=192, loglinear, mh_replic=2000, mh_nblocks=2, mh_jscale=0.8,mh_recover); estimation(order=1, datafile='../fsdat_simul',mode_compute=0,mode_file='fs2000_recover_3/Output/fs2000_recover_3_mode', nobs=192, loglinear, mh_replic=2000, mh_nblocks=2, mh_jscale=0.8,mh_recover);
%check first unaffected chain %check first unaffected chain
temp1=load([M_.dname '_mh1_blck1.mat']); temp1=load([M_.dname '_mh1_blck1.mat']);

View File

@ -8,7 +8,7 @@ copyfile([M_.dname filesep 'metropolis' filesep M_.dname '_mh1_blck1.mat'],[M_.d
copyfile([M_.dname filesep 'metropolis' filesep M_.dname '_mh2_blck2.mat'],[M_.dname '_mh2_blck2.mat']) copyfile([M_.dname filesep 'metropolis' filesep M_.dname '_mh2_blck2.mat'],[M_.dname '_mh2_blck2.mat'])
delete([M_.dname filesep 'metropolis' filesep M_.dname '_mh2_blck2.mat']) delete([M_.dname filesep 'metropolis' filesep M_.dname '_mh2_blck2.mat'])
estimation(posterior_sampling_method='tailored_random_block_metropolis_hastings',order=1, datafile='../fsdat_simul',mode_compute=0,mode_file=fs2000_recover_mode, nobs=192, loglinear, mh_replic=2000, mh_nblocks=2, mh_jscale=0.8,mh_recover); estimation(posterior_sampling_method='tailored_random_block_metropolis_hastings',order=1, datafile='../fsdat_simul',mode_compute=0,mode_file='fs2000_recover/Output/fs2000_recover_mode', nobs=192, loglinear, mh_replic=2000, mh_nblocks=2, mh_jscale=0.8,mh_recover);
%check first unaffected chain %check first unaffected chain
temp1=load([M_.dname '_mh1_blck1.mat']); temp1=load([M_.dname '_mh1_blck1.mat']);

View File

@ -104,11 +104,11 @@ options_.smoother=0;
options_.moments_varendo=0; options_.moments_varendo=0;
options_.forecast=0; options_.forecast=0;
copyfile([M_.dname filesep 'metropolis' filesep M_.dname '_mh1_blck1.mat'],[M_.dname '_mh1_blck1.mat']) copyfile([M_.dname filesep 'metropolis' filesep M_.dname '_mh1_blck1.mat'],[M_.dname '_mh1_blck1.mat'])
estimation(mode_compute=0,mode_file=fs2000_mode,order=1, datafile=fsdat_simul, nobs=192, loglinear, mh_replic=1500, mh_nblocks=1, mh_jscale=0.8); estimation(mode_compute=0,mode_file='fs2000/Output/fs2000_mode',order=1, datafile=fsdat_simul, nobs=192, loglinear, mh_replic=1500, mh_nblocks=1, mh_jscale=0.8);
hh=eye(size(bayestopt_.name,1)); hh=eye(size(bayestopt_.name,1));
save('fs2000_mode.mat','hh','-append') save('fs2000/Output/fs2000_mode.mat','hh','-append')
Laplace = oo_.MarginalDensity.LaplaceApproximation; %save Laplace approximation which will be overwritten with set hh otherwise Laplace = oo_.MarginalDensity.LaplaceApproximation; %save Laplace approximation which will be overwritten with set hh otherwise
estimation(mode_compute=0,mode_file=fs2000_mode,order=1, datafile=fsdat_simul, nobs=192, loglinear, mh_replic=1500, mh_nblocks=1, mh_jscale=10,load_mh_file); estimation(mode_compute=0,mode_file='fs2000/Output/fs2000_mode',order=1, datafile=fsdat_simul, nobs=192, loglinear, mh_replic=1500, mh_nblocks=1, mh_jscale=10,load_mh_file);
temp1=load([M_.dname '_mh1_blck1.mat']); temp1=load([M_.dname '_mh1_blck1.mat']);
temp2=load([M_.dname filesep 'metropolis' filesep M_.dname '_mh1_blck1.mat']); temp2=load([M_.dname filesep 'metropolis' filesep M_.dname '_mh1_blck1.mat']);
@ -121,7 +121,7 @@ end
save('fs2000_result.mat','oo_') save('fs2000_result.mat','oo_')
options_.load_results_after_load_mh=1; options_.load_results_after_load_mh=1;
estimation(mode_compute=0,mode_file=fs2000_mode,order=1, datafile=fsdat_simul, nobs=192, loglinear, mh_replic=0, mh_nblocks=1, mh_jscale=10,load_mh_file,smoother) gy_obs gp_obs; estimation(mode_compute=0,mode_file='fs2000/Output/fs2000_mode',order=1, datafile=fsdat_simul, nobs=192, loglinear, mh_replic=0, mh_nblocks=1, mh_jscale=10,load_mh_file,smoother) gy_obs gp_obs;
oo_.MarginalDensity.LaplaceApproximation = Laplace; %reset correct Laplace oo_.MarginalDensity.LaplaceApproximation = Laplace; %reset correct Laplace

View File

@ -84,9 +84,9 @@ options_.mode_compute=4;
options_.plot_priors=0; options_.plot_priors=0;
estimation(order=1,datafile=fsdat_simul,nobs=192,loglinear,mh_replic=1000,mh_nblocks=1,mh_jscale=0.8,mcmc_jumping_covariance=hessian); estimation(order=1,datafile=fsdat_simul,nobs=192,loglinear,mh_replic=1000,mh_nblocks=1,mh_jscale=0.8,mcmc_jumping_covariance=hessian);
load fs2000_MCMC_jumping_covariance_mode hh; load('fs2000_MCMC_jumping_covariance/Output/fs2000_MCMC_jumping_covariance_mode','hh');
jumping_covariance=diag(diag(hh)); jumping_covariance=diag(diag(hh));
save test_matrix.mat jumping_covariance; save('test_matrix.mat','jumping_covariance');
estimation(order=1,datafile=fsdat_simul,nobs=192,loglinear,mh_replic=1000,mh_nblocks=1,mh_jscale=0.01,mcmc_jumping_covariance=prior_variance); estimation(order=1,datafile=fsdat_simul,nobs=192,loglinear,mh_replic=1000,mh_nblocks=1,mh_jscale=0.01,mcmc_jumping_covariance=prior_variance);
estimation(order=1,datafile=fsdat_simul,nobs=192,loglinear,mh_replic=1000,mh_nblocks=1,mh_jscale=0.0001,mcmc_jumping_covariance=identity_matrix); estimation(order=1,datafile=fsdat_simul,nobs=192,loglinear,mh_replic=1000,mh_nblocks=1,mh_jscale=0.0001,mcmc_jumping_covariance=identity_matrix);

View File

@ -29,5 +29,5 @@ end;
estimation(order=1,datafile='../fsdat_simul',nobs=192,mode_compute=5,loglinear,mh_replic=0,smoother,filtered_vars,forecast=8,filter_step_ahead=[1:8],consider_all_endogenous,heteroskedastic_filter); estimation(order=1,datafile='../fsdat_simul',nobs=192,mode_compute=5,loglinear,mh_replic=0,smoother,filtered_vars,forecast=8,filter_step_ahead=[1:8],consider_all_endogenous,heteroskedastic_filter);
@#define mode_file_name="fs2000_het_mode" @#define mode_file_name="'fs2000_het/Output/fs2000_het_mode'"
@#include "fs2000_het_check.inc" @#include "fs2000_het_check.inc"

View File

@ -33,5 +33,5 @@ end;
estimation(order=1,datafile='../fsdat_simul',nobs=192,mode_compute=5,loglinear,mh_replic=0,smoother,filtered_vars,forecast=8,filter_step_ahead=[1:8],consider_all_endogenous,heteroskedastic_filter); estimation(order=1,datafile='../fsdat_simul',nobs=192,mode_compute=5,loglinear,mh_replic=0,smoother,filtered_vars,forecast=8,filter_step_ahead=[1:8],consider_all_endogenous,heteroskedastic_filter);
@#define mode_file_name="fs2000_het_corr_mode" @#define mode_file_name="'fs2000_het_corr/Output/fs2000_het_corr_mode'"
@#include "fs2000_het_check.inc" @#include "fs2000_het_check.inc"

View File

@ -44,11 +44,11 @@ end;
stoch_simul(nograph); stoch_simul(nograph);
if ~exist('example1_results.mat','file'); if ~exist(['example1' filesep 'Output' filesep 'example1_results.mat'],'file');
error('example1 must be run first'); error('example1 must be run first');
end; end;
oo1 = load('example1_results','oo_'); oo1 = load(['example1' filesep 'Output' filesep 'example1_results'],'oo_');
dr0 = oo1.oo_.dr; dr0 = oo1.oo_.dr;
dr = oo_.dr; dr = oo_.dr;

View File

@ -51,11 +51,11 @@ end;
stoch_simul; stoch_simul;
if ~exist('example1long_results.mat','file'); if ~exist(['example1long' filesep 'Output' filesep 'example1long_results.mat'],'file');
error('example1long must be run first'); error('example1long must be run first');
end; end;
oo1 = load('example1long_results','oo_'); oo1 = load(['example1long' filesep 'Output' filesep 'example1long_results'],'oo_');
dr0 = oo1.oo_.dr; dr0 = oo1.oo_.dr;
dr = oo_.dr; dr = oo_.dr;

View File

@ -51,11 +51,12 @@ end;
stoch_simul; stoch_simul;
if ~exist('example1long_results.mat','file'); if ~exist(['example1long' filesep 'Output' filesep 'example1long_results.mat'],'file');
error('example1long must be run first'); error('example1long must be run first');
end; end;
oo1 = load('example1long_results','oo_'); oo1 = load(['example1long' filesep 'Output' filesep 'example1long_results'],'oo_');
dr0 = oo1.oo_.dr; dr0 = oo1.oo_.dr;
dr = oo_.dr; dr = oo_.dr;

View File

@ -46,7 +46,7 @@ end;
stoch_simul; stoch_simul;
L = load('benchmark_results.mat'); L = load(['benchmark' filesep 'Output' filesep 'benchmark_results.mat']);
if max(max(abs(L.oo_.dr.ghu - oo_.dr.ghu))) > 1e-12 if max(max(abs(L.oo_.dr.ghu - oo_.dr.ghu))) > 1e-12
error('Failure in external function') error('Failure in external function')
end end

View File

@ -45,7 +45,7 @@ end;
stoch_simul; stoch_simul;
L = load('benchmark_results.mat'); L = load(['benchmark' filesep 'Output' filesep 'benchmark_results.mat']);
if max(max(abs(L.oo_.dr.ghu - oo_.dr.ghu))) > 1e-12 if max(max(abs(L.oo_.dr.ghu - oo_.dr.ghu))) > 1e-12
error('Failure in external function') error('Failure in external function')
end end

View File

@ -45,7 +45,7 @@ end;
stoch_simul; stoch_simul;
L = load('benchmark_results.mat'); L = load(['benchmark' filesep 'Output' filesep 'benchmark_results.mat']);
if max(max(abs(L.oo_.dr.ghu - oo_.dr.ghu))) > 1e-12 if max(max(abs(L.oo_.dr.ghu - oo_.dr.ghu))) > 1e-12
error('Failure in external function') error('Failure in external function')
end end

View File

@ -47,7 +47,7 @@ end;
stoch_simul; stoch_simul;
L = load('benchmark_results.mat'); L = load(['benchmark' filesep 'Output' filesep 'benchmark_results.mat']);
if max(max(abs(L.oo_.dr.ghu - oo_.dr.ghu))) > 1e-12 if max(max(abs(L.oo_.dr.ghu - oo_.dr.ghu))) > 1e-12
error('Failure in external function') error('Failure in external function')
end end

View File

@ -47,7 +47,7 @@ end;
stoch_simul; stoch_simul;
L = load('benchmark_results.mat'); L = load(['benchmark' filesep 'Output' filesep 'benchmark_results.mat']);
if max(max(abs(L.oo_.dr.ghu - oo_.dr.ghu))) > 1e-12 if max(max(abs(L.oo_.dr.ghu - oo_.dr.ghu))) > 1e-12
error('Failure in external function') error('Failure in external function')
end end

View File

@ -45,7 +45,7 @@ end;
stoch_simul; stoch_simul;
L = load('benchmark_results.mat'); L = load(['benchmark' filesep 'Output' filesep 'benchmark_results.mat']);
if max(max(abs(L.oo_.dr.ghu - oo_.dr.ghu))) > 1e-12 if max(max(abs(L.oo_.dr.ghu - oo_.dr.ghu))) > 1e-12
error('Failure in external function') error('Failure in external function')
end end

View File

@ -45,7 +45,7 @@ end;
stoch_simul; stoch_simul;
L = load('benchmark_results.mat'); L = load(['benchmark' filesep 'Output' filesep 'benchmark_results.mat']);
if max(max(abs(L.oo_.dr.ghu - oo_.dr.ghu))) > 1e-12 if max(max(abs(L.oo_.dr.ghu - oo_.dr.ghu))) > 1e-12
error('Failure in external function') error('Failure in external function')
end end

View File

@ -45,7 +45,7 @@ end;
stoch_simul; stoch_simul;
L = load('benchmark_results.mat'); L = load(['benchmark' filesep 'Output' filesep 'benchmark_results.mat']);
if max(max(abs(L.oo_.dr.ghu - oo_.dr.ghu))) > 1e-9 if max(max(abs(L.oo_.dr.ghu - oo_.dr.ghu))) > 1e-9
error('Failure in external function') error('Failure in external function')
end end

View File

@ -45,7 +45,7 @@ end;
stoch_simul; stoch_simul;
L = load('benchmark_results.mat'); L = load(['benchmark' filesep 'Output' filesep 'benchmark_results.mat']);
if max(max(abs(L.oo_.dr.ghu - oo_.dr.ghu))) > 1e-9 if max(max(abs(L.oo_.dr.ghu - oo_.dr.ghu))) > 1e-9
error('Failure in external function') error('Failure in external function')
end end

View File

@ -152,7 +152,7 @@ estimation(datafile='data_ca1.m',first_obs=8,nobs=79,mh_nblocks=1,
// run this to produce posterior samples of filtered, smoothed and irf variables, if not yet done // run this to produce posterior samples of filtered, smoothed and irf variables, if not yet done
//estimation(datafile='data_ca1.m',first_obs=8,nobs=79,mh_nblocks=2,prefilter=1,mh_jscale=0.3, //estimation(datafile='data_ca1.m',first_obs=8,nobs=79,mh_nblocks=2,prefilter=1,mh_jscale=0.3,
// mh_replic=0, mode_file=ls2003_mode, mode_compute=0, load_mh_file, bayesian_irf, // mh_replic=0, mode_file='ls2003/Output/ls2003_mode', mode_compute=0, load_mh_file, bayesian_irf,
// filtered_vars, smoother, mh_drop=0.6); // filtered_vars, smoother, mh_drop=0.6);
disp(' '); disp(' ');
@ -163,7 +163,7 @@ disp(' ');
disp('Press ENTER to continue'); pause(5); disp('Press ENTER to continue'); pause(5);
dynare_sensitivity(nodisplay, pprior=0,Nsam=512,neighborhood_width=0.2, dynare_sensitivity(nodisplay, pprior=0,Nsam=512,neighborhood_width=0.2,
mode_file=ls2003_mode, // specifies the mode file where the mode and Hessian are stored mode_file='ls2003/Output/ls2003_mode', // specifies the mode file where the mode and Hessian are stored
datafile='data_ca1.m',first_obs=8,nobs=79,prefilter=1, datafile='data_ca1.m',first_obs=8,nobs=79,prefilter=1,
rmse=1); rmse=1);
@ -174,7 +174,7 @@ disp(' ');
disp('Press ENTER to continue'); pause(5); disp('Press ENTER to continue'); pause(5);
dynare_sensitivity(nodisplay, pprior=0,Nsam=512, dynare_sensitivity(nodisplay, pprior=0,Nsam=512,
mode_file=ls2003_mode // specifies the mode file where the mode and Hessian are stored mode_file='ls2003/Output/ls2003_mode' // specifies the mode file where the mode and Hessian are stored
); );
@ -182,7 +182,7 @@ disp(' ');
disp('RMSE ANALYSIS FOR MULTIVARIATE SAMPLE AT THE POSTERIOR MODE'); disp('RMSE ANALYSIS FOR MULTIVARIATE SAMPLE AT THE POSTERIOR MODE');
disp(' '); disp(' ');
disp('Press ENTER to continue'); pause(5); disp('Press ENTER to continue'); pause(5);
dynare_sensitivity(nodisplay, mode_file=ls2003_mode, dynare_sensitivity(nodisplay, mode_file='ls2003/Output/ls2003_mode',
datafile='data_ca1.m',first_obs=8,nobs=79,prefilter=1, datafile='data_ca1.m',first_obs=8,nobs=79,prefilter=1,
pprior=0, pprior=0,
stab=0, stab=0,
@ -200,7 +200,7 @@ disp('datafile=data_ca1.m,first_obs=8,nobs=79,prefilter=1,')
disp('rmse=1, alpha2_rmse=0, alpha_rmse=0);') disp('rmse=1, alpha2_rmse=0, alpha_rmse=0);')
disp(' '); disp(' ');
disp('Press ENTER to continue'); pause(5); disp('Press ENTER to continue'); pause(5);
//dynare_sensitivity(pprior=0,Nsam=2048,alpha2_stab=0.4,mode_file=ls2003_mode, //dynare_sensitivity(pprior=0,Nsam=2048,alpha2_stab=0.4,mode_file='ls2003/Output/ls2003_mode',
//datafile='data_ca1.m',first_obs=8,nobs=79,prefilter=1, //datafile='data_ca1.m',first_obs=8,nobs=79,prefilter=1,
//rmse=1, //rmse=1,
//alpha2_rmse=0, // no correlation analysis //alpha2_rmse=0, // no correlation analysis
@ -211,7 +211,7 @@ disp(' ');
disp('RMSE ANALYSIS FOR POSTERIOR MCMC sample (ppost=1)'); disp('RMSE ANALYSIS FOR POSTERIOR MCMC sample (ppost=1)');
disp('Needs a call to dynare_estimation to load all MH environment'); disp('Needs a call to dynare_estimation to load all MH environment');
disp('Press ENTER to continue'); pause(5); disp('Press ENTER to continue'); pause(5);
//estimation(datafile='data_ca1.m',first_obs=8,nobs=79,mh_nblocks=2, mode_file=ls2003_mode, load_mh_file, //estimation(datafile='data_ca1.m',first_obs=8,nobs=79,mh_nblocks=2, mode_file='ls2003/Output/ls2003_mode', load_mh_file,
// prefilter=1,mh_jscale=0.5,mh_replic=0, mode_compute=0, mh_drop=0.6); // prefilter=1,mh_jscale=0.5,mh_replic=0, mode_compute=0, mh_drop=0.6);
dynare_sensitivity(nodisplay, stab=0, // no need for stability analysis since the posterior sample is surely OK dynare_sensitivity(nodisplay, stab=0, // no need for stability analysis since the posterior sample is surely OK

View File

@ -38,7 +38,7 @@ if ~oo_.deterministic_simulation.status
error('Perfect foresight simulation failed'); error('Perfect foresight simulation failed');
end end
base_results=load('sim_exo_lead_lag_results.mat'); base_results=load(['sim_exo_lead_lag' filesep 'Output' filesep 'sim_exo_lead_lag_results.mat']);
if max(max(abs(base_results.oo_.endo_simul(1:5,:) - oo_.endo_simul(1:5,:)))) > 1e-8 if max(max(abs(base_results.oo_.endo_simul(1:5,:) - oo_.endo_simul(1:5,:)))) > 1e-8
error('Simulation with leads and lags doesn''t match the one with auxiliary variables') error('Simulation with leads and lags doesn''t match the one with auxiliary variables')
end end
@ -63,7 +63,7 @@ if ~oo_.deterministic_simulation.status
error('Perfect foresight simulation failed'); error('Perfect foresight simulation failed');
end end
base_results=load('sim_exo_lead_lag_results.mat'); base_results=load(['sim_exo_lead_lag' filesep 'Output' filesep 'sim_exo_lead_lag_results.mat']);
if max(max(abs(base_results.oo_.endo_simul(1:5,:) - oo_.endo_simul(1:5,:)))) > 1e-8 if max(max(abs(base_results.oo_.endo_simul(1:5,:) - oo_.endo_simul(1:5,:)))) > 1e-8
error('Simulation with leads and lags doesn''t match the one with auxiliary variables') error('Simulation with leads and lags doesn''t match the one with auxiliary variables')
end end
@ -84,7 +84,7 @@ if ~oo_.deterministic_simulation.status
error('Perfect foresight simulation failed'); error('Perfect foresight simulation failed');
end end
base_results=load('sim_exo_lead_lag_results.mat'); base_results=load(['sim_exo_lead_lag' filesep 'Output' filesep 'sim_exo_lead_lag_results.mat']);
if max(max(abs(base_results.oo_.endo_simul(1:5,:) - oo_.endo_simul(1:5,:)))) > 1e-8 if max(max(abs(base_results.oo_.endo_simul(1:5,:) - oo_.endo_simul(1:5,:)))) > 1e-8
error('Simulation with leads and lags doesn''t match the one with auxiliary variables') error('Simulation with leads and lags doesn''t match the one with auxiliary variables')
end end
@ -105,7 +105,7 @@ if ~oo_.deterministic_simulation.status
error('Perfect foresight simulation failed'); error('Perfect foresight simulation failed');
end end
base_results=load('sim_exo_lead_lag_results.mat'); base_results=load(['sim_exo_lead_lag' filesep 'Output' filesep 'sim_exo_lead_lag_results.mat']);
if max(max(abs(base_results.oo_.endo_simul(1:5,:) - oo_.endo_simul(1:5,:)))) > 1e-8 if max(max(abs(base_results.oo_.endo_simul(1:5,:) - oo_.endo_simul(1:5,:)))) > 1e-8
error('Simulation with leads and lags doesn''t match the one with auxiliary variables') error('Simulation with leads and lags doesn''t match the one with auxiliary variables')
end end
@ -126,7 +126,7 @@ if ~oo_.deterministic_simulation.status
error('Perfect foresight simulation failed'); error('Perfect foresight simulation failed');
end end
base_results=load('sim_exo_lead_lag_results.mat'); base_results=load(['sim_exo_lead_lag' filesep 'Output' filesep 'sim_exo_lead_lag_results.mat']);
if max(max(abs(base_results.oo_.endo_simul(1:5,:) - oo_.endo_simul(1:5,:)))) > 1e-8 if max(max(abs(base_results.oo_.endo_simul(1:5,:) - oo_.endo_simul(1:5,:)))) > 1e-8
error('Simulation with leads and lags doesn''t match the one with auxiliary variables') error('Simulation with leads and lags doesn''t match the one with auxiliary variables')
end end

View File

@ -66,11 +66,11 @@ steady;
stoch_simul(order=2,k_order_solver,periods=1000); stoch_simul(order=2,k_order_solver,periods=1000);
if ~exist('fs2000k2a_results.mat','file'); if ~exist(['fs2000k2a' filesep 'Output' filesep 'fs2000k2a_results.mat'],'file');
error('fs2000k2a must be run first'); error('fs2000k2a must be run first');
end; end;
oo1 = load('fs2000k2a_results','oo_'); oo1 = load(['fs2000k2a' filesep 'Output' filesep 'fs2000k2a_results'],'oo_');
dr0 = oo1.oo_.dr; dr0 = oo1.oo_.dr;
dr = oo_.dr; dr = oo_.dr;

View File

@ -66,11 +66,11 @@ steady;
stoch_simul(order=2,k_order_solver,periods=1000); stoch_simul(order=2,k_order_solver,periods=1000);
if ~exist('fs2000k2a_results.mat','file'); if ~exist(['fs2000k2a' filesep 'Output' filesep 'fs2000k2a_results.mat'],'file');
error('fs2000k2a must be run first'); error('fs2000k2a must be run first');
end; end;
oo1 = load('fs2000k2a_results','oo_'); oo1 = load(['fs2000k2a' filesep 'Output' filesep 'fs2000k2a_results'],'oo_');
dr0 = oo1.oo_.dr; dr0 = oo1.oo_.dr;
dr = oo_.dr; dr = oo_.dr;

View File

@ -66,11 +66,11 @@ steady;
stoch_simul(order=3,periods=1000); stoch_simul(order=3,periods=1000);
if ~exist('fs2000k2a_results.mat','file'); if ~exist(['fs2000k2a' filesep 'Output' filesep 'fs2000k2a_results.mat'],'file');
error('fs2000k2a must be run first'); error('fs2000k2a must be run first');
end; end;
oo1 = load('fs2000k2a_results','oo_'); oo1 = load(['fs2000k2a' filesep 'Output' filesep 'fs2000k2a_results'],'oo_');
dr0 = oo1.oo_.dr; dr0 = oo1.oo_.dr;
dr = oo_.dr; dr = oo_.dr;

View File

@ -66,11 +66,11 @@ steady;
stoch_simul(order=3,periods=1000); stoch_simul(order=3,periods=1000);
if ~exist('fs2000k2a_results.mat','file'); if ~exist(['fs2000k2a' filesep 'Output' filesep 'fs2000k2a_results.mat'],'file');
error('fs2000k2a must be run first'); error('fs2000k2a must be run first');
end; end;
oo1 = load('fs2000k2a_results','oo_'); oo1 = load(['fs2000k2a' filesep 'Output' filesep 'fs2000k2a_results'],'oo_');
dr0 = oo1.oo_.dr; dr0 = oo1.oo_.dr;
dr = oo_.dr; dr = oo_.dr;

View File

@ -74,11 +74,11 @@ steady;
stoch_simul(order=2,k_order_solver,irf=0); stoch_simul(order=2,k_order_solver,irf=0);
if ~exist('fs2000k2_m_results.mat','file'); if ~exist(['fs2000k2_m' filesep 'Output' filesep 'fs2000k2_m_results.mat'],'file');
error('fs2000k2_m must be run first'); error('fs2000k2_m must be run first');
end; end;
oo1 = load('fs2000k2_m_results','oo_'); oo1 = load(['fs2000k2_m' filesep 'Output' filesep 'fs2000k2_m_results'],'oo_');
dr0 = oo1.oo_.dr; dr0 = oo1.oo_.dr;
dr = oo_.dr; dr = oo_.dr;

View File

@ -73,11 +73,11 @@ steady;
stoch_simul(order=2,k_order_solver,irf=0); stoch_simul(order=2,k_order_solver,irf=0);
if ~exist('fs2000k2_use_dll_results.mat','file'); if ~exist(['fs2000k2_use_dll' filesep 'Output' filesep 'fs2000k2_use_dll_results.mat'],'file');
error('fs2000k2_use_dll must be run first'); error('fs2000k2_use_dll must be run first');
end; end;
oo1 = load('fs2000k2_use_dll_results','oo_'); oo1 = load(['fs2000k2_use_dll' filesep 'Output' filesep 'fs2000k2_use_dll_results'],'oo_');
dr0 = oo1.oo_.dr; dr0 = oo1.oo_.dr;
dr = oo_.dr; dr = oo_.dr;

View File

@ -12,7 +12,7 @@ stderr gy_obs, 1;
corr gp_obs, gy_obs,0; corr gp_obs, gy_obs,0;
end; end;
@#define mode_file_name="fs2000_corr_ME_mode" @#define mode_file_name="'fs2000_corr_ME/Output/fs2000_corr_ME_mode'"
@#define data_file_name="fsdat_simul_corr_ME" @#define data_file_name="fsdat_simul_corr_ME"
@#include "fs2000_estimation_check.inc" @#include "fs2000_estimation_check.inc"

View File

@ -12,7 +12,7 @@ stderr gy_obs, 1;
corr gp_obs, gy_obs,0; corr gp_obs, gy_obs,0;
end; end;
@#define mode_file_name="fs2000_corr_ME_missing_mode" @#define mode_file_name="'fs2000_corr_ME_missing/Output/fs2000_corr_ME_missing_mode'"
@#define data_file_name="fsdat_simul_corr_ME_missing" @#define data_file_name="fsdat_simul_corr_ME_missing"
@#include "fs2000_estimation_check.inc" @#include "fs2000_estimation_check.inc"

View File

@ -29,7 +29,7 @@ stderr gy_obs, 1;
//corr gp_obs, gy_obs,0; //corr gp_obs, gy_obs,0;
end; end;
@#define mode_file_name="fs2000_uncorr_ME_mode" @#define mode_file_name="'fs2000_uncorr_ME/Output/fs2000_uncorr_ME_mode'"
@#define data_file_name="fsdat_simul_uncorr_ME" @#define data_file_name="fsdat_simul_uncorr_ME"
@#include "fs2000_estimation_check.inc" @#include "fs2000_estimation_check.inc"

View File

@ -12,7 +12,7 @@ stderr gy_obs, 1;
//corr gp_obs, gy_obs,0; //corr gp_obs, gy_obs,0;
end; end;
@#define mode_file_name="fs2000_uncorr_ME_missing_mode" @#define mode_file_name="'fs2000_uncorr_ME_missing/Output/fs2000_uncorr_ME_missing_mode'"
@#define data_file_name="fsdat_simul_uncorr_ME_missing" @#define data_file_name="fsdat_simul_uncorr_ME_missing"
@#include "fs2000_estimation_check.inc" @#include "fs2000_estimation_check.inc"

View File

@ -12,7 +12,7 @@ stderr Y_obs, 0.05;
corr Y_obs, P_obs,0.5; corr Y_obs, P_obs,0.5;
end; end;
@#define mode_file_name="fs2000ns_corr_ME_mode" @#define mode_file_name="'fs2000ns_corr_ME/Output/fs2000ns_corr_ME_mode'"
@#define data_file_name="fs_ns_dat_simul_corr_ME" @#define data_file_name="fs_ns_dat_simul_corr_ME"
@#include "fs2000ns_estimation_check.inc" @#include "fs2000ns_estimation_check.inc"

View File

@ -12,7 +12,7 @@ stderr Y_obs, 0.05;
corr Y_obs, P_obs,0.5; corr Y_obs, P_obs,0.5;
end; end;
@#define mode_file_name="fs2000ns_corr_ME_missing_mode" @#define mode_file_name="'fs2000ns_corr_ME_missing/Output/fs2000ns_corr_ME_missing_mode'"
@#define data_file_name="fs_ns_dat_simul_corr_ME_missing" @#define data_file_name="fs_ns_dat_simul_corr_ME_missing"
@#include "fs2000ns_estimation_check.inc" @#include "fs2000ns_estimation_check.inc"

View File

@ -36,7 +36,7 @@ stderr Y_obs, 0.05;
//corr gp_obs, gy_obs,0; //corr gp_obs, gy_obs,0;
end; end;
@#define mode_file_name="fs2000ns_uncorr_ME_mode" @#define mode_file_name="'fs2000ns_uncorr_ME/Output/fs2000ns_uncorr_ME_mode'"
@#define data_file_name="fs_ns_dat_simul_uncorr_ME" @#define data_file_name="fs_ns_dat_simul_uncorr_ME"
@#include "fs2000ns_estimation_check.inc" @#include "fs2000ns_estimation_check.inc"

View File

@ -12,7 +12,7 @@ stderr Y_obs, 0.05;
//corr gp_obs, gy_obs,0; //corr gp_obs, gy_obs,0;
end; end;
@#define mode_file_name="fs2000ns_uncorr_ME_missing_mode" @#define mode_file_name="'fs2000ns_uncorr_ME_missing/Output/fs2000ns_uncorr_ME_missing_mode'"
@#define data_file_name="fs_ns_dat_simul_uncorr_ME_missing" @#define data_file_name="fs_ns_dat_simul_uncorr_ME_missing"
@#include "fs2000ns_estimation_check.inc" @#include "fs2000ns_estimation_check.inc"

View File

@ -32,7 +32,7 @@ end;
varobs dw dx dy z; varobs dw dx dy z;
estimation(datafile=data,first_obs=1000,nobs=200,mh_replic=0,mode_compute=0,mode_file=algo1_mode,kalman_algo=2,filtered_vars,smoothed_state_uncertainty); estimation(datafile=data,first_obs=1000,nobs=200,mh_replic=0,mode_compute=0,mode_file='algo1/Output/algo1_mode',kalman_algo=2,filtered_vars,smoothed_state_uncertainty);
//checking smoother consistency //checking smoother consistency
X = oo_.SmoothedVariables; X = oo_.SmoothedVariables;
@ -55,7 +55,7 @@ if max(max(abs(dat(1000:1199,:)-S(:,[2:4 1])))) > 1e-10;
error('Test fails'); error('Test fails');
end; end;
o1 = load('algo1_results'); o1 = load(['algo1' filesep 'Output' filesep 'algo1_results.mat']);
obj_endo={'SmoothedVariables'; 'FilteredVariables'; 'UpdatedVariables'}; obj_endo={'SmoothedVariables'; 'FilteredVariables'; 'UpdatedVariables'};
obj_exo = {'SmoothedShocks';}; obj_exo = {'SmoothedShocks';};
nobj_endo = size(obj_endo,1); nobj_endo = size(obj_endo,1);

View File

@ -35,7 +35,7 @@ end;
varobs w x y; varobs w x y;
estimation(datafile=data,first_obs=1000,nobs=200,mh_replic=0,mode_compute=0,mode_file=algo3_mode,diffuse_filter,kalman_algo=4,filtered_vars,smoothed_state_uncertainty); estimation(datafile=data,first_obs=1000,nobs=200,mh_replic=0,mode_compute=0,mode_file='algo3/Output/algo3_mode',diffuse_filter,kalman_algo=4,filtered_vars,smoothed_state_uncertainty);
//checking smoother consistency //checking smoother consistency
X = oo_.SmoothedVariables; X = oo_.SmoothedVariables;
@ -58,7 +58,7 @@ if max(max(abs(dat(1000:1199,:)-S(:,[7:9])))) > 1e-10;
error('Test fails'); error('Test fails');
end; end;
o1 = load('algo3_results'); o1 = load(['algo3' filesep 'Output' filesep 'algo3_results.mat']);
obj_endo={'SmoothedVariables'; 'FilteredVariables'; 'UpdatedVariables'}; obj_endo={'SmoothedVariables'; 'FilteredVariables'; 'UpdatedVariables'};
obj_exo = {'SmoothedShocks';}; obj_exo = {'SmoothedShocks';};
nobj_endo = size(obj_endo,1); nobj_endo = size(obj_endo,1);

View File

@ -34,7 +34,7 @@ end;
varobs dw dx y z; varobs dw dx y z;
estimation(datafile=data,first_obs=1000,nobs=200,mh_replic=0,diffuse_filter); estimation(datafile=data,first_obs=1000,nobs=200,mh_replic=0,diffuse_filter);
//estimation(datafile=data,first_obs=1000,nobs=200,mh_replic=0,mode_compute=0,mode_file=algo3_mode,diffuse_filter); //estimation(datafile=data,first_obs=1000,nobs=200,mh_replic=0,mode_compute=0,mode_file='algo3/Output/algo3_mode',diffuse_filter);
//checking smoother consistency //checking smoother consistency
X = oo_.SmoothedVariables; X = oo_.SmoothedVariables;

View File

@ -34,7 +34,7 @@ end;
varobs dw dx y z; varobs dw dx y z;
estimation(datafile=data,first_obs=1000,nobs=200,mh_replic=0,diffuse_filter,smoothed_state_uncertainty); estimation(datafile=data,first_obs=1000,nobs=200,mh_replic=0,diffuse_filter,smoothed_state_uncertainty);
//estimation(datafile=data,first_obs=1000,nobs=200,mh_replic=0,mode_compute=0,mode_file=algo3_mode,diffuse_filter); //estimation(datafile=data,first_obs=1000,nobs=200,mh_replic=0,mode_compute=0,mode_file='algo3/Output/algo3_mode',diffuse_filter);
//checking smoother consistency //checking smoother consistency
X = oo_.SmoothedVariables; X = oo_.SmoothedVariables;

View File

@ -35,7 +35,7 @@ end;
varobs dw dx dy z; varobs dw dx dy z;
//estimation(datafile=data,first_obs=1000,nobs=200,mh_replic=0,kalman_algo=2); //estimation(datafile=data,first_obs=1000,nobs=200,mh_replic=0,kalman_algo=2);
estimation(datafile=data,first_obs=1000,nobs=200,mh_replic=0,mode_compute=0,mode_file=algoH1_mode,kalman_algo=2,filtered_vars,smoothed_state_uncertainty); estimation(datafile=data,first_obs=1000,nobs=200,mh_replic=0,mode_compute=0,mode_file='algoH1/Output/algoH1_mode',kalman_algo=2,filtered_vars,smoothed_state_uncertainty);
//checking smoother consistency //checking smoother consistency
X = oo_.SmoothedVariables; X = oo_.SmoothedVariables;
@ -60,7 +60,7 @@ if max(max(abs(dat(1000:1199,:)-S(:,[2:4 1])-ME))) > 1e-10;
error('Test fails'); error('Test fails');
end; end;
o1 = load('algoH1_results'); o1 = load(['algoH1' filesep 'Output' filesep 'algoH1_results.mat']);
obj_endo={'SmoothedVariables'; 'FilteredVariables'; 'UpdatedVariables'}; obj_endo={'SmoothedVariables'; 'FilteredVariables'; 'UpdatedVariables'};
obj_exo = {'SmoothedShocks';}; obj_exo = {'SmoothedShocks';};
nobj_endo = size(obj_endo,1); nobj_endo = size(obj_endo,1);

View File

@ -71,7 +71,7 @@ simul(periods=1000);
newton_solution_is_wrong = abs(evaluate_max_dynamic_residual(str2func('sw_newton.dynamic'), oo_.endo_simul, oo_.exo_simul, M_.params, oo_.steady_state, 1000, size(oo_.endo_simul, 1), 1, M_.lead_lag_incidence))>options_.dynatol.f; newton_solution_is_wrong = abs(evaluate_max_dynamic_residual(str2func('sw_newton.dynamic'), oo_.endo_simul, oo_.exo_simul, M_.params, oo_.steady_state, 1000, size(oo_.endo_simul, 1), 1, M_.lead_lag_incidence))>options_.dynatol.f;
lmmcp = load('sw_lmmcp_results'); lmmcp = load(['sw_lmmcp' filesep 'Output' filesep 'sw_lmmcp_results']);
lmmcp_solution_is_wrong = abs(evaluate_max_dynamic_residual(str2func('sw_newton.dynamic'), lmmcp.oo_.endo_simul, lmmcp.oo_.exo_simul, M_.params, oo_.steady_state, 1000, size(oo_.endo_simul, 1), 1, M_.lead_lag_incidence))>options_.dynatol.f; lmmcp_solution_is_wrong = abs(evaluate_max_dynamic_residual(str2func('sw_newton.dynamic'), lmmcp.oo_.endo_simul, lmmcp.oo_.exo_simul, M_.params, oo_.steady_state, 1000, size(oo_.endo_simul, 1), 1, M_.lead_lag_incidence))>options_.dynatol.f;

View File

@ -69,7 +69,7 @@ end;
stoch_simul(loglinear,order=1); stoch_simul(loglinear,order=1);
D = load('example4_loglinear_lagged_exogenous_results'); D = load(['example4_loglinear_lagged_exogenous' filesep 'Output' filesep 'example4_loglinear_lagged_exogenous_results']);
test1 = D.oo_.dr.ghx - oo_.dr.ghx; test1 = D.oo_.dr.ghx - oo_.dr.ghx;
if norm(test1) > 1e-16; if norm(test1) > 1e-16;

View File

@ -53,7 +53,7 @@ end;
@#include "borrcon_common.inc" @#include "borrcon_common.inc"
orig_results=load('borrcon_results.mat'); orig_results=load(['borrcon' filesep 'Output' filesep 'borrcon_results.mat']);
if max(max(abs(oo_.occbin.piecewise-orig_results.oo_.occbin.piecewise)))>1e-10 if max(max(abs(oo_.occbin.piecewise-orig_results.oo_.occbin.piecewise)))>1e-10
error('Results do not match') error('Results do not match')
end end

View File

@ -59,7 +59,7 @@ end;
@#include "dynrbc_common.inc" @#include "dynrbc_common.inc"
orig_results=load('dynrbc_results.mat'); orig_results=load(['dynrbc' filesep 'Output' filesep 'dynrbc_results.mat']);
if max(max(abs(oo_.occbin.piecewise-orig_results.oo_.occbin.piecewise)))>1e-10 if max(max(abs(oo_.occbin.piecewise-orig_results.oo_.occbin.piecewise)))>1e-10
error('Results do not match') error('Results do not match')
end end

View File

@ -33,13 +33,13 @@ stoch_simul(order=2, irf=0);
planner_objective_value = evaluate_planner_objective(M_, options_, oo_); planner_objective_value = evaluate_planner_objective(M_, options_, oo_);
if ~exist('neo_growth_results.mat','file'); if ~exist(['neo_growth' filesep 'Output' filesep 'neo_growth_results.mat'],'file');
error('neo_growth must be run first'); error('neo_growth must be run first');
end; end;
oo1 = load('neo_growth_results','oo_'); oo1 = load(['neo_growth' filesep 'Output' filesep 'neo_growth_results'],'oo_');
M1 = load('neo_growth_results','M_'); M1 = load(['neo_growth' filesep 'Output' filesep 'neo_growth_results'],'M_');
options1 = load('neo_growth_results','options_'); options1 = load(['neo_growth' filesep 'Output' filesep 'neo_growth_results'],'options_');
unc_W_hand = oo1.oo_.mean(strmatch('W',M1.M_.endo_names,'exact')); unc_W_hand = oo1.oo_.mean(strmatch('W',M1.M_.endo_names,'exact'));
initial_condition_states = repmat(oo1.oo_.dr.ys,1,M1.M_.maximum_lag); initial_condition_states = repmat(oo1.oo_.dr.ys,1,M1.M_.maximum_lag);

View File

@ -39,9 +39,9 @@ if ~exist('neo_growth_foresight_results.mat','file');
error('neo_growth_foresight must be run first'); error('neo_growth_foresight must be run first');
end; end;
oo1 = load('neo_growth_foresight_results','oo_'); oo1 = load(['neo_growth_foresight' filesep 'Output' filesep 'neo_growth_foresight_results'],'oo_');
M1 = load('neo_growth_foresight_results','M_'); M1 = load(['neo_growth_foresight' filesep 'Output' filesep 'neo_growth_foresight_results'],'M_');
options1 = load('neo_growth_foresight_results','options_'); options1 = load(['neo_growth_foresight' filesep 'Output' filesep 'neo_growth_foresight_results'],'options_');
cond_W_hand = oo1.oo_.endo_simul(strmatch('W',M1.M_.endo_names,'exact'),2); cond_W_hand = oo1.oo_.endo_simul(strmatch('W',M1.M_.endo_names,'exact'),2);
unc_W_hand = oo1.oo_.endo_simul(strmatch('W',M1.M_.endo_names,'exact'),end); unc_W_hand = oo1.oo_.endo_simul(strmatch('W',M1.M_.endo_names,'exact'),end);

View File

@ -38,13 +38,13 @@ evaluate_planner_objective;
if condWelfare~=oo_.planner_objective_value(1) if condWelfare~=oo_.planner_objective_value(1)
error('Values do not match'); error('Values do not match');
end end
if ~exist('neo_growth_k_order_results.mat','file'); if ~exist(['neo_growth_k_order' filesep 'Output' filesep 'neo_growth_k_order_results.mat'],'file');
error('neo_growth_k_order must be run first'); error('neo_growth_k_order must be run first');
end; end;
oo = load('neo_growth_k_order_results','oo_'); oo = load(['neo_growth_k_order' filesep 'Output' filesep 'neo_growth_k_order_results'],'oo_');
M = load('neo_growth_k_order_results','M_'); M = load(['neo_growth_k_order' filesep 'Output' filesep 'neo_growth_k_order_results'],'M_');
options = load('neo_growth_k_order_results','options_'); options = load(['neo_growth_k_order' filesep 'Output' filesep 'neo_growth_k_order_results'],'options_');
ind_U = strmatch('U', M.M_.endo_names,'exact'); ind_U = strmatch('U', M.M_.endo_names,'exact');
ind_W = strmatch('W', M.M_.endo_names,'exact'); ind_W = strmatch('W', M.M_.endo_names,'exact');

View File

@ -93,7 +93,7 @@ ramsey_model(planner_discount=0.99);
stoch_simul(order=1,irf=0); stoch_simul(order=1,irf=0);
evaluate_planner_objective; evaluate_planner_objective;
o1=load('nk_ramsey_expectation_results'); o1=load(['nk_ramsey_expectation' filesep 'Output' filesep 'nk_ramsey_expectation_results']);
if (norm(o1.oo_.dr.ghx-oo_.dr.ghx,inf) > 1e-12) if (norm(o1.oo_.dr.ghx-oo_.dr.ghx,inf) > 1e-12)
error('ghx doesn''t match') error('ghx doesn''t match')
end end

View File

@ -1,5 +1,5 @@
@#include "fs2000.common.inc" @#include "fs2000.common.inc"
if ~isoctave() && exist('simulannealbnd','file') if ~isoctave() && exist('simulannealbnd','file')
estimation(mode_compute=102,mode_file='../estimation/fs2000_mode',order=1, datafile='../fs2000/fsdat_simul', nobs=192, mh_replic=0, mh_nblocks=2, mh_jscale=0.8); estimation(mode_compute=102,mode_file='../estimation/fs2000/Output/fs2000_mode',order=1, datafile='../fs2000/fsdat_simul', nobs=192, mh_replic=0, mh_nblocks=2, mh_jscale=0.8);
end end

View File

@ -3,5 +3,5 @@
estimation(mode_compute=6,order=1, datafile='../fs2000/fsdat_simul', nobs=192, mh_replic=0, optim=('nclimb-mh', 10, 'ncov-mh', 1000, 'nscale-mh', 5000)); estimation(mode_compute=6,order=1, datafile='../fs2000/fsdat_simul', nobs=192, mh_replic=0, optim=('nclimb-mh', 10, 'ncov-mh', 1000, 'nscale-mh', 5000));
// test the mode file generated with mode_compute=6 // test the mode file generated with mode_compute=6
estimation(order=1,datafile='../fs2000/fsdat_simul',nobs=192,loglinear,mode_compute=0,mode_file=fs2000_6_mode,mh_replic=10, estimation(order=1,datafile='../fs2000/fsdat_simul',nobs=192,loglinear,mode_compute=0,mode_file='fs2000_6/Output/fs2000_6_mode',mh_replic=10,
posterior_sampler_options=('scale_file','fs2000_6_optimal_mh_scale_parameter')); posterior_sampler_options=('scale_file','fs2000_6/Output/fs2000_6_optimal_mh_scale_parameter'));

View File

@ -66,7 +66,7 @@ end;
estimation(datafile=data_ca1,first_obs=8,nobs=79,mh_replic=0,nodisplay); estimation(datafile=data_ca1,first_obs=8,nobs=79,mh_replic=0,nodisplay);
estimation(datafile=data_ca1,first_obs=8,nobs=79,mode_compute=0,nodisplay, mode_file=ls2003_mode, mh_nblocks=4, prefilter=1, mh_jscale=0.5, mh_replic=2000); estimation(datafile=data_ca1,first_obs=8,nobs=79,mode_compute=0,nodisplay, mode_file='ls2003/Output/ls2003_mode', mh_nblocks=4, prefilter=1, mh_jscale=0.5, mh_replic=2000);
estimation(datafile=data_ca1,first_obs=8,nobs=79,mode_compute=0,nodisplay, mode_file=ls2003_mode, mh_nblocks=4,prefilter=1,mh_jscale=0.5,mh_replic=2000,bayesian_irf,load_mh_file,smoother,forecast=12, filtered_vars, filter_step_ahead=[1 2 3 4]) y y_s R pie dq pie_s de A y_obs pie_obs R_obs; estimation(datafile=data_ca1,first_obs=8,nobs=79,mode_compute=0,nodisplay, mode_file='ls2003/Output/ls2003_mode', mh_nblocks=4,prefilter=1,mh_jscale=0.5,mh_replic=2000,bayesian_irf,load_mh_file,smoother,forecast=12, filtered_vars, filter_step_ahead=[1 2 3 4]) y y_s R pie dq pie_s de A y_obs pie_obs R_obs;

View File

@ -144,7 +144,7 @@ for iorder = 1:3
error('Something wrong with pruned_state_space.m compared to Andreasen et al 2018 Toolbox v2 at order %d.',iorder); error('Something wrong with pruned_state_space.m compared to Andreasen et al 2018 Toolbox v2 at order %d.',iorder);
end end
if iorder==3 if iorder==3
pruned_without_shock = load('AnSchorfheide_pruned_state_space_results.mat'); pruned_without_shock = load(['AnSchorfheide_pruned_state_space' filesep 'Output' filesep 'AnSchorfheide_pruned_state_space_results.mat']);
pruned_without_shock = pruned_without_shock.oo_.pruned; pruned_without_shock = pruned_without_shock.oo_.pruned;
norm_E_yx = norm(pruned.E_y - pruned_without_shock.E_y , Inf); norm_E_yx = norm(pruned.E_y - pruned_without_shock.E_y , Inf);
fprintf('max(sum(abs(E[y;x]''))): %d\n',norm_E_yx); fprintf('max(sum(abs(E[y;x]''))): %d\n',norm_E_yx);

View File

@ -68,7 +68,7 @@ model_diagnostics;
check; check;
stoch_simul(order=2,irf=0); stoch_simul(order=2,irf=0);
o1 = load('ds1_results','oo_'); o1 = load(['ds1' filesep 'Output' filesep 'ds1_results'],'oo_');
oo1 = o1.oo_.dr; oo1 = o1.oo_.dr;
oo2 = oo_.dr; oo2 = oo_.dr;
if any(abs(oo1.ghxx-oo2.ghxx) > 1e-14);error('ds1 with missing variable doesn''t reproduce ds2');end; if any(abs(oo1.ghxx-oo2.ghxx) > 1e-14);error('ds1 with missing variable doesn''t reproduce ds2');end;

View File

@ -62,11 +62,11 @@ var e_a; stderr 0.014;
var e_m; stderr 0.005; var e_m; stderr 0.005;
end; end;
results_estimation=load('fs2000_smooth_results'); results_estimation=load(['fs2000_smooth' filesep 'Output' filesep 'fs2000_smooth_results']);
M_.params=results_estimation.M_.params; M_.params=results_estimation.M_.params;
steady; steady;
OO = load('fs2000_smooth_results.mat'); OO = load(['fs2000_smooth' filesep 'Output' filesep 'fs2000_smooth_results']);;
M_.params = OO.M_.params; M_.params = OO.M_.params;
histval_file(filename = 'fs2000_histval.mat'); histval_file(filename = 'fs2000_histval.mat');