%
% Status : main Dynare file
%
% Warning : this file is generated automatically by Dynare
%           from model file (.mod)

if isoctave || matlab_ver_less_than('8.6')
    clear all
else
    clearvars -global
    clear_persistent_variables(fileparts(which('dynare')), false)
end
tic0 = tic;
% Define global variables.
global M_ options_ oo_ estim_params_ bayestopt_ dataset_ dataset_info estimation_info ys0_ ex0_
options_ = [];
M_.fname = 'Economides_Xepapadeas_Replication';
M_.dynare_version = '5.1';
oo_.dynare_version = '5.1';
options_.dynare_version = '5.1';
%
% Some global variables initialization
%
global_initialization;
M_.parameter_used_with_lead_lag = true;
M_.exo_names = cell(1,1);
M_.exo_names_tex = cell(1,1);
M_.exo_names_long = cell(1,1);
M_.exo_names(1) = {'A'};
M_.exo_names_tex(1) = {'A'};
M_.exo_names_long(1) = {'A'};
M_.endo_names = cell(17,1);
M_.endo_names_tex = cell(17,1);
M_.endo_names_long = cell(17,1);
M_.endo_names(1) = {'y'};
M_.endo_names_tex(1) = {'y'};
M_.endo_names_long(1) = {'y'};
M_.endo_names(2) = {'c'};
M_.endo_names_tex(2) = {'c'};
M_.endo_names_long(2) = {'c'};
M_.endo_names(3) = {'h'};
M_.endo_names_tex(3) = {'h'};
M_.endo_names_long(3) = {'h'};
M_.endo_names(4) = {'k'};
M_.endo_names_tex(4) = {'k'};
M_.endo_names_long(4) = {'k'};
M_.endo_names(5) = {'E'};
M_.endo_names_tex(5) = {'E'};
M_.endo_names_long(5) = {'E'};
M_.endo_names(6) = {'b'};
M_.endo_names_tex(6) = {'b'};
M_.endo_names_long(6) = {'b'};
M_.endo_names(7) = {'m'};
M_.endo_names_tex(7) = {'m'};
M_.endo_names_long(7) = {'m'};
M_.endo_names(8) = {'r'};
M_.endo_names_tex(8) = {'r'};
M_.endo_names_long(8) = {'r'};
M_.endo_names(9) = {'w'};
M_.endo_names_tex(9) = {'w'};
M_.endo_names_long(9) = {'w'};
M_.endo_names(10) = {'p_e'};
M_.endo_names_tex(10) = {'p\_e'};
M_.endo_names_long(10) = {'p_e'};
M_.endo_names(11) = {'d'};
M_.endo_names_tex(11) = {'d'};
M_.endo_names_long(11) = {'d'};
M_.endo_names(12) = {'pi'};
M_.endo_names_tex(12) = {'pi'};
M_.endo_names_long(12) = {'pi'};
M_.endo_names(13) = {'g'};
M_.endo_names_tex(13) = {'g'};
M_.endo_names_long(13) = {'g'};
M_.endo_names(14) = {'g_tr'};
M_.endo_names_tex(14) = {'g\_tr'};
M_.endo_names_long(14) = {'g_tr'};
M_.endo_names(15) = {'s_tr'};
M_.endo_names_tex(15) = {'s\_tr'};
M_.endo_names_long(15) = {'s_tr'};
M_.endo_names(16) = {'R'};
M_.endo_names_tex(16) = {'R'};
M_.endo_names_long(16) = {'R'};
M_.endo_names(17) = {'AUX_EXO_LAG_16_0'};
M_.endo_names_tex(17) = {'AUX\_EXO\_LAG\_16\_0'};
M_.endo_names_long(17) = {'AUX_EXO_LAG_16_0'};
M_.endo_partitions = struct();
M_.param_names = cell(30,1);
M_.param_names_tex = cell(30,1);
M_.param_names_long = cell(30,1);
M_.param_names(1) = {'beta'};
M_.param_names_tex(1) = {'beta'};
M_.param_names_long(1) = {'beta'};
M_.param_names(2) = {'mu1'};
M_.param_names_tex(2) = {'mu1'};
M_.param_names_long(2) = {'mu1'};
M_.param_names(3) = {'mu2'};
M_.param_names_tex(3) = {'mu2'};
M_.param_names_long(3) = {'mu2'};
M_.param_names(4) = {'mu3'};
M_.param_names_tex(4) = {'mu3'};
M_.param_names_long(4) = {'mu3'};
M_.param_names(5) = {'alpha1'};
M_.param_names_tex(5) = {'alpha1'};
M_.param_names_long(5) = {'alpha1'};
M_.param_names(6) = {'alpha2'};
M_.param_names_tex(6) = {'alpha2'};
M_.param_names_long(6) = {'alpha2'};
M_.param_names(7) = {'delta'};
M_.param_names_tex(7) = {'delta'};
M_.param_names_long(7) = {'delta'};
M_.param_names(8) = {'x'};
M_.param_names_tex(8) = {'x'};
M_.param_names_long(8) = {'x'};
M_.param_names(9) = {'theta'};
M_.param_names_tex(9) = {'theta'};
M_.param_names_long(9) = {'theta'};
M_.param_names(10) = {'tau_c'};
M_.param_names_tex(10) = {'tau\_c'};
M_.param_names_long(10) = {'tau_c'};
M_.param_names(11) = {'tau_y'};
M_.param_names_tex(11) = {'tau\_y'};
M_.param_names_long(11) = {'tau_y'};
M_.param_names(12) = {'tau_e'};
M_.param_names_tex(12) = {'tau\_e'};
M_.param_names_long(12) = {'tau_e'};
M_.param_names(13) = {'phi_pi'};
M_.param_names_tex(13) = {'phi\_pi'};
M_.param_names_long(13) = {'phi_pi'};
M_.param_names(14) = {'phi_y'};
M_.param_names_tex(14) = {'phi\_y'};
M_.param_names_long(14) = {'phi_y'};
M_.param_names(15) = {'phi_tr'};
M_.param_names_tex(15) = {'phi\_tr'};
M_.param_names_long(15) = {'phi_tr'};
M_.param_names(16) = {'CapDelta'};
M_.param_names_tex(16) = {'CapDelta'};
M_.param_names_long(16) = {'CapDelta'};
M_.param_names(17) = {'psi'};
M_.param_names_tex(17) = {'psi'};
M_.param_names_long(17) = {'psi'};
M_.param_names(18) = {'cost_e'};
M_.param_names_tex(18) = {'cost\_e'};
M_.param_names_long(18) = {'cost_e'};
M_.param_names(19) = {'pi_tild'};
M_.param_names_tex(19) = {'pi\_tild'};
M_.param_names_long(19) = {'pi_tild'};
M_.param_names(20) = {'y_tild'};
M_.param_names_tex(20) = {'y\_tild'};
M_.param_names_long(20) = {'y_tild'};
M_.param_names(21) = {'phi_A'};
M_.param_names_tex(21) = {'phi\_A'};
M_.param_names_long(21) = {'phi_A'};
M_.param_names(22) = {'R_tild'};
M_.param_names_tex(22) = {'R\_tild'};
M_.param_names_long(22) = {'R_tild'};
M_.param_names(23) = {'b_tild'};
M_.param_names_tex(23) = {'b\_tild'};
M_.param_names_long(23) = {'b_tild'};
M_.param_names(24) = {'s_tr_ss'};
M_.param_names_tex(24) = {'s\_tr\_ss'};
M_.param_names_long(24) = {'s_tr_ss'};
M_.param_names(25) = {'s_g'};
M_.param_names_tex(25) = {'s\_g'};
M_.param_names_long(25) = {'s_g'};
M_.param_names(26) = {'g_over_y'};
M_.param_names_tex(26) = {'g\_over\_y'};
M_.param_names_long(26) = {'g_over_y'};
M_.param_names(27) = {'g_tr_over_y'};
M_.param_names_tex(27) = {'g\_tr\_over\_y'};
M_.param_names_long(27) = {'g_tr_over_y'};
M_.param_names(28) = {'b_over_y'};
M_.param_names_tex(28) = {'b\_over\_y'};
M_.param_names_long(28) = {'b_over_y'};
M_.param_names(29) = {'b_tild_over_y_tild'};
M_.param_names_tex(29) = {'b\_tild\_over\_y\_tild'};
M_.param_names_long(29) = {'b_tild_over_y_tild'};
M_.param_names(30) = {'A_ss'};
M_.param_names_tex(30) = {'A\_ss'};
M_.param_names_long(30) = {'A_ss'};
M_.param_partitions = struct();
M_.exo_det_nbr = 0;
M_.exo_nbr = 1;
M_.endo_nbr = 17;
M_.param_nbr = 30;
M_.orig_endo_nbr = 16;
M_.aux_vars(1).endo_index = 17;
M_.aux_vars(1).type = 3;
M_.aux_vars(1).orig_index = 1;
M_.aux_vars(1).orig_lead_lag = 0;
M_.aux_vars(1).orig_expr = 'A';
M_ = setup_solvers(M_);
M_.Sigma_e = zeros(1, 1);
M_.Correlation_matrix = eye(1, 1);
M_.H = 0;
M_.Correlation_matrix_ME = 1;
M_.sigma_e_is_diagonal = true;
M_.det_shocks = [];
M_.surprise_shocks = [];
M_.heteroskedastic_shocks.Qvalue_orig = [];
M_.heteroskedastic_shocks.Qscale_orig = [];
options_.linear = false;
options_.block = false;
options_.bytecode = false;
options_.use_dll = false;
M_.nonzero_hessian_eqs = [1 2 3 4 5 6 7 8 9 10 11 14 15 16];
M_.hessian_eq_zero = isempty(M_.nonzero_hessian_eqs);
M_.orig_eq_nbr = 16;
M_.eq_nbr = 17;
M_.ramsey_eq_nbr = 0;
M_.set_auxiliary_variables = exist(['./+' M_.fname '/set_auxiliary_variables.m'], 'file') == 2;
M_.epilogue_names = {};
M_.epilogue_var_list_ = {};
M_.orig_maximum_endo_lag = 1;
M_.orig_maximum_endo_lead = 1;
M_.orig_maximum_exo_lag = 1;
M_.orig_maximum_exo_lead = 0;
M_.orig_maximum_exo_det_lag = 0;
M_.orig_maximum_exo_det_lead = 0;
M_.orig_maximum_lag = 1;
M_.orig_maximum_lead = 1;
M_.orig_maximum_lag_with_diffs_expanded = 1;
M_.lead_lag_incidence = [
 1 7 24;
 0 8 25;
 0 9 0;
 2 10 0;
 0 11 0;
 3 12 0;
 4 13 0;
 0 14 26;
 0 15 0;
 0 16 0;
 0 17 0;
 0 18 27;
 0 19 0;
 0 20 0;
 0 21 0;
 5 22 0;
 6 23 0;]';
M_.nstatic = 8;
M_.nfwrd   = 3;
M_.npred   = 5;
M_.nboth   = 1;
M_.nsfwrd   = 4;
M_.nspred   = 6;
M_.ndynamic   = 9;
M_.dynamic_tmp_nbr = [12; 7; 4; 0; ];
M_.model_local_variables_dynamic_tt_idxs = {
};
M_.equations_tags = {
  1 , 'name' , '1' ;
  2 , 'name' , '2' ;
  3 , 'name' , '3' ;
  4 , 'name' , '4' ;
  5 , 'name' , '5' ;
  6 , 'name' , 'y' ;
  7 , 'name' , '7' ;
  8 , 'name' , '8' ;
  9 , 'name' , '9' ;
  10 , 'name' , 'd' ;
  11 , 'name' , '11' ;
  12 , 'name' , 'p_e' ;
  13 , 'name' , 'R' ;
  14 , 'name' , 'g_tr' ;
  15 , 'name' , 's_tr' ;
  16 , 'name' , 'A' ;
};
M_.mapping.y.eqidx = [6 7 8 9 10 13 14 15 ];
M_.mapping.c.eqidx = [1 2 3 4 5 11 ];
M_.mapping.h.eqidx = [4 5 6 8 10 11 ];
M_.mapping.k.eqidx = [5 6 7 10 11 ];
M_.mapping.E.eqidx = [6 9 10 11 ];
M_.mapping.b.eqidx = [5 11 15 ];
M_.mapping.m.eqidx = [3 5 11 ];
M_.mapping.r.eqidx = [1 5 7 10 11 ];
M_.mapping.w.eqidx = [4 5 8 10 11 ];
M_.mapping.p_e.eqidx = [9 10 12 ];
M_.mapping.d.eqidx = [5 10 11 ];
M_.mapping.pi.eqidx = [2 3 5 7 8 9 10 11 13 ];
M_.mapping.g.eqidx = [11 ];
M_.mapping.g_tr.eqidx = [5 11 14 ];
M_.mapping.s_tr.eqidx = [14 15 ];
M_.mapping.R.eqidx = [2 5 11 13 ];
M_.mapping.A.eqidx = [6 16 ];
M_.static_and_dynamic_models_differ = false;
M_.has_external_function = false;
M_.state_var = [1 4 6 7 16 17 ];
M_.exo_names_orig_ord = [1:1];
M_.maximum_lag = 1;
M_.maximum_lead = 1;
M_.maximum_endo_lag = 1;
M_.maximum_endo_lead = 1;
oo_.steady_state = zeros(17, 1);
M_.maximum_exo_lag = 0;
M_.maximum_exo_lead = 0;
oo_.exo_steady_state = zeros(1, 1);
M_.params = NaN(30, 1);
M_.endo_trends = struct('deflator', cell(17, 1), 'log_deflator', cell(17, 1), 'growth_factor', cell(17, 1), 'log_growth_factor', cell(17, 1));
M_.NNZDerivatives = [89; 102; -1; ];
M_.static_tmp_nbr = [9; 3; 0; 0; ];
M_.model_local_variables_static_tt_idxs = {
};
/Endogenous Variables
M_.params(1) = 0.99;
beta = M_.params(1);
M_.params(2) = 0.35;
mu1 = M_.params(2);
M_.params(3) = 0.6;
mu2 = M_.params(3);
M_.params(4) = 0.02;
mu3 = M_.params(4);
(1-mu1-mu2-mu3)=0.03;
M_.params(5) = 0.33;
alpha1 = M_.params(5);
M_.params(6) = 0.6;
alpha2 = M_.params(6);
(1-alpha1-alpha2)=0.07;
M_.params(7) = 0.015;
delta = M_.params(7);
M_.params(8) = 100;
x = M_.params(8);
M_.params(9) = 0.85;
theta = M_.params(9);
M_.params(10) = 0.19;
tau_c = M_.params(10);
M_.params(11) = 0.3;
tau_y = M_.params(11);
M_.params(12) = 0;
tau_e = M_.params(12);
M_.params(26) = 0.2;
g_over_y = M_.params(26);
M_.params(27) = 0.192;
g_tr_over_y = M_.params(27);
M_.params(28) = 0.9;
b_over_y = M_.params(28);
M_.params(13) = 1.5;
phi_pi = M_.params(13);
M_.params(14) = 0.01;
phi_y = M_.params(14);
M_.params(15) = 0.3;
phi_tr = M_.params(15);
M_.params(16) = 1.7;
CapDelta = M_.params(16);
M_.params(17) = 0.5;
psi = M_.params(17);
M_.params(18) = 1.1;
cost_e = M_.params(18);
M_.params(19) = 1;
pi_tild = M_.params(19);
M_.params(20) = 0.4836;
y_tild = M_.params(20);
M_.params(21) = 0.9;
phi_A = M_.params(21);
M_.params(22) = 0.0101;
R_tild = M_.params(22);
M_.params(29) = 0.9;
b_tild_over_y_tild = M_.params(29);
M_.params(24) = 0.192;
s_tr_ss = M_.params(24);
M_.params(25) = 0.2;
s_g = M_.params(25);
M_.params(30) = 1;
A_ss = M_.params(30);
%
% INITVAL instructions
%
options_.initval_file = false;
oo_.steady_state(1) = 0.4836;
oo_.steady_state(4) = 3.7829;
oo_.steady_state(3) = 0.2193;
oo_.steady_state(5) = 0.0262;
oo_.steady_state(2) = 0.3014;
oo_.steady_state(7) = 2.0492;
oo_.steady_state(6) = 0.4352;
oo_.steady_state(13) = 0.0967;
oo_.steady_state(14) = 0.0926;
oo_.steady_state(9) = 1.1249;
oo_.steady_state(8) = 0.0359;
oo_.steady_state(16) = 0.0101;
oo_.steady_state(17)=oo_.exo_steady_state(1);
if M_.exo_nbr > 0
	oo_.exo_simul = ones(M_.maximum_lag,1)*oo_.exo_steady_state';
end
if M_.exo_det_nbr > 0
	oo_.exo_det_simul = ones(M_.maximum_lag,1)*oo_.exo_det_steady_state';
end
%
% MSHOCKS instructions
%
M_.det_shocks = [ M_.det_shocks;
struct('exo_det',0,'exo_id',1,'multiplicative',1,'periods',1:1,'value',1.01) ];
M_.exo_det_length = 0;


oo_.time = toc(tic0);
disp(['Total computing time : ' dynsec2hms(oo_.time) ]);
if ~exist([M_.dname filesep 'Output'],'dir')
    mkdir(M_.dname,'Output');
end
save([M_.dname filesep 'Output' filesep 'Economides_Xepapadeas_Replication_results.mat'], 'oo_', 'M_', 'options_');
if exist('estim_params_', 'var') == 1
  save([M_.dname filesep 'Output' filesep 'Economides_Xepapadeas_Replication_results.mat'], 'estim_params_', '-append');
end
if exist('bayestopt_', 'var') == 1
  save([M_.dname filesep 'Output' filesep 'Economides_Xepapadeas_Replication_results.mat'], 'bayestopt_', '-append');
end
if exist('dataset_', 'var') == 1
  save([M_.dname filesep 'Output' filesep 'Economides_Xepapadeas_Replication_results.mat'], 'dataset_', '-append');
end
if exist('estimation_info', 'var') == 1
  save([M_.dname filesep 'Output' filesep 'Economides_Xepapadeas_Replication_results.mat'], 'estimation_info', '-append');
end
if exist('dataset_info', 'var') == 1
  save([M_.dname filesep 'Output' filesep 'Economides_Xepapadeas_Replication_results.mat'], 'dataset_info', '-append');
end
if exist('oo_recursive_', 'var') == 1
  save([M_.dname filesep 'Output' filesep 'Economides_Xepapadeas_Replication_results.mat'], 'oo_recursive_', '-append');
end
disp('Note: 1 warning(s) encountered in the preprocessor')
if ~isempty(lastwarn)
  disp('Note: warning(s) encountered in MATLAB/Octave code')
end
