MoM: cosmetical changes to description of options in testsuite

time-shift
Willi Mutschler 2021-01-07 10:33:09 +01:00
parent ba8d5d364d
commit 2b554e0511
No known key found for this signature in database
GPG Key ID: 91E724BF17A73F6D
5 changed files with 266 additions and 210 deletions

View File

@ -92,6 +92,7 @@ function [oo_, options_mom_, M_] = method_of_moments(bayestopt_, options_, oo_,
% - [ ] SMM with extended path
% - [ ] deal with measurement errors (once @wmutschl has implemented this in identification toolbox)
% - [ ] improve check for duplicate moments by using the cellfun and unique functions
% - [ ] dirname option to save output to different directory not yet implemented
% -------------------------------------------------------------------------
% Step 0: Check if required structures and options exist
% -------------------------------------------------------------------------
@ -133,9 +134,9 @@ if strcmp(options_mom_.mom.mom_method,'GMM') || strcmp(options_mom_.mom.mom_meth
options_mom_.mom = set_default_option(options_mom_.mom,'bartlett_kernel_lag',20); % bandwith in optimal weighting matrix
options_mom_.mom = set_default_option(options_mom_.mom,'penalized_estimator',false); % include deviation from prior mean as additional moment restriction and use prior precision as weight
options_mom_.mom = set_default_option(options_mom_.mom,'verbose',false); % display and store intermediate estimation results
options_mom_.mom = set_default_option(options_mom_.mom,'weighting_matrix',{'DIAGONAL'; 'DIAGONAL'}); % weighting matrix in moments distance objective function at each iteration of estimation; cell of strings with
options_mom_.mom = set_default_option(options_mom_.mom,'weighting_matrix',{'DIAGONAL'; 'DIAGONAL'}); % weighting matrix in moments distance objective function at each iteration of estimation;
% possible values are 'OPTIMAL', 'IDENTITY_MATRIX' ,'DIAGONAL' or a filename. Size of cell determines stages in iterated estimation.
options_mom_.mom = set_default_option(options_mom_.mom,'weighting_matrix_scaling_factor',1); % scaling of weighting matrix
options_mom_.mom = set_default_option(options_mom_.mom,'weighting_matrix_scaling_factor',1); % scaling of weighting matrix in objective function
options_mom_.mom = set_default_option(options_mom_.mom,'se_tolx',1e-5); % step size for numerical computation of standard errors
options_mom_ = set_default_option(options_mom_,'order',1); % order of Taylor approximation in perturbation
options_mom_ = set_default_option(options_mom_,'pruning',false); % use pruned state space system at higher-order
@ -169,6 +170,7 @@ options_mom_.mom.compute_derivs = false;% flag to compute derivs in objective fu
% General options that can be set by the user in the mod file, otherwise default values are provided
options_mom_ = set_default_option(options_mom_,'dirname',M_.dname); % specify directory in which to store estimation output [not yet working]
options_mom_ = set_default_option(options_mom_,'graph_format','eps'); % specify the file format(s) for graphs saved to disk
options_mom_ = set_default_option(options_mom_,'nodisplay',false); % do not display the graphs, but still save them to disk
options_mom_ = set_default_option(options_mom_,'nograph',false); % do not create graphs (which implies that they are not saved to the disk nor displayed)
@ -200,7 +202,7 @@ options_mom_ = set_default_option(options_mom_,'optim_opt',[]);
options_mom_ = set_default_option(options_mom_,'silent_optimizer',false); % run minimization of moments distance silently without displaying results or saving files in between
% Check plot options that can be set by the user in the mod file, otherwise default values are provided
options_mom_.mode_check.nolik = false; % we don't do likelihood (also this initializes mode_check substructure)
options_mom_.mode_check = set_default_option(options_mom_.mode_check,'status',false); % plot the target function for values around the computed minimum for each estimated parameter in turn. This is helpful to diagnose problems with the optimizer.
options_mom_.mode_check = set_default_option(options_mom_.mode_check,'status',false); % plot the target function for values around the computed minimum for each estimated parameter in turn. This is helpful to diagnose problems with the optimizer.
options_mom_.mode_check = set_default_option(options_mom_.mode_check,'neighbourhood_size',.5); % width of the window around the computed minimum to be displayed on the diagnostic plots. This width is expressed in percentage deviation. The Inf value is allowed, and will trigger a plot over the entire domain
options_mom_.mode_check = set_default_option(options_mom_.mode_check,'symmetric_plots',true); % ensure that the check plots are symmetric around the minimum. A value of 0 allows to have asymmetric plots, which can be useful if the minimum is close to a domain boundary, or in conjunction with neighbourhood_size = Inf when the domain is not the entire real line
options_mom_.mode_check = set_default_option(options_mom_.mode_check,'number_of_points',20); % number of points around the minimum where the target function is evaluated (for each parameter)
@ -762,25 +764,45 @@ for i = 1:length(optimizer_vec)
else
str = ' (additional_optimizer_steps';
end
if optimizer_vec{i} == 0; fprintf('\n %s=0): no minimization',str);
elseif optimizer_vec{i} == 1; fprintf('\n %s=1): fmincon',str);
elseif optimizer_vec{i} == 2; fprintf('\n %s=2): continuous simulated annealing',str);
elseif optimizer_vec{i} == 3; fprintf('\n %s=3): fminunc',str);
elseif optimizer_vec{i} == 4; fprintf('\n %s=4): csminwel',str);
elseif optimizer_vec{i} == 5; fprintf('\n %s=5): newrat',str);
elseif optimizer_vec{i} == 6; fprintf('\n %s=6): gmhmaxlik',str);
elseif optimizer_vec{i} == 7; fprintf('\n %s=7): fminsearch',str);
elseif optimizer_vec{i} == 8; fprintf('\n %s=8): Dynare Nelder-Mead simplex',str);
elseif optimizer_vec{i} == 9; fprintf('\n %s=9): CMA-ES',str);
elseif optimizer_vec{i} == 10; fprintf('\n %s=10): simpsa',str);
elseif optimizer_vec{i} == 11; fprintf('\n %s=11): online_auxiliary_filter',str);
elseif optimizer_vec{i} == 12; fprintf('\n %s=12): particleswarm',str);
elseif optimizer_vec{i} == 101; fprintf('\n %s=101): SolveOpt',str);
elseif optimizer_vec{i} == 102; fprintf('\n %s=102): simulannealbnd',str);
elseif optimizer_vec{i} == 13; fprintf('\n %s=13): lsqnonlin',str);
elseif ischar(optimizer_vec{i});fprintf('\n %s=%s): user-defined',str,optimizer_vec{i});
else
error('method_of_moments: Unknown optimizer, please contact the developers ')
switch optimizer_vec{i}
case 0
fprintf('\n %s=0): no minimization',str);
case 1
fprintf('\n %s=1): fmincon',str);
case 2
fprintf('\n %s=2): continuous simulated annealing',str);
case 3
fprintf('\n %s=3): fminunc',str);
case 4
fprintf('\n %s=4): csminwel',str);
case 5
fprintf('\n %s=5): newrat',str);
case 6
fprintf('\n %s=6): gmhmaxlik',str);
case 7
fprintf('\n %s=7): fminsearch',str);
case 8
fprintf('\n %s=8): Dynare Nelder-Mead simplex',str);
case 9
fprintf('\n %s=9): CMA-ES',str);
case 10
fprintf('\n %s=10): simpsa',str);
case 11
fprintf('\n %s=11): online_auxiliary_filter',str);
case 12
fprintf('\n %s=12): particleswarm',str);
case 101
fprintf('\n %s=101): SolveOpt',str);
case 102
fprintf('\n %s=102): simulannealbnd',str);
case 13
fprintf('\n %s=13): lsqnonlin',str);
otherwise
if ischar(optimizer_vec{i})
fprintf('\n %s=%s): user-defined',str,optimizer_vec{i});
else
error('method_of_moments: Unknown optimizer, please contact the developers ')
end
end
if options_mom_.silent_optimizer
fprintf(' (silent)');

View File

@ -1,4 +1,4 @@
% DSGE model used in replication files of
% DSGE model used in replication files of
% An, Sungbae and Schorfheide, Frank, (2007), Bayesian Analysis of DSGE Models, Econometric Reviews, 26, issue 2-4, p. 113-172.
% Adapted by Willi Mutschler (@wmutschl, willi@mutschler.eu)
% =========================================================================
@ -203,28 +203,33 @@ end
@#for mommethod in ["GMM", "SMM"]
method_of_moments(
% Necessery options
mom_method = @{mommethod} % method of moments method; possible values: GMM|SMM
, datafile = 'AnScho_MoM_data_@{orderApp}.mat' % name of filename with data
% Necessery options
mom_method = @{mommethod} % method of moments method; possible values: GMM|SMM
, datafile = 'AnScho_MoM_data_@{orderApp}.mat' % name of filename with data
% Options for both GMM and SMM
% Options for both GMM and SMM
% , bartlett_kernel_lag = 20 % bandwith in optimal weighting matrix
, order = @{orderApp} % order of Taylor approximation in perturbation
% , penalized_estimator % use penalized optimization
% , 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 = ['optimal'] % weighting matrix in moments distance objective function; possible values: OPTIMAL|IDENTITY_MATRIX|DIAGONAL|filename
, additional_optimizer_steps = [4] % vector of numbers for the iterations in the 2-step feasible method of moments
% , prefilter=0 % demean each data series by its empirical mean and use centered moments
%
% Options for SMM
, weighting_matrix = ['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
% Options for SMM
% , burnin=500 % number of periods dropped at beginning of simulation
% , bounded_shock_support % trim shocks in simulation to +- 2 stdev
% , drop = 500 % number of periods dropped at beginning of simulation
% , seed = 24051986 % seed used in simulations
% , simulation_multiple = 5 % multiple of the data length used for simulation
%
% General options
%, dirname = 'MM' % directory in which to store estimation output
% Options for GMM
@#if mommethod == "GMM"
, analytic_standard_errors % compute standard errors using analytical derivatives
@#endif
% General options
% , dirname = 'MM' % directory in which to store estimation output
% , graph_format = EPS % specify the file format(s) for graphs saved to disk
% , nodisplay % do not display the graphs, but still save them to disk
% , nograph % do not create graphs (which implies that they are not saved to the disk nor displayed)
@ -232,44 +237,50 @@ end
% , plot_priors = 1 % control plotting of priors
% , prior_trunc = 1e-10 % probability of extreme values of the prior density that is ignored when computing bounds for the parameters
% , TeX % print TeX tables and graphics
%
% Data and model options
%, first_obs = 501 % number of first observation
% , logdata % if loglinear is set, this option is necessary if the user provides data already in logs, otherwise the log transformation will be applied twice (this may result in complex data)
% , loglinear % computes a log-linear approximation of the model instead of a linear approximation
, nobs = 250 % number of observations
% , xls_sheet = willi % name of sheet with data in Excel
% Data and model options
% , first_obs = 501 % number of first observation
% , logdata % if data is already in logs
, nobs = 250 % number of observations
% , prefilter=0 % demean each data series by its empirical mean and use centered moments
% , xls_sheet = data % name/number of sheet with data in Excel
% , xls_range = B2:D200 % range of data in Excel sheet
%
% Optimization options that can be set by the user in the mod file, otherwise default values are provided
% , analytic_derivation % uses analytic derivatives to compute standard errors for GMM
%, huge_number=1D10 % value for replacing the infinite bounds on parameters by finite numbers. Used by some optimizers for numerical reasons
, mode_compute = @{optimizer} % specifies the optimizer for minimization of moments distance, note that by default there is a new optimizer
%, optim = ('TolFun', 1e-5
% ,'TolX', 1e-6
% ) % a list of NAME and VALUE pairs to set options for the optimization routines. Available options depend on mode_compute
, silent_optimizer % run minimization of moments distance silently without displaying results or saving files in between
% , tolf = 1e-5 % convergence criterion on function value for numerical differentiation
% , tolx = 1e-6 % convergence criterion on funciton input for numerical differentiation
%
% % Numerical algorithms options
% Optimization options that can be set by the user in the mod file, otherwise default values are provided
% , huge_number=1e7 % value for replacing the infinite bounds on parameters by finite numbers. Used by some optimizers for numerical reasons
, mode_compute = @{optimizer} % specifies the optimizer for minimization of moments distance
, additional_optimizer_steps = [1] % vector of additional mode-finders run after mode_compute
% optim: a list of NAME and VALUE pairs to set options for the optimization routines. Available options depend on mode_compute, some exemplary common options:
, optim = ('TolFun' , 1e-6 % termination tolerance on the function value, a positive scalar
,'TolX' , 1e-6 % termination tolerance on x, a positive scalar
,'MaxIter' , 3000 % maximum number of iterations allowed, a positive integer
,'MaxFunEvals' , 1D6 % maximum number of function evaluations allowed, a positive integer
% ,'UseParallel' , 1 % when true (and supported by optimizer) solver estimates gradients in parallel (using Matlab/Octave's parallel toolbox)
% ,'Jacobian' , 'off' % when 'off' gradient-based solvers approximate Jacobian using finite differences; for GMM we can also pass the analytical Jacobian to gradient-based solvers by setting this 'on'
)
, silent_optimizer % run minimization of moments distance silently without displaying results or saving files in between
% Numerical algorithms options
% , aim_solver % Use AIM algorithm to compute perturbation approximation
% , k_order_solver % use k_order_solver in higher order perturbation approximations
% , dr=default % method used to compute the decision rule; possible values are DEFAULT, CYCLE_REDUCTION, LOGARITHMIC_REDUCTION
% , dr_cycle_reduction_tol = 1e-7 % convergence criterion used in the cycle reduction algorithm
% , dr_logarithmic_reduction_tol = 1e-12 % convergence criterion used in the logarithmic reduction algorithm
% , dr_logarithmic_reduction_maxiter = 100 % maximum number of iterations used in the logarithmic reduction algorithm
% , dr_logarithmic_reduction_tol = 1e-12 % convergence criterion used in the cycle reduction algorithm
% , k_order_solver % use k_order_solver in higher order perturbation approximations
% , lyapunov = DEFAULT % algorithm used to solve lyapunov equations; possible values are DEFAULT, FIXED_POINT, DOUBLING, SQUARE_ROOT_SOLVER
% , lyapunov_complex_threshold = 1e-15 % complex block threshold for the upper triangular matrix in symmetric Lyapunov equation solver
% , lyapunov_fixed_point_tol = 1e-10 % convergence criterion used in the fixed point Lyapunov solver
% , lyapunov_doubling_tol = 1e-16 % convergence criterion used in the doubling algorithm
% , sylvester = default % algorithm to solve Sylvester equation; possible values are DEFAULT, FIXED_POINT
% , sylvester_fixed_point_tol = 1e-12 % convergence criterion used in the fixed point Sylvester solver
% , qz_criterium = 0.999999 % value used to split stable from unstable eigenvalues in reordering the Generalized Schur decomposition used for solving first order problems [IS THIS CORRET @wmutschl]
% , qz_criterium = 0.999999 % value used to split stable from unstable eigenvalues in reordering the Generalized Schur decomposition used for solving first order problems
% , qz_zero_threshold = 1e-6 % value used to test if a generalized eigenvalue is 0/0 in the generalized Schur decomposition
@#if mommethod == "GMM"
, analytic_standard_errors
@#endif
% , schur_vec_tol=1e-11 % tolerance level used to find nonstationary variables in Schur decomposition of the transition matrix
% , mode_check % plot the target function for values around the computed minimum for each estimated parameter in turn
% , mode_check_neighbourhood_size = 5 % width of the window (expressed in percentage deviation) around the computed minimum to be displayed on the diagnostic plots
% , mode_check_symmetric_plots=1 % ensure that the check plots are symmetric around the minimum
% , mode_check_number_of_points = 20 % number of points around the minimum where the target function is evaluated (for each parameter)
);
@#endfor

View File

@ -151,77 +151,80 @@ if ~isequal(M_.matched_moments,matched_moments_)
end
method_of_moments(
% Necessery options
mom_method = GMM % method of moments method; possible values: GMM|SMM
, datafile = 'RBC_Andreasen_Data_2.mat' % name of filename with data
method_of_moments(
% Necessery options
mom_method = GMM % method of moments method; possible values: GMM|SMM
, datafile = 'RBC_Andreasen_Data_2.mat' % name of filename with data
% Options for both GMM and SMM
%, bartlett_kernel_lag = 20 % bandwith in optimal weighting matrix
, order = @{orderApp} % order of Taylor approximation in perturbation
%, penalized_estimator % use penalized optimization
%, 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
%, weighting_matrix_scaling_factor=1
, additional_optimizer_steps = [13] % vector of additional mode-finders run after mode_compute
%, prefilter=0 % demean each data series by its empirical mean and use centered moments
%
% Options for SMM
%, bounded_shock_support % trim shocks in simulation to +- 2 stdev
%, drop = 500 % number of periods dropped at beginning of simulation
%, seed = 24051986 % seed used in simulations
%, simulation_multiple = 5 % multiple of the data length used for simulation
%, burnin = 200
%
% General options
%, dirname = 'MM' % directory in which to store estimation output
%, graph_format = EPS % specify the file format(s) for graphs saved to disk
%, nodisplay % do not display the graphs, but still save them to disk
%, nograph % do not create graphs (which implies that they are not saved to the disk nor displayed)
%, noprint % do not print stuff to console
%, plot_priors = 1 % control plotting of priors
%, prior_trunc = 1e-10 % probability of extreme values of the prior density that is ignored when computing bounds for the parameters
, TeX % print TeX tables and graphics
%
% Data and model options
%, first_obs = 501 % number of first observation
%, logdata % if loglinear is set, this option is necessary if the user provides data already in logs, otherwise the log transformation will be applied twice (this may result in complex data)
%, loglinear % computes a log-linear approximation of the model instead of a linear approximation
%, nobs = 50 % number of observations
% , xls_sheet = willi % name of sheet with data in Excel
% Options for both GMM and SMM
% , bartlett_kernel_lag = 20 % bandwith in optimal weighting matrix
, order = @{orderApp} % 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
% Options for SMM
% , burnin=500 % number of periods dropped at beginning of simulation
% , bounded_shock_support % trim shocks in simulation to +- 2 stdev
% , seed = 24051986 % seed used in simulations
% , simulation_multiple = 5 % multiple of the data length used for simulation
% Options for GMM
% , analytic_standard_errors % compute standard errors using analytical derivatives
% General options
% , dirname = 'MM' % directory in which to store estimation output
% , graph_format = EPS % specify the file format(s) for graphs saved to disk
% , nodisplay % do not display the graphs, but still save them to disk
% , nograph % do not create graphs (which implies that they are not saved to the disk nor displayed)
% , noprint % do not print stuff to console
% , plot_priors = 1 % control plotting of priors
% , prior_trunc = 1e-10 % probability of extreme values of the prior density that is ignored when computing bounds for the parameters
, TeX % print TeX tables and graphics
% Data and model options
% , first_obs = 501 % number of first observation
% , logdata % if data is already in logs
% , nobs = 250 % number of observations
% , prefilter=0 % demean each data series by its empirical mean and use centered moments
% , xls_sheet = data % name/number of sheet with data in Excel
% , xls_range = B2:D200 % range of data in Excel sheet
%
% Optimization options that can be set by the user in the mod file, otherwise default values are provided
%, analytic_derivation % uses analytic derivatives to compute standard errors for GMM
%, huge_number=1D10 % value for replacing the infinite bounds on parameters by finite numbers. Used by some optimizers for numerical reasons
, mode_compute = 13 % specifies the optimizer for minimization of moments distance, note that by default there is a new optimizer
, optim = ('TolFun', 1D-6
,'TolX', 1D-6
) % a list of NAME and VALUE pairs to set options for the optimization routines. Available options depend on mode_compute
%, silent_optimizer % run minimization of moments distance silently without displaying results or saving files in between
, se_tolx = 1e-6 % convergence criterion on funciton input for numerical differentiation
%
% % Numerical algorithms options
%, aim_solver % Use AIM algorithm to compute perturbation approximation
%, dr=DEFAULT % method used to compute the decision rule; possible values are DEFAULT, CYCLE_REDUCTION, LOGARITHMIC_REDUCTION
%, dr_cycle_reduction_tol = 1e-7 % convergence criterion used in the cycle reduction algorithm
%, dr_logarithmic_reduction_maxiter = 100 % maximum number of iterations used in the logarithmic reduction algorithm
%, dr_logarithmic_reduction_tol = 1e-12 % convergence criterion used in the cycle reduction algorithm
%, k_order_solver % use k_order_solver in higher order perturbation approximations
%, lyapunov = DEFAULT % algorithm used to solve lyapunov equations; possible values are DEFAULT, FIXED_POINT, DOUBLING, SQUARE_ROOT_SOLVER
%, lyapunov_complex_threshold = 1e-15 % complex block threshold for the upper triangular matrix in symmetric Lyapunov equation solver
%, lyapunov_fixed_point_tol = 1e-10 % convergence criterion used in the fixed point Lyapunov solver
%, lyapunov_doubling_tol = 1e-16 % convergence criterion used in the doubling algorithm
%, sylvester = default % algorithm to solve Sylvester equation; possible values are DEFAULT, FIXED_POINT
%, sylvester_fixed_point_tol = 1e-12 % convergence criterion used in the fixed point Sylvester solver
%, qz_criterium = 0.999999 % value used to split stable from unstable eigenvalues in reordering the Generalized Schur decomposition used for solving first order problems [IS THIS CORRET @wmutschl]
%, qz_zero_threshold = 1e-6 % value used to test if a generalized eigenvalue is 0/0 in the generalized Schur decomposition
, mode_check
%, mode_check_neighbourhood_size=0.5
%, mode_check_symmetric_plots=0
%, mode_check_number_of_points=25
);
% Optimization options that can be set by the user in the mod file, otherwise default values are provided
% , huge_number=1e7 % value for replacing the infinite bounds on parameters by finite numbers. Used by some optimizers for numerical reasons
, 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: a list of NAME and VALUE pairs to set options for the optimization routines. Available options depend on mode_compute, some exemplary common options:
, optim = ('TolFun' , 1D-6 % termination tolerance on the function value, a positive scalar
,'TolX' , 1e-6 % termination tolerance on x, a positive scalar
% ,'MaxIter' , 3000 % maximum number of iterations allowed, a positive integer
% ,'MaxFunEvals' , 1D6 % maximum number of function evaluations allowed, a positive integer
% ,'UseParallel' , 1 % when true (and supported by optimizer) solver estimates gradients in parallel (using Matlab/Octave's parallel toolbox)
% ,'Jacobian' , 'off' % when 'off' gradient-based solvers approximate Jacobian using finite differences; for GMM we can also pass the analytical Jacobian to gradient-based solvers by setting this 'on'
)
% , silent_optimizer % run minimization of moments distance silently without displaying results or saving files in between
% Numerical algorithms options
% , aim_solver % Use AIM algorithm to compute perturbation approximation
% , k_order_solver % use k_order_solver in higher order perturbation approximations
% , dr=default % method used to compute the decision rule; possible values are DEFAULT, CYCLE_REDUCTION, LOGARITHMIC_REDUCTION
% , dr_cycle_reduction_tol = 1e-7 % convergence criterion used in the cycle reduction algorithm
% , dr_logarithmic_reduction_tol = 1e-12 % convergence criterion used in the logarithmic reduction algorithm
% , dr_logarithmic_reduction_maxiter = 100 % maximum number of iterations used in the logarithmic reduction algorithm
% , lyapunov = DEFAULT % algorithm used to solve lyapunov equations; possible values are DEFAULT, FIXED_POINT, DOUBLING, SQUARE_ROOT_SOLVER
% , lyapunov_complex_threshold = 1e-15 % complex block threshold for the upper triangular matrix in symmetric Lyapunov equation solver
% , lyapunov_fixed_point_tol = 1e-10 % convergence criterion used in the fixed point Lyapunov solver
% , lyapunov_doubling_tol = 1e-16 % convergence criterion used in the doubling algorithm
% , sylvester = default % algorithm to solve Sylvester equation; possible values are DEFAULT, FIXED_POINT
% , sylvester_fixed_point_tol = 1e-12 % convergence criterion used in the fixed point Sylvester solver
% , qz_criterium = 0.999999 % value used to split stable from unstable eigenvalues in reordering the Generalized Schur decomposition used for solving first order problems
% , qz_zero_threshold = 1e-6 % value used to test if a generalized eigenvalue is 0/0 in the generalized Schur decomposition
% , schur_vec_tol=1e-11 % tolerance level used to find nonstationary variables in Schur decomposition of the transition matrix
, mode_check % plot the target function for values around the computed minimum for each estimated parameter in turn
% , mode_check_neighbourhood_size = 5 % width of the window (expressed in percentage deviation) around the computed minimum to be displayed on the diagnostic plots
% , mode_check_symmetric_plots=1 % ensure that the check plots are symmetric around the minimum
% , mode_check_number_of_points = 20 % number of points around the minimum where the target function is evaluated (for each parameter)
);

View File

@ -139,30 +139,31 @@ end
@#for mommethod in ["SMM"]
method_of_moments(
% Necessery options
mom_method = @{mommethod} % method of moments method; possible values: GMM|SMM
, datafile = 'RBC_MoM_data_@{orderApp}.mat' % name of filename with data
% Necessery options
mom_method = @{mommethod} % method of moments method; possible values: GMM|SMM
, datafile = 'RBC_MoM_data_@{orderApp}.mat' % name of filename with data
% Options for both GMM and SMM
% Options for both GMM and SMM
% , bartlett_kernel_lag = 20 % bandwith in optimal weighting matrix
, order = @{orderApp} % order of Taylor approximation in perturbation
% , penalized_estimator % use penalized optimization
% , 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 = ['identity_matrix'] % weighting matrix in moments distance objective function; possible values: OPTIMAL|IDENTITY_MATRIX|DIAGONAL|filename
, weighting_matrix_scaling_factor = 10
, burnin=250
%, additional_optimizer_steps = [4] % vector of additional mode-finders run after mode_compute
% , prefilter=0 % demean each data series by its empirical mean and use centered moments
%
% Options for SMM
, weighting_matrix = ['identity_matrix'] % 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=10 % scaling of weighting matrix in objective function
% , se_tolx=1e-6 % step size for numerical computation of standard errors
% Options for SMM
, burnin=250 % number of periods dropped at beginning of simulation
% , bounded_shock_support % trim shocks in simulation to +- 2 stdev
% , drop = 500 % number of periods dropped at beginning of simulation
% , seed = 24051986 % seed used in simulations
% , simulation_multiple = 5 % multiple of the data length used for simulation
%
% General options
%, dirname = 'MM' % directory in which to store estimation output
% Options for GMM
% , analytic_standard_errors % compute standard errors using analytical derivatives
% General options
% , dirname = 'MM' % directory in which to store estimation output
% , graph_format = EPS % specify the file format(s) for graphs saved to disk
% , nodisplay % do not display the graphs, but still save them to disk
% , nograph % do not create graphs (which implies that they are not saved to the disk nor displayed)
@ -170,41 +171,49 @@ end
% , plot_priors = 1 % control plotting of priors
% , prior_trunc = 1e-10 % probability of extreme values of the prior density that is ignored when computing bounds for the parameters
% , TeX % print TeX tables and graphics
%
% Data and model options
%, first_obs = 501 % number of first observation
% , logdata % if loglinear is set, this option is necessary if the user provides data already in logs, otherwise the log transformation will be applied twice (this may result in complex data)
% , loglinear % computes a log-linear approximation of the model instead of a linear approximation
%, nobs = 500 % number of observations
% , xls_sheet = willi % name of sheet with data in Excel
% Data and model options
% , first_obs = 501 % number of first observation
% , logdata % if data is already in logs
% , nobs = 250 % number of observations
% , prefilter=0 % demean each data series by its empirical mean and use centered moments
% , xls_sheet = data % name/number of sheet with data in Excel
% , xls_range = B2:D200 % range of data in Excel sheet
%
% Optimization options that can be set by the user in the mod file, otherwise default values are provided
% , analytic_derivation % uses analytic derivatives to compute standard errors for GMM
%, huge_number=1D10 % value for replacing the infinite bounds on parameters by finite numbers. Used by some optimizers for numerical reasons
, mode_compute = @{optimizer} % specifies the optimizer for minimization of moments distance, note that by default there is a new optimizer
%, optim = ('TolFun', 1e-3
% ,'TolX', 1e-5
% ) % a list of NAME and VALUE pairs to set options for the optimization routines. Available options depend on mode_compute
%, silent_optimizer % run minimization of moments distance silently without displaying results or saving files in between
% , tolf = 1e-5 % convergence criterion on function value for numerical differentiation
% , tolx = 1e-6 % convergence criterion on funciton input for numerical differentiation
%
% % Numerical algorithms options
% Optimization options that can be set by the user in the mod file, otherwise default values are provided
% , huge_number=1e7 % value for replacing the infinite bounds on parameters by finite numbers. Used by some optimizers for numerical reasons
, mode_compute = @{optimizer} % specifies the optimizer for minimization of moments distance
%, additional_optimizer_steps = [1 2 3 4] % vector of additional mode-finders run after mode_compute
% optim: a list of NAME and VALUE pairs to set options for the optimization routines. Available options depend on mode_compute, some exemplary common options:
% , optim = ('TolFun' , 1e-6 % termination tolerance on the function value, a positive scalar
% ,'TolX' , 1e-6 % termination tolerance on x, a positive scalar
% ,'MaxIter' , 3000 % maximum number of iterations allowed, a positive integer
% ,'MaxFunEvals' , 1D6 % maximum number of function evaluations allowed, a positive integer
% ,'UseParallel' , 1 % when true (and supported by optimizer) solver estimates gradients in parallel (using Matlab/Octave's parallel toolbox)
% ,'Jacobian' , 'off' % when 'off' gradient-based solvers approximate Jacobian using finite differences; for GMM we can also pass the analytical Jacobian to gradient-based solvers by setting this 'on'
% )
% , silent_optimizer % run minimization of moments distance silently without displaying results or saving files in between
% Numerical algorithms options
% , aim_solver % Use AIM algorithm to compute perturbation approximation
% , k_order_solver % use k_order_solver in higher order perturbation approximations
% , dr=default % method used to compute the decision rule; possible values are DEFAULT, CYCLE_REDUCTION, LOGARITHMIC_REDUCTION
% , dr_cycle_reduction_tol = 1e-7 % convergence criterion used in the cycle reduction algorithm
% , dr_logarithmic_reduction_tol = 1e-12 % convergence criterion used in the logarithmic reduction algorithm
% , dr_logarithmic_reduction_maxiter = 100 % maximum number of iterations used in the logarithmic reduction algorithm
% , dr_logarithmic_reduction_tol = 1e-12 % convergence criterion used in the cycle reduction algorithm
% , k_order_solver % use k_order_solver in higher order perturbation approximations
% , lyapunov = DEFAULT % algorithm used to solve lyapunov equations; possible values are DEFAULT, FIXED_POINT, DOUBLING, SQUARE_ROOT_SOLVER
% , lyapunov_complex_threshold = 1e-15 % complex block threshold for the upper triangular matrix in symmetric Lyapunov equation solver
% , lyapunov_fixed_point_tol = 1e-10 % convergence criterion used in the fixed point Lyapunov solver
% , lyapunov_doubling_tol = 1e-16 % convergence criterion used in the doubling algorithm
% , sylvester = default % algorithm to solve Sylvester equation; possible values are DEFAULT, FIXED_POINT
% , sylvester_fixed_point_tol = 1e-12 % convergence criterion used in the fixed point Sylvester solver
% , qz_criterium = 0.999999 % value used to split stable from unstable eigenvalues in reordering the Generalized Schur decomposition used for solving first order problems [IS THIS CORRET @wmutschl]
% , qz_criterium = 0.999999 % value used to split stable from unstable eigenvalues in reordering the Generalized Schur decomposition used for solving first order problems
% , qz_zero_threshold = 1e-6 % value used to test if a generalized eigenvalue is 0/0 in the generalized Schur decomposition
% , schur_vec_tol=1e-11 % tolerance level used to find nonstationary variables in Schur decomposition of the transition matrix
% , mode_check % plot the target function for values around the computed minimum for each estimated parameter in turn
% , mode_check_neighbourhood_size = 5 % width of the window (expressed in percentage deviation) around the computed minimum to be displayed on the diagnostic plots
% , mode_check_symmetric_plots=1 % ensure that the check plots are symmetric around the minimum
% , mode_check_number_of_points = 20 % number of points around the minimum where the target function is evaluated (for each parameter)
);
@#endfor

View File

@ -110,31 +110,31 @@ save('test_matrix.mat','weighting_matrix')
@#for mommethod in ["GMM", "SMM"]
method_of_moments(
% Necessery options
mom_method = @{mommethod} % method of moments method; possible values: GMM|SMM
, datafile = 'RBC_MoM_data_@{orderApp}.mat' % name of filename with data
% Necessery options
mom_method = @{mommethod} % method of moments method; possible values: GMM|SMM
, datafile = 'RBC_MoM_data_@{orderApp}.mat' % name of filename with data
% Options for both GMM and SMM
% Options for both GMM and SMM
% , bartlett_kernel_lag = 20 % bandwith in optimal weighting matrix
, order = @{orderApp} % order of Taylor approximation in perturbation
% , penalized_estimator % use penalized optimization
% , 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 = 'test_matrix.mat' % weighting matrix in moments distance objective function; possible values: OPTIMAL|IDENTITY_MATRIX|DIAGONAL|filename
, weighting_matrix =['test_matrix.mat','optimal']
%, weighting_matrix = optimal % weighting matrix in moments distance objective function; possible values: OPTIMAL|IDENTITY_MATRIX|DIAGONAL|filename
%, additional_optimizer_steps = [4] % vector of additional mode-finders run after mode_compute
, prefilter=1 % demean each data series by its empirical mean and use centered moments
, se_tolx=1e-5
%
% Options for SMM
, weighting_matrix = ['test_matrix.mat','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-5 % step size for numerical computation of standard errors
% Options for SMM
, burnin=500 % number of periods dropped at beginning of simulation
% , bounded_shock_support % trim shocks in simulation to +- 2 stdev
, burnin = 500 % number of periods dropped at beginning of simulation
% , seed = 24051986 % seed used in simulations
% , simulation_multiple = 5 % multiple of the data length used for simulation
%
% General options
%, dirname = 'MM' % directory in which to store estimation output
% Options for GMM
% , analytic_standard_errors % compute standard errors using analytical derivatives
% General options
% , dirname = 'MM' % directory in which to store estimation output
% , graph_format = EPS % specify the file format(s) for graphs saved to disk
% , nodisplay % do not display the graphs, but still save them to disk
% , nograph % do not create graphs (which implies that they are not saved to the disk nor displayed)
@ -142,38 +142,49 @@ save('test_matrix.mat','weighting_matrix')
% , plot_priors = 1 % control plotting of priors
% , prior_trunc = 1e-10 % probability of extreme values of the prior density that is ignored when computing bounds for the parameters
% , TeX % print TeX tables and graphics
%
% Data and model options
%, first_obs = 501 % number of first observation
% , logdata % if loglinear is set, this option is necessary if the user provides data already in logs, otherwise the log transformation will be applied twice (this may result in complex data)
% , loglinear % computes a log-linear approximation of the model instead of a linear approximation
%, nobs = 500 % number of observations
% , xls_sheet = willi % name of sheet with data in Excel
% Data and model options
% , first_obs = 501 % number of first observation
% , logdata % if data is already in logs
, nobs = 250 % number of observations
, prefilter=1 % demean each data series by its empirical mean and use centered moments
% , xls_sheet = data % name/number of sheet with data in Excel
% , xls_range = B2:D200 % range of data in Excel sheet
%
% Optimization options that can be set by the user in the mod file, otherwise default values are provided
% , analytic_derivation % uses analytic derivatives to compute standard errors for GMM
%, huge_number=1D10 % value for replacing the infinite bounds on parameters by finite numbers. Used by some optimizers for numerical reasons
, mode_compute = @{optimizer} % specifies the optimizer for minimization of moments distance, note that by default there is a new optimizer
%, optim = ('TolFun', 1e-3
% ,'TolX', 1e-5
% ) % a list of NAME and VALUE pairs to set options for the optimization routines. Available options depend on mode_compute
%, silent_optimizer % run minimization of moments distance silently without displaying results or saving files in between
%
% % Numerical algorithms options
% Optimization options that can be set by the user in the mod file, otherwise default values are provided
% , huge_number=1e7 % value for replacing the infinite bounds on parameters by finite numbers. Used by some optimizers for numerical reasons
, mode_compute = @{optimizer} % specifies the optimizer for minimization of moments distance
%, additional_optimizer_steps = [7] % vector of additional mode-finders run after mode_compute
% optim: a list of NAME and VALUE pairs to set options for the optimization routines. Available options depend on mode_compute, some exemplary common options:
% , optim = ('TolFun' , 1e-6 % termination tolerance on the function value, a positive scalar
% ,'TolX' , 1e-6 % termination tolerance on x, a positive scalar
% ,'MaxIter' , 3000 % maximum number of iterations allowed, a positive integer
% ,'MaxFunEvals' , 1D6 % maximum number of function evaluations allowed, a positive integer
% ,'UseParallel' , 1 % when true (and supported by optimizer) solver estimates gradients in parallel (using Matlab/Octave's parallel toolbox)
% ,'Jacobian' , 'off' % when 'off' gradient-based solvers approximate Jacobian using finite differences; for GMM we can also pass the analytical Jacobian to gradient-based solvers by setting this 'on'
% )
% , silent_optimizer % run minimization of moments distance silently without displaying results or saving files in between
% Numerical algorithms options
% , aim_solver % Use AIM algorithm to compute perturbation approximation
% , k_order_solver % use k_order_solver in higher order perturbation approximations
% , dr=default % method used to compute the decision rule; possible values are DEFAULT, CYCLE_REDUCTION, LOGARITHMIC_REDUCTION
% , dr_cycle_reduction_tol = 1e-7 % convergence criterion used in the cycle reduction algorithm
% , dr_logarithmic_reduction_tol = 1e-12 % convergence criterion used in the logarithmic reduction algorithm
% , dr_logarithmic_reduction_maxiter = 100 % maximum number of iterations used in the logarithmic reduction algorithm
% , dr_logarithmic_reduction_tol = 1e-12 % convergence criterion used in the cycle reduction algorithm
% , k_order_solver % use k_order_solver in higher order perturbation approximations
% , lyapunov = DEFAULT % algorithm used to solve lyapunov equations; possible values are DEFAULT, FIXED_POINT, DOUBLING, SQUARE_ROOT_SOLVER
% , lyapunov_complex_threshold = 1e-15 % complex block threshold for the upper triangular matrix in symmetric Lyapunov equation solver
% , lyapunov_fixed_point_tol = 1e-10 % convergence criterion used in the fixed point Lyapunov solver
% , lyapunov_doubling_tol = 1e-16 % convergence criterion used in the doubling algorithm
% , sylvester = default % algorithm to solve Sylvester equation; possible values are DEFAULT, FIXED_POINT
% , sylvester_fixed_point_tol = 1e-12 % convergence criterion used in the fixed point Sylvester solver
% , qz_criterium = 0.999999 % value used to split stable from unstable eigenvalues in reordering the Generalized Schur decomposition used for solving first order problems [IS THIS CORRET @wmutschl]
% , qz_criterium = 0.999999 % value used to split stable from unstable eigenvalues in reordering the Generalized Schur decomposition used for solving first order problems
% , qz_zero_threshold = 1e-6 % value used to test if a generalized eigenvalue is 0/0 in the generalized Schur decomposition
% , schur_vec_tol=1e-11 % tolerance level used to find nonstationary variables in Schur decomposition of the transition matrix
% , mode_check % plot the target function for values around the computed minimum for each estimated parameter in turn
% , mode_check_neighbourhood_size = 5 % width of the window (expressed in percentage deviation) around the computed minimum to be displayed on the diagnostic plots
% , mode_check_symmetric_plots=1 % ensure that the check plots are symmetric around the minimum
% , mode_check_number_of_points = 20 % number of points around the minimum where the target function is evaluated (for each parameter)
);
@#endfor