-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathXRunML_ireland_2004.m
32 lines (26 loc) · 1.63 KB
/
XRunML_ireland_2004.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
%% Maximum Likelihood Estimation of Basic New Keynesian Model
clear variables; clear global; close all; clc;
addpath('MLRoutines'); % this folder contains our core routines
addpath('OptimRoutines/CMAES','OptimRoutines/CSMINWEL'); % this folder has two useful optimizers: csminwel and cmaes
%% ------------------------------------------------------------------------
% USER CHOICES
% -------------------------------------------------------------------------
% Options
OPT.modelname = 'ireland_2004';
OPT.datafile = 'ireland_2004_data.mat';
OPT.first_obs = 1;
OPT.nobs = 220;
OPT.optimizer.randomize_initval = 0; % 1: randomize initial values
OPT.optimizer.bounds.penalize_objective = 1; % 1: checks whether bounds are violated in objective function and penalize it
OPT.optimizer.bounds.use_for_optimizer = 1; % 1: if optimizer supports bounds, use these
% Optimizer to try to find posterior mode, possible values are "fminsearch", "fminunc", "simulannealbnd", "patternsearch", "csminwel", "cmaes"
% you can also loop over the optimizers, e.g. ["fminsearch", "fminunc", "simulannealbnd", "patternsearch", "csminwel", "cmaes"]
OPT.optimizer.name = ["fminsearch","csminwel","cmaes"]
OPT.optimizer.optim_options = optimset('display','iter','MaxFunEvals',50000,'MaxIter',10000,'TolFun',1e-9,'TolX',1e-4);
% ------------------------------------------------------------------------
% END USER CHOICES: the rest is specified and derived from the
% *_preprocessing, *_steady_state and *_params files
% -------------------------------------------------------------------------
RunML;
rmpath('MLRoutines');
rmpath('OptimRoutines/CMAES','OptimRoutines/CSMINWEL');