Fixes related to estimation under discretion
parent
931ebece92
commit
30bfa16211
|
@ -145,7 +145,11 @@ while fpar<B
|
|||
end
|
||||
stock_param(irun2,:) = deep;
|
||||
set_parameters(deep);
|
||||
if options_.discretionary_policy
|
||||
[dr,info,M_,options_,oo_] = discretionary_policy_1(options_.instruments,M_,options_,oo_);
|
||||
else
|
||||
[dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
|
||||
end
|
||||
oo_.dr = dr;
|
||||
if info(1)
|
||||
nosaddle = nosaddle + 1;
|
||||
|
|
|
@ -1,6 +1,17 @@
|
|||
function [dr, info, M_, options_, oo_]=discretionary_policy_1(Instruments, M_, options_, oo_)
|
||||
% Higher-level function for solving discretionary optimal policy
|
||||
% Has the same interface as resol.m
|
||||
% INPUTS
|
||||
% - Instruments [cell] array containing instrument names
|
||||
% - M_ [structure] Matlab's structure describing the model (M_).
|
||||
% - options_ [structure] Matlab's structure describing the current options (options_).
|
||||
% - oo_ [structure] Matlab's structure containing the results (oo_).
|
||||
%
|
||||
% OUTPUTS
|
||||
% - dr [structure] Reduced form model.
|
||||
% - info [integer] scalar or vector, error code.
|
||||
% - M_ [structure] Matlab's structure describing the model (M_).
|
||||
% - options_ [structure] Matlab's structure describing the current options (options_).
|
||||
% - oo_ [structure] Matlab's structure containing the results (oo_).
|
||||
|
||||
% Copyright (C) 2007-2020 Dynare Team
|
||||
%
|
||||
|
|
|
@ -115,7 +115,11 @@ if info
|
|||
pdraws(i,1) = {x2(SampleAddress(i,4),:)};
|
||||
if info-1
|
||||
set_parameters(pdraws{i,1});
|
||||
if options_.discretionary_policy
|
||||
[dr,info,M_,options_,oo_] = discretionary_policy_1(options_.instruments,M_,options_,oo_);
|
||||
else
|
||||
[dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
|
||||
end
|
||||
pdraws(i,2) = { dr };
|
||||
end
|
||||
old_mhfile = mhfile;
|
||||
|
|
|
@ -35,7 +35,8 @@ estimated_params;
|
|||
kappa, normal_pdf, 0.2, 0.1;
|
||||
end;
|
||||
|
||||
estimation(order = 1, datafile = dennis_simul, mh_replic = 2000);
|
||||
options_.plot_priors=0;
|
||||
estimation(order = 1, datafile = dennis_simul, mh_replic = 2000, mh_nblocks=1,smoother,bayesian_irf,moments_varendo) y i pi pi_c q;
|
||||
|
||||
if max(abs(oo_.posterior.optimization.mode - [1; 0.3433])) > 0.025
|
||||
error('Posterior mode too far from true parameter values');
|
||||
|
|
Loading…
Reference in New Issue