Debian Codegraph @

tests/discretionary_policy/dennis_1_estim_MoM.mod

raw
1 /* Test for estimation under discretionary optimal policy.
2 Uses the data generated by dennis_1.mod */
3
4 var y i pi pi_c q;
5 varexo g u e;
6
7 parameters omega kappa sigma beta alpha;
8
9 alpha = 0.4;
10 beta = 0.99;
11 sigma = 1;
12 omega = 0.9;
13 kappa = 0.3;
14
15 model(linear);
16 y = y(+1) -(omega/sigma)*(i-pi(+1))+g;
17 pi = beta*pi(+1)+kappa*y+u;
18 pi_c = pi+(alpha/(1-alpha))*(q-q(-1));
19 q = q(+1)-(1-alpha)*(i-pi(+1))+(1-alpha)*e;
20 end;
21
22 shocks;
23 var g; stderr 1;
24 var u; stderr 1;
25 var e; stderr 1;
26 end;
27
28 planner_objective pi_c^2 + y^2;
29 discretionary_policy(instruments=(i),irf=0,planner_discount=beta);
30
31 varobs y i pi;
32
33 estimated_params;
34 omega, normal_pdf, 0.9, 0.1;
35 kappa, normal_pdf, 0.2, 0.1;
36 end;
37
38
39 matched_moments;
40 y;
41 pi;
42 y*y;
43 pi*pi;
44 y*y(-1);
45 pi*pi(-1);
46 y*y(-3);
47 pi*pi(-3);
48 end;
49
50 method_of_moments(
51 % Necessary options
52 mom_method = GMM % method of moments method; possible values: GMM|SMM
53 , datafile = 'dennis_simul.m' % name of filename with data
54
55 , order = 1 % order of Taylor approximation in perturbation
56 % , penalized_estimator % include deviation from prior mean as additional moment restriction and use prior precision as weight
57 % , pruning % use pruned state space system at higher-order
58 % , verbose % display and store intermediate estimation results
59 , 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']
60 % , weighting_matrix_scaling_factor=1 % scaling of weighting matrix in objective function
61 , se_tolx=1e-6 % step size for numerical computation of standard errors
62 , TeX % print TeX tables and graphics
63 , mode_compute = 3 % specifies the optimizer for minimization of moments distance
64 , additional_optimizer_steps = [13] % vector of additional mode-finders run after mode_compute
65 , optim = ('TolFun' , 1D-6 % termination tolerance on the function value, a positive scalar
66 ,'TolX' , 1e-6 % termination tolerance on x, a positive scalar
67 )
68 , silent_optimizer % run minimization of moments distance silently without displaying results or saving files in between
69 , mode_check % plot the target function for values around the computed minimum for each estimated parameter in turn
70 );