diff --git a/matlab/+mom/default_option_mom_values.m b/matlab/+mom/default_option_mom_values.m index 5ce9d34a94e491d76a27b9fb754a4d2c6dccf850..6587dea748a3aa72740e82d89968d04cc567799a 100644 --- a/matlab/+mom/default_option_mom_values.m +++ b/matlab/+mom/default_option_mom_values.m @@ -318,6 +318,11 @@ options_mom_.varobs = options_.varobs; % observable variables in or options_mom_.varobs_id = options_.varobs_id; % index for observable variables in M_.endo_names options_mom_.obs_nbr = length(options_mom_.varobs); % number of observed variables +%related to discretionary policy +options_mom_.discretionary_policy = options_.discretionary_policy; % whether discretionary policy is used +options_mom_.discretionary_tol = options_.discretionary_tol; % tolerance of discretionary policy +options_mom_.dp = options_.dp; % other options + % related to call of dynare options_mom_.console_mode = options_.console_mode; if options_mom_.console_mode diff --git a/matlab/+mom/objective_function.m b/matlab/+mom/objective_function.m index 98247f51cbc698c2c0823fffd88afc6542577c6f..bd14210163f6767f771cff1e43c65227c869b3ec 100644 --- a/matlab/+mom/objective_function.m +++ b/matlab/+mom/objective_function.m @@ -105,10 +105,10 @@ end %-------------------------------------------------------------------------- -% Call resol to compute steady state and model solution +% Compute steady state and model solution %-------------------------------------------------------------------------- % Compute linear approximation around the deterministic steady state -[dr, info, M_.params] = resol(0, M_, options_mom_, dr, endo_steady_state, exo_steady_state, exo_det_steady_state); +[dr, info, M_.params] = compute_decision_rules(M_,options_mom_, dr, endo_steady_state, exo_steady_state, exo_det_steady_state); % Return, with endogenous penalty when possible, if resol issues an error code if info(1) if info(1) == 3 || info(1) == 4 || info(1) == 5 || info(1)==6 ||info(1) == 19 ||... diff --git a/meson.build b/meson.build index c0a20081670c758e85f0ed611c0287eb214476d7..ea1151ed27b308210f2aa024eb27ee8606a1f374 100644 --- a/meson.build +++ b/meson.build @@ -1040,7 +1040,8 @@ mod_and_m_tests = [ { 'test' : [ 'optimal_policy/RamseyConstraints/test1.mod' ] }, { 'test' : [ 'optimal_policy/Ramsey/Ramsey_Example_estimation.mod' ] }, { 'test' : [ 'discretionary_policy/dennis_1.mod', - 'discretionary_policy/dennis_1_estim.mod' ] }, + 'discretionary_policy/dennis_1_estim.mod', + 'discretionary_policy/dennis_1_estim_MoM.mod' ] }, { 'test' : [ 'discretionary_policy/Gali_discretion.mod' ] }, { 'test' : [ 'discretionary_policy/Gali_2015_chapter_3.mod', 'discretionary_policy/Gali_2015_chapter_3_nonlinear.mod' ] }, diff --git a/tests/discretionary_policy/dennis_1_estim_MoM.mod b/tests/discretionary_policy/dennis_1_estim_MoM.mod new file mode 100644 index 0000000000000000000000000000000000000000..8e77129df9a90e63854c261e4413f5f00268f78d --- /dev/null +++ b/tests/discretionary_policy/dennis_1_estim_MoM.mod @@ -0,0 +1,70 @@ +/* Test for estimation under discretionary optimal policy. + Uses the data generated by dennis_1.mod */ + +var y i pi pi_c q; +varexo g u e; + +parameters omega kappa sigma beta alpha; + +alpha = 0.4; +beta = 0.99; +sigma = 1; +omega = 0.9; +kappa = 0.3; + +model(linear); +y = y(+1) -(omega/sigma)*(i-pi(+1))+g; +pi = beta*pi(+1)+kappa*y+u; +pi_c = pi+(alpha/(1-alpha))*(q-q(-1)); +q = q(+1)-(1-alpha)*(i-pi(+1))+(1-alpha)*e; +end; + +shocks; + var g; stderr 1; + var u; stderr 1; + var e; stderr 1; +end; + +planner_objective pi_c^2 + y^2; +discretionary_policy(instruments=(i),irf=0,planner_discount=beta); + +varobs y i pi; + +estimated_params; + omega, normal_pdf, 0.9, 0.1; + kappa, normal_pdf, 0.2, 0.1; +end; + + +matched_moments; +y; +pi; +y*y; +pi*pi; +y*y(-1); +pi*pi(-1); +y*y(-3); +pi*pi(-3); +end; + +method_of_moments( + % Necessary options + mom_method = GMM % method of moments method; possible values: GMM|SMM + , datafile = 'dennis_simul.m' % name of filename with data + + , order = 1 % order of Taylor approximation in perturbation + % , penalized_estimator % include deviation from prior mean as additional moment restriction and use prior precision as weight + % , pruning % use pruned state space system at higher-order + % , verbose % display and store intermediate estimation results + , weighting_matrix = ['DIAGONAL','OPTIMAL'] % weighting matrix in moments distance objective function; possible values: OPTIMAL|IDENTITY_MATRIX|DIAGONAL|filename. Size of cell determines stages in iterated estimation, e.g. two state with ['DIAGONAL','OPTIMAL'] + % , weighting_matrix_scaling_factor=1 % scaling of weighting matrix in objective function + , se_tolx=1e-6 % step size for numerical computation of standard errors + , TeX % print TeX tables and graphics + , mode_compute = 3 % specifies the optimizer for minimization of moments distance + , additional_optimizer_steps = [13] % vector of additional mode-finders run after mode_compute + , optim = ('TolFun' , 1D-6 % termination tolerance on the function value, a positive scalar + ,'TolX' , 1e-6 % termination tolerance on x, a positive scalar + ) + , silent_optimizer % run minimization of moments distance silently without displaying results or saving files in between + , mode_check % plot the target function for values around the computed minimum for each estimated parameter in turn + ); \ No newline at end of file