parent
263e97dabe
commit
440a0e460b
|
@ -548,7 +548,8 @@ by the ``dynare`` command.
|
|||
results in the workspace available for further processing. More
|
||||
details are given under the relevant computing tasks. The
|
||||
``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
|
||||
``estimation_info`` are saved in the same file. Note that Matlab
|
||||
by default only allows ``.mat``-files up to 2GB. You can lift this
|
||||
|
|
|
@ -3890,7 +3890,8 @@ Computing the stochastic solution
|
|||
requested (i.e. ``periods`` :math:`>` 0). Note that if this
|
||||
option is greater than 1, the additional series will not 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``.
|
||||
|
||||
.. option:: solve_algo = INTEGER
|
||||
|
@ -5297,7 +5298,8 @@ block decomposition of the model (see :opt:`block`).
|
|||
achieve an acceptance rate of
|
||||
:ref:`AcceptanceRateTarget<art>`. The resulting scale parameter
|
||||
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
|
||||
:ref:`scale_file <scale-file>`. Both ``mode_compute=6`` and
|
||||
``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
|
||||
computing the mode, Dynare stores the mode (``xparam1``) and
|
||||
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
|
||||
prevent other function calls from implicitly using an updated
|
||||
``mode-file``. Thus, if the mod-file contains subsequent
|
||||
|
|
|
@ -78,4 +78,4 @@ hh = inv(posterior_covariance);
|
|||
fval = posterior_kernel_at_the_mode;
|
||||
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');
|
|
@ -101,7 +101,7 @@ if nnobs>1 || nfirstobs > 1
|
|||
end
|
||||
dynare_estimation_1(var_list,M_.dname);
|
||||
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
|
||||
if options_.recursive_estimation_restart
|
||||
for j=1:options_.recursive_estimation_restart
|
||||
|
|
|
@ -31,6 +31,10 @@ function dynare_estimation_1(var_list_,dname)
|
|||
|
||||
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_)
|
||||
mode_compute_o = options_.mode_compute;
|
||||
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;
|
||||
new_rat_hess_info = new_rat_hess_info.new_rat_hess_info;
|
||||
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;
|
||||
bayestopt_.jscale(:) = options_.mh_jscale;
|
||||
end
|
||||
|
@ -260,9 +264,9 @@ if ~isequal(options_.mode_compute,0) && ~options_.mh_posterior_mode_estimation
|
|||
end
|
||||
parameter_names = bayestopt_.name;
|
||||
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
|
||||
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
|
||||
|
||||
|
@ -375,7 +379,7 @@ end
|
|||
|
||||
if np > 0
|
||||
pindx = estim_params_.param_vals(:,1);
|
||||
save([M_.fname '_params.mat'],'pindx');
|
||||
save([M_.dname filesep 'Output' filesep M_.fname '_params.mat'],'pindx');
|
||||
end
|
||||
|
||||
switch options_.MCMC_jumping_covariance
|
||||
|
@ -472,7 +476,7 @@ if (any(bayestopt_.pshape >0 ) && options_.mh_replic) || ...
|
|||
else
|
||||
%get stored results if required
|
||||
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
|
||||
if ~options_.nodiagnostic
|
||||
if (options_.mh_replic>0 || (options_.load_mh_file && ~options_.load_results_after_load_mh))
|
||||
|
@ -778,7 +782,7 @@ end
|
|||
|
||||
if np > 0
|
||||
pindx = estim_params_.param_vals(:,1);
|
||||
save([M_.fname '_pindx.mat'] ,'pindx');
|
||||
save([M_.dname filesep 'Output' filesep M_.fname '_pindx.mat'] ,'pindx');
|
||||
end
|
||||
|
||||
%reset qz_criterium
|
||||
|
|
|
@ -92,11 +92,11 @@ if ~isempty(options_.mode_file)
|
|||
load(options_.mode_file,'xparam1')
|
||||
end
|
||||
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;
|
||||
clear c
|
||||
elseif ~isempty(options_.mode_file) && exist([fname_,'_mean.mat'])==2
|
||||
c=load([fname_,'_mean.mat'],'xparam1');
|
||||
elseif ~isempty(options_.mode_file) && exist([M_.dname filesep 'Output' filesep fname_,'_mean.mat'])==2
|
||||
c=load([M_.dname filesep 'Output' filesep fname_,'_mean.mat'],'xparam1');
|
||||
xparam1_mean=c.xparam1;
|
||||
clear c
|
||||
end
|
||||
|
|
|
@ -66,7 +66,7 @@ end
|
|||
% (usefull if the user wants to perform some computations using
|
||||
% the posterior mean instead of the posterior mode ==> ).
|
||||
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)... ');
|
||||
logdetSIGMA = log(det(SIGMA));
|
||||
|
|
|
@ -81,9 +81,9 @@ for i=1:NumberOfModels
|
|||
mstruct.oo_ = oo;
|
||||
else
|
||||
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
|
||||
mstruct = load([ModelNames{i} '_results.mat' ],'oo_');
|
||||
mstruct = load([ModelNames{i} filesep 'Output' filesep ModelNames{i} '_results.mat' ],'oo_');
|
||||
end
|
||||
end
|
||||
try
|
||||
|
|
|
@ -154,7 +154,7 @@ else
|
|||
end
|
||||
|
||||
if options_.debug
|
||||
save([M_.fname '_debug.mat'],'jacobia_')
|
||||
save([M_.dname filesep 'Output' filesep M_.fname '_debug.mat'],'jacobia_')
|
||||
end
|
||||
|
||||
dr=set_state_space(dr,M_,options_);
|
||||
|
|
|
@ -66,7 +66,7 @@ order = DynareOptions.order;
|
|||
replic = DynareOptions.simul_replic;
|
||||
|
||||
if replic > 1
|
||||
fname = [DynareModel.fname,'_simul'];
|
||||
fname = [DynareModel.dname filesep 'Output' DynareModel.fname,'_simul'];
|
||||
fh = fopen(fname,'w+');
|
||||
end
|
||||
|
||||
|
|
|
@ -128,7 +128,7 @@ elseif local_order == 2
|
|||
if ~isempty(infrow)
|
||||
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')
|
||||
save([M_.fname '_debug.mat'],'hessian1')
|
||||
save([M_.dname filesep 'Output' filesep M_.fname '_debug.mat'],'hessian1')
|
||||
end
|
||||
end
|
||||
if ~isempty(infrow)
|
||||
|
@ -140,7 +140,7 @@ elseif local_order == 2
|
|||
if ~isempty(nanrow)
|
||||
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')
|
||||
save([M_.fname '_debug.mat'],'hessian1')
|
||||
save([M_.dname filesep 'Output' filesep M_.fname '_debug.mat'],'hessian1')
|
||||
end
|
||||
end
|
||||
if ~isempty(nanrow)
|
||||
|
@ -155,7 +155,7 @@ if options_.debug
|
|||
if ~isempty(infrow)
|
||||
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: ')
|
||||
save([M_.fname '_debug.mat'],'jacobia_')
|
||||
save([M_.dname filesep 'Output' filesep M_.fname '_debug.mat'],'jacobia_')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -184,7 +184,7 @@ if options_.debug
|
|||
if ~isempty(nanrow)
|
||||
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: ')
|
||||
save([M_.fname '_debug.mat'],'jacobia_')
|
||||
save([M_.dname filesep 'Output' filesep M_.fname '_debug.mat'],'jacobia_')
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 5cfe6303e26fcaeff204e6d2ca3988b169621f46
|
||||
Subproject commit bb19d98712f2599380dfc704f98b33531d7414de
|
|
@ -92,7 +92,7 @@ steady(nocheck);
|
|||
|
||||
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;
|
||||
|
||||
if max(max(abs(benchmark.oo_.dr.ghx-oo_.dr.ghx) > threshold));
|
||||
|
|
|
@ -76,7 +76,7 @@ check;
|
|||
|
||||
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;
|
||||
|
||||
if max(max(abs(benchmark.oo_.dr.ghx-oo_.dr.ghx) > threshold));
|
||||
|
|
|
@ -57,7 +57,7 @@ steady;
|
|||
|
||||
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;
|
||||
|
||||
if max(max(abs(benchmark.oo_.dr.ghx-oo_.dr.ghx) > threshold));
|
||||
|
|
|
@ -45,7 +45,7 @@ end;
|
|||
|
||||
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;
|
||||
|
||||
if max(max(abs(benchmark.oo_.dr.ghx-oo_.dr.ghx) > threshold));
|
||||
|
|
|
@ -43,7 +43,7 @@ end;
|
|||
|
||||
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;
|
||||
|
||||
if max(max(abs(benchmark.oo_.dr.ghx-oo_.dr.ghx) > threshold));
|
||||
|
|
|
@ -1412,13 +1412,6 @@ clean-local:
|
|||
rm -f $(patsubst %.trs, %.json, $(O_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 -rf $(patsubst %.mod, %, $(MODFILES))
|
||||
|
|
|
@ -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);
|
||||
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')
|
||||
);
|
||||
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=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=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/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
|
||||
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=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_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/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/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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
|
||||
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);
|
||||
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')
|
||||
);
|
||||
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=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=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/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
|
||||
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=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_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/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/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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
|
||||
if abs(fval_Bayes_1-fval_Bayes_2)>1e-5 || abs(fval_Bayes_1-fval_Bayes_3)>1e-5
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
@#define mfs = 1
|
||||
@#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
|
||||
error('Inconsistency with mfs=0')
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
@#define mfs = 2
|
||||
@#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
|
||||
error('Inconsistency with mfs=0')
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
@#define mfs = 3
|
||||
@#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
|
||||
error('Inconsistency with mfs=0')
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
[~, 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);
|
||||
|
||||
|
|
|
@ -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')
|
||||
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
|
||||
error('Solution of forward part of the model not correct')
|
||||
end
|
||||
|
|
|
@ -44,7 +44,7 @@ if ~oo_.deterministic_simulation.status
|
|||
error('Perfect foresight simulation failed')
|
||||
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) -...
|
||||
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) -...
|
||||
|
@ -58,7 +58,7 @@ if max(abs(base_results.oo_.exo_simul(1:end-base_results.M_.maximum_lead-base_re
|
|||
end
|
||||
|
||||
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) -...
|
||||
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')
|
||||
|
|
|
@ -47,7 +47,7 @@ if ~oo_.deterministic_simulation.status
|
|||
error('Perfect foresight simulation failed')
|
||||
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) -...
|
||||
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) -...
|
||||
|
|
|
@ -42,7 +42,7 @@ if ~oo_.deterministic_simulation.status
|
|||
error('Perfect foresight simulation failed')
|
||||
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) -...
|
||||
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) -...
|
||||
|
@ -51,7 +51,7 @@ if max(abs(base_results.oo_.endo_simul(strmatch('c',base_results.M_.endo_names,'
|
|||
end
|
||||
|
||||
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)' -...
|
||||
oo_.exo_simul(M_.maximum_lag:end-M_.maximum_lead-3,strmatch('x', M_.exo_names, 'exact'))))>1e-8
|
||||
|
|
|
@ -47,7 +47,7 @@ if ~oo_.deterministic_simulation.status
|
|||
error('Perfect foresight simulation failed')
|
||||
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) -...
|
||||
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) -...
|
||||
|
|
|
@ -46,7 +46,7 @@ if ~oo_.deterministic_simulation.status
|
|||
error('Perfect foresight simulation failed')
|
||||
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) -...
|
||||
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) -...
|
||||
|
@ -55,7 +55,7 @@ if max(abs(base_results.oo_.endo_simul(strmatch('c',base_results.M_.endo_names,'
|
|||
end
|
||||
|
||||
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)' -...
|
||||
oo_.exo_simul(M_.maximum_lag:end-M_.maximum_lead-3,strmatch('x', M_.exo_names, 'exact'))))>1e-8
|
||||
|
|
|
@ -57,7 +57,7 @@ if ~oo_.deterministic_simulation.status
|
|||
error('Perfect foresight simulation failed')
|
||||
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) -...
|
||||
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) -...
|
||||
|
|
|
@ -79,6 +79,6 @@ end
|
|||
rplot Consumption;
|
||||
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);
|
||||
|
|
|
@ -79,6 +79,6 @@ end
|
|||
rplot Consumption;
|
||||
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);
|
||||
|
|
|
@ -81,7 +81,7 @@ end
|
|||
rplot Consumption;
|
||||
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;
|
||||
disp(norm(D.oo_.endo_simul - oo_.endo_simul));
|
||||
|
@ -102,7 +102,7 @@ end
|
|||
rplot Consumption;
|
||||
rplot Capital;
|
||||
|
||||
D = load('rbc_det_results');
|
||||
D = load(['rbc_det' filesep 'Output' filesep 'rbc_det_results']);
|
||||
if isoctave && options_.solve_algo==0
|
||||
%%acount for somehow weaker convergence criterion in Octave's fsolve
|
||||
tol_crit=1e-4;
|
||||
|
|
|
@ -81,7 +81,7 @@ end
|
|||
rplot Consumption;
|
||||
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;
|
||||
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 Capital;
|
||||
|
||||
D = load('rbc_det_results');
|
||||
D = load(['rbc_det' filesep 'Output' filesep 'rbc_det_results']);
|
||||
if isoctave && options_.solve_algo==0
|
||||
%%acount for somehow weaker convergence criterion in Octave's fsolve
|
||||
tol_crit=1e-4;
|
||||
|
|
|
@ -81,7 +81,7 @@ end
|
|||
rplot Consumption;
|
||||
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;
|
||||
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 Capital;
|
||||
|
||||
D = load('rbc_det_results');
|
||||
D = load(['rbc_det' filesep 'Output' filesep 'rbc_det_results']);
|
||||
if isoctave && options_.solve_algo==0
|
||||
%%acount for somehow weaker convergence criterion in Octave's fsolve
|
||||
tol_crit=1e-4;
|
||||
|
|
|
@ -219,7 +219,7 @@ end;
|
|||
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;
|
||||
|
||||
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
|
||||
warning('Planner objective does not match linear model')
|
||||
end
|
||||
|
|
|
@ -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'])
|
||||
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
|
||||
temp1=load([M_.dname '_mh1_blck1.mat']);
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
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,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 '_mh3_blck2.mat'],[M_.dname '_mh3_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 '_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
|
||||
temp1=load([M_.dname '_mh1_blck1.mat']);
|
||||
|
|
|
@ -5,14 +5,14 @@
|
|||
|
||||
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,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 '_mh3_blck2.mat'],[M_.dname '_mh3_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 '_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
|
||||
temp1=load([M_.dname '_mh1_blck1.mat']);
|
||||
|
|
|
@ -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'])
|
||||
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
|
||||
temp1=load([M_.dname '_mh1_blck1.mat']);
|
||||
|
|
|
@ -104,11 +104,11 @@ options_.smoother=0;
|
|||
options_.moments_varendo=0;
|
||||
options_.forecast=0;
|
||||
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));
|
||||
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
|
||||
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']);
|
||||
temp2=load([M_.dname filesep 'metropolis' filesep M_.dname '_mh1_blck1.mat']);
|
||||
|
@ -121,7 +121,7 @@ end
|
|||
|
||||
save('fs2000_result.mat','oo_')
|
||||
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
|
||||
|
||||
|
||||
|
|
|
@ -84,9 +84,9 @@ options_.mode_compute=4;
|
|||
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);
|
||||
|
||||
load fs2000_MCMC_jumping_covariance_mode hh;
|
||||
load('fs2000_MCMC_jumping_covariance/Output/fs2000_MCMC_jumping_covariance_mode','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.0001,mcmc_jumping_covariance=identity_matrix);
|
||||
|
|
|
@ -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);
|
||||
|
||||
@#define mode_file_name="fs2000_het_mode"
|
||||
@#define mode_file_name="'fs2000_het/Output/fs2000_het_mode'"
|
||||
@#include "fs2000_het_check.inc"
|
||||
|
|
|
@ -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);
|
||||
|
||||
@#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"
|
||||
|
|
|
@ -44,11 +44,11 @@ end;
|
|||
|
||||
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');
|
||||
end;
|
||||
|
||||
oo1 = load('example1_results','oo_');
|
||||
oo1 = load(['example1' filesep 'Output' filesep 'example1_results'],'oo_');
|
||||
|
||||
dr0 = oo1.oo_.dr;
|
||||
dr = oo_.dr;
|
||||
|
|
|
@ -51,11 +51,11 @@ end;
|
|||
|
||||
stoch_simul;
|
||||
|
||||
if ~exist('example1long_results.mat','file');
|
||||
if ~exist(['example1long' filesep 'Output' filesep 'example1long_results.mat'],'file');
|
||||
error('example1long must be run first');
|
||||
end;
|
||||
|
||||
oo1 = load('example1long_results','oo_');
|
||||
oo1 = load(['example1long' filesep 'Output' filesep 'example1long_results'],'oo_');
|
||||
|
||||
dr0 = oo1.oo_.dr;
|
||||
dr = oo_.dr;
|
||||
|
|
|
@ -51,11 +51,12 @@ end;
|
|||
|
||||
stoch_simul;
|
||||
|
||||
if ~exist('example1long_results.mat','file');
|
||||
if ~exist(['example1long' filesep 'Output' filesep 'example1long_results.mat'],'file');
|
||||
error('example1long must be run first');
|
||||
end;
|
||||
|
||||
oo1 = load('example1long_results','oo_');
|
||||
oo1 = load(['example1long' filesep 'Output' filesep 'example1long_results'],'oo_');
|
||||
|
||||
|
||||
dr0 = oo1.oo_.dr;
|
||||
dr = oo_.dr;
|
||||
|
|
|
@ -46,7 +46,7 @@ end;
|
|||
|
||||
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
|
||||
error('Failure in external function')
|
||||
end
|
||||
|
|
|
@ -45,7 +45,7 @@ end;
|
|||
|
||||
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
|
||||
error('Failure in external function')
|
||||
end
|
||||
|
|
|
@ -45,7 +45,7 @@ end;
|
|||
|
||||
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
|
||||
error('Failure in external function')
|
||||
end
|
||||
|
|
|
@ -47,7 +47,7 @@ end;
|
|||
|
||||
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
|
||||
error('Failure in external function')
|
||||
end
|
||||
|
|
|
@ -47,7 +47,7 @@ end;
|
|||
|
||||
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
|
||||
error('Failure in external function')
|
||||
end
|
||||
|
|
|
@ -45,7 +45,7 @@ end;
|
|||
|
||||
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
|
||||
error('Failure in external function')
|
||||
end
|
||||
|
|
|
@ -45,7 +45,7 @@ end;
|
|||
|
||||
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
|
||||
error('Failure in external function')
|
||||
end
|
||||
|
|
|
@ -45,7 +45,7 @@ end;
|
|||
|
||||
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
|
||||
error('Failure in external function')
|
||||
end
|
||||
|
|
|
@ -45,7 +45,7 @@ end;
|
|||
|
||||
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
|
||||
error('Failure in external function')
|
||||
end
|
||||
|
|
|
@ -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
|
||||
//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);
|
||||
|
||||
disp(' ');
|
||||
|
@ -163,7 +163,7 @@ disp(' ');
|
|||
disp('Press ENTER to continue'); pause(5);
|
||||
|
||||
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,
|
||||
rmse=1);
|
||||
|
||||
|
@ -174,7 +174,7 @@ disp(' ');
|
|||
disp('Press ENTER to continue'); pause(5);
|
||||
|
||||
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(' ');
|
||||
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,
|
||||
pprior=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(' ');
|
||||
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,
|
||||
//rmse=1,
|
||||
//alpha2_rmse=0, // no correlation analysis
|
||||
|
@ -211,7 +211,7 @@ disp(' ');
|
|||
disp('RMSE ANALYSIS FOR POSTERIOR MCMC sample (ppost=1)');
|
||||
disp('Needs a call to dynare_estimation to load all MH environment');
|
||||
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);
|
||||
|
||||
dynare_sensitivity(nodisplay, stab=0, // no need for stability analysis since the posterior sample is surely OK
|
||||
|
|
|
@ -38,7 +38,7 @@ if ~oo_.deterministic_simulation.status
|
|||
error('Perfect foresight simulation failed');
|
||||
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
|
||||
error('Simulation with leads and lags doesn''t match the one with auxiliary variables')
|
||||
end
|
||||
|
@ -63,7 +63,7 @@ if ~oo_.deterministic_simulation.status
|
|||
error('Perfect foresight simulation failed');
|
||||
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
|
||||
error('Simulation with leads and lags doesn''t match the one with auxiliary variables')
|
||||
end
|
||||
|
@ -84,7 +84,7 @@ if ~oo_.deterministic_simulation.status
|
|||
error('Perfect foresight simulation failed');
|
||||
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
|
||||
error('Simulation with leads and lags doesn''t match the one with auxiliary variables')
|
||||
end
|
||||
|
@ -105,7 +105,7 @@ if ~oo_.deterministic_simulation.status
|
|||
error('Perfect foresight simulation failed');
|
||||
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
|
||||
error('Simulation with leads and lags doesn''t match the one with auxiliary variables')
|
||||
end
|
||||
|
@ -126,7 +126,7 @@ if ~oo_.deterministic_simulation.status
|
|||
error('Perfect foresight simulation failed');
|
||||
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
|
||||
error('Simulation with leads and lags doesn''t match the one with auxiliary variables')
|
||||
end
|
||||
|
|
|
@ -66,11 +66,11 @@ steady;
|
|||
|
||||
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');
|
||||
end;
|
||||
|
||||
oo1 = load('fs2000k2a_results','oo_');
|
||||
oo1 = load(['fs2000k2a' filesep 'Output' filesep 'fs2000k2a_results'],'oo_');
|
||||
|
||||
dr0 = oo1.oo_.dr;
|
||||
dr = oo_.dr;
|
||||
|
|
|
@ -66,11 +66,11 @@ steady;
|
|||
|
||||
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');
|
||||
end;
|
||||
|
||||
oo1 = load('fs2000k2a_results','oo_');
|
||||
oo1 = load(['fs2000k2a' filesep 'Output' filesep 'fs2000k2a_results'],'oo_');
|
||||
|
||||
dr0 = oo1.oo_.dr;
|
||||
dr = oo_.dr;
|
||||
|
|
|
@ -66,11 +66,11 @@ steady;
|
|||
|
||||
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');
|
||||
end;
|
||||
|
||||
oo1 = load('fs2000k2a_results','oo_');
|
||||
oo1 = load(['fs2000k2a' filesep 'Output' filesep 'fs2000k2a_results'],'oo_');
|
||||
|
||||
dr0 = oo1.oo_.dr;
|
||||
dr = oo_.dr;
|
||||
|
|
|
@ -66,11 +66,11 @@ steady;
|
|||
|
||||
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');
|
||||
end;
|
||||
|
||||
oo1 = load('fs2000k2a_results','oo_');
|
||||
oo1 = load(['fs2000k2a' filesep 'Output' filesep 'fs2000k2a_results'],'oo_');
|
||||
|
||||
dr0 = oo1.oo_.dr;
|
||||
dr = oo_.dr;
|
||||
|
|
|
@ -74,11 +74,11 @@ steady;
|
|||
|
||||
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');
|
||||
end;
|
||||
|
||||
oo1 = load('fs2000k2_m_results','oo_');
|
||||
oo1 = load(['fs2000k2_m' filesep 'Output' filesep 'fs2000k2_m_results'],'oo_');
|
||||
|
||||
dr0 = oo1.oo_.dr;
|
||||
dr = oo_.dr;
|
||||
|
|
|
@ -73,11 +73,11 @@ steady;
|
|||
|
||||
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');
|
||||
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;
|
||||
dr = oo_.dr;
|
||||
|
|
|
@ -12,7 +12,7 @@ stderr gy_obs, 1;
|
|||
corr gp_obs, gy_obs,0;
|
||||
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"
|
||||
|
||||
@#include "fs2000_estimation_check.inc"
|
|
@ -12,7 +12,7 @@ stderr gy_obs, 1;
|
|||
corr gp_obs, gy_obs,0;
|
||||
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"
|
||||
|
||||
@#include "fs2000_estimation_check.inc"
|
|
@ -29,7 +29,7 @@ stderr gy_obs, 1;
|
|||
//corr gp_obs, gy_obs,0;
|
||||
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"
|
||||
|
||||
@#include "fs2000_estimation_check.inc"
|
|
@ -12,7 +12,7 @@ stderr gy_obs, 1;
|
|||
//corr gp_obs, gy_obs,0;
|
||||
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"
|
||||
|
||||
@#include "fs2000_estimation_check.inc"
|
||||
|
|
|
@ -12,7 +12,7 @@ stderr Y_obs, 0.05;
|
|||
corr Y_obs, P_obs,0.5;
|
||||
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"
|
||||
|
||||
@#include "fs2000ns_estimation_check.inc"
|
||||
|
|
|
@ -12,7 +12,7 @@ stderr Y_obs, 0.05;
|
|||
corr Y_obs, P_obs,0.5;
|
||||
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"
|
||||
|
||||
@#include "fs2000ns_estimation_check.inc"
|
||||
|
|
|
@ -36,7 +36,7 @@ stderr Y_obs, 0.05;
|
|||
//corr gp_obs, gy_obs,0;
|
||||
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"
|
||||
|
||||
@#include "fs2000ns_estimation_check.inc"
|
||||
|
|
|
@ -12,7 +12,7 @@ stderr Y_obs, 0.05;
|
|||
//corr gp_obs, gy_obs,0;
|
||||
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"
|
||||
|
||||
@#include "fs2000ns_estimation_check.inc"
|
||||
|
|
|
@ -32,7 +32,7 @@ end;
|
|||
|
||||
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
|
||||
X = oo_.SmoothedVariables;
|
||||
|
@ -55,7 +55,7 @@ if max(max(abs(dat(1000:1199,:)-S(:,[2:4 1])))) > 1e-10;
|
|||
error('Test fails');
|
||||
end;
|
||||
|
||||
o1 = load('algo1_results');
|
||||
o1 = load(['algo1' filesep 'Output' filesep 'algo1_results.mat']);
|
||||
obj_endo={'SmoothedVariables'; 'FilteredVariables'; 'UpdatedVariables'};
|
||||
obj_exo = {'SmoothedShocks';};
|
||||
nobj_endo = size(obj_endo,1);
|
||||
|
|
|
@ -35,7 +35,7 @@ end;
|
|||
|
||||
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
|
||||
X = oo_.SmoothedVariables;
|
||||
|
@ -58,7 +58,7 @@ if max(max(abs(dat(1000:1199,:)-S(:,[7:9])))) > 1e-10;
|
|||
error('Test fails');
|
||||
end;
|
||||
|
||||
o1 = load('algo3_results');
|
||||
o1 = load(['algo3' filesep 'Output' filesep 'algo3_results.mat']);
|
||||
obj_endo={'SmoothedVariables'; 'FilteredVariables'; 'UpdatedVariables'};
|
||||
obj_exo = {'SmoothedShocks';};
|
||||
nobj_endo = size(obj_endo,1);
|
||||
|
|
|
@ -34,7 +34,7 @@ end;
|
|||
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,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
|
||||
X = oo_.SmoothedVariables;
|
||||
|
|
|
@ -34,7 +34,7 @@ end;
|
|||
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,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
|
||||
X = oo_.SmoothedVariables;
|
||||
|
|
|
@ -35,7 +35,7 @@ end;
|
|||
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,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
|
||||
X = oo_.SmoothedVariables;
|
||||
|
@ -60,7 +60,7 @@ if max(max(abs(dat(1000:1199,:)-S(:,[2:4 1])-ME))) > 1e-10;
|
|||
error('Test fails');
|
||||
end;
|
||||
|
||||
o1 = load('algoH1_results');
|
||||
o1 = load(['algoH1' filesep 'Output' filesep 'algoH1_results.mat']);
|
||||
obj_endo={'SmoothedVariables'; 'FilteredVariables'; 'UpdatedVariables'};
|
||||
obj_exo = {'SmoothedShocks';};
|
||||
nobj_endo = size(obj_endo,1);
|
||||
|
|
|
@ -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;
|
||||
|
||||
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;
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ end;
|
|||
|
||||
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;
|
||||
if norm(test1) > 1e-16;
|
||||
|
|
|
@ -53,7 +53,7 @@ end;
|
|||
|
||||
@#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
|
||||
error('Results do not match')
|
||||
end
|
||||
|
|
|
@ -59,7 +59,7 @@ end;
|
|||
|
||||
@#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
|
||||
error('Results do not match')
|
||||
end
|
||||
|
|
|
@ -33,13 +33,13 @@ stoch_simul(order=2, irf=0);
|
|||
|
||||
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');
|
||||
end;
|
||||
|
||||
oo1 = load('neo_growth_results','oo_');
|
||||
M1 = load('neo_growth_results','M_');
|
||||
options1 = load('neo_growth_results','options_');
|
||||
oo1 = load(['neo_growth' filesep 'Output' filesep 'neo_growth_results'],'oo_');
|
||||
M1 = load(['neo_growth' filesep 'Output' filesep 'neo_growth_results'],'M_');
|
||||
options1 = load(['neo_growth' filesep 'Output' filesep 'neo_growth_results'],'options_');
|
||||
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);
|
||||
|
|
|
@ -39,9 +39,9 @@ if ~exist('neo_growth_foresight_results.mat','file');
|
|||
error('neo_growth_foresight must be run first');
|
||||
end;
|
||||
|
||||
oo1 = load('neo_growth_foresight_results','oo_');
|
||||
M1 = load('neo_growth_foresight_results','M_');
|
||||
options1 = load('neo_growth_foresight_results','options_');
|
||||
oo1 = load(['neo_growth_foresight' filesep 'Output' filesep 'neo_growth_foresight_results'],'oo_');
|
||||
M1 = load(['neo_growth_foresight' filesep 'Output' filesep 'neo_growth_foresight_results'],'M_');
|
||||
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);
|
||||
unc_W_hand = oo1.oo_.endo_simul(strmatch('W',M1.M_.endo_names,'exact'),end);
|
||||
|
||||
|
|
|
@ -38,13 +38,13 @@ evaluate_planner_objective;
|
|||
if condWelfare~=oo_.planner_objective_value(1)
|
||||
error('Values do not match');
|
||||
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');
|
||||
end;
|
||||
|
||||
oo = load('neo_growth_k_order_results','oo_');
|
||||
M = load('neo_growth_k_order_results','M_');
|
||||
options = load('neo_growth_k_order_results','options_');
|
||||
oo = load(['neo_growth_k_order' filesep 'Output' filesep 'neo_growth_k_order_results'],'oo_');
|
||||
M = load(['neo_growth_k_order' filesep 'Output' filesep 'neo_growth_k_order_results'],'M_');
|
||||
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_W = strmatch('W', M.M_.endo_names,'exact');
|
||||
|
|
|
@ -93,7 +93,7 @@ ramsey_model(planner_discount=0.99);
|
|||
stoch_simul(order=1,irf=0);
|
||||
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)
|
||||
error('ghx doesn''t match')
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
@#include "fs2000.common.inc"
|
||||
|
||||
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
|
||||
|
|
|
@ -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));
|
||||
|
||||
// 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,
|
||||
posterior_sampler_options=('scale_file','fs2000_6_optimal_mh_scale_parameter'));
|
||||
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/Output/fs2000_6_optimal_mh_scale_parameter'));
|
||||
|
|
|
@ -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,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_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);
|
||||
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;
|
||||
|
||||
|
||||
|
|
|
@ -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);
|
||||
end
|
||||
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;
|
||||
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);
|
||||
|
|
|
@ -68,7 +68,7 @@ model_diagnostics;
|
|||
check;
|
||||
stoch_simul(order=2,irf=0);
|
||||
|
||||
o1 = load('ds1_results','oo_');
|
||||
o1 = load(['ds1' filesep 'Output' filesep 'ds1_results'],'oo_');
|
||||
oo1 = o1.oo_.dr;
|
||||
oo2 = oo_.dr;
|
||||
if any(abs(oo1.ghxx-oo2.ghxx) > 1e-14);error('ds1 with missing variable doesn''t reproduce ds2');end;
|
||||
|
|
|
@ -62,11 +62,11 @@ var e_a; stderr 0.014;
|
|||
var e_m; stderr 0.005;
|
||||
end;
|
||||
|
||||
results_estimation=load('fs2000_smooth_results');
|
||||
results_estimation=load(['fs2000_smooth' filesep 'Output' filesep 'fs2000_smooth_results']);
|
||||
M_.params=results_estimation.M_.params;
|
||||
steady;
|
||||
|
||||
OO = load('fs2000_smooth_results.mat');
|
||||
OO = load(['fs2000_smooth' filesep 'Output' filesep 'fs2000_smooth_results']);;
|
||||
M_.params = OO.M_.params;
|
||||
|
||||
histval_file(filename = 'fs2000_histval.mat');
|
||||
|
|
Loading…
Reference in New Issue