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

tic;
global M_ oo_ options_ ys0_ ex0_ estimation_info
options_ = [];
M_.fname = 'dnk';
%
% Some global variables initialization
%
global_initialization;
diary off;
M_.exo_names = 'eps_c';
M_.exo_names_tex = 'eps\_c';
M_.exo_names_long = 'eps_c';
M_.exo_names = char(M_.exo_names, 'eps_g');
M_.exo_names_tex = char(M_.exo_names_tex, 'eps\_g');
M_.exo_names_long = char(M_.exo_names_long, 'eps_g');
M_.exo_names = char(M_.exo_names, 'eps_z');
M_.exo_names_tex = char(M_.exo_names_tex, 'eps\_z');
M_.exo_names_long = char(M_.exo_names_long, 'eps_z');
M_.endo_names = 'a_c';
M_.endo_names_tex = 'a\_c';
M_.endo_names_long = 'a_c';
M_.endo_names = char(M_.endo_names, 'a_g');
M_.endo_names_tex = char(M_.endo_names_tex, 'a\_g');
M_.endo_names_long = char(M_.endo_names_long, 'a_g');
M_.endo_names = char(M_.endo_names, 'a_z');
M_.endo_names_tex = char(M_.endo_names_tex, 'a\_z');
M_.endo_names_long = char(M_.endo_names_long, 'a_z');
M_.endo_names = char(M_.endo_names, 'b');
M_.endo_names_tex = char(M_.endo_names_tex, 'b');
M_.endo_names_long = char(M_.endo_names_long, 'b');
M_.endo_names = char(M_.endo_names, 'c');
M_.endo_names_tex = char(M_.endo_names_tex, 'c');
M_.endo_names_long = char(M_.endo_names_long, 'c');
M_.endo_names = char(M_.endo_names, 'dp');
M_.endo_names_tex = char(M_.endo_names_tex, 'dp');
M_.endo_names_long = char(M_.endo_names_long, 'dp');
M_.endo_names = char(M_.endo_names, 'ik');
M_.endo_names_tex = char(M_.endo_names_tex, 'ik');
M_.endo_names_long = char(M_.endo_names_long, 'ik');
M_.endo_names = char(M_.endo_names, 'k');
M_.endo_names_tex = char(M_.endo_names_tex, 'k');
M_.endo_names_long = char(M_.endo_names_long, 'k');
M_.endo_names = char(M_.endo_names, 'mack');
M_.endo_names_tex = char(M_.endo_names_tex, 'mack');
M_.endo_names_long = char(M_.endo_names_long, 'mack');
M_.endo_names = char(M_.endo_names, 'n');
M_.endo_names_tex = char(M_.endo_names_tex, 'n');
M_.endo_names_long = char(M_.endo_names_long, 'n');
M_.endo_names = char(M_.endo_names, 'p');
M_.endo_names_tex = char(M_.endo_names_tex, 'p');
M_.endo_names_long = char(M_.endo_names_long, 'p');
M_.endo_names = char(M_.endo_names, 'r');
M_.endo_names_tex = char(M_.endo_names_tex, 'r');
M_.endo_names_long = char(M_.endo_names_long, 'r');
M_.endo_names = char(M_.endo_names, 'rk');
M_.endo_names_tex = char(M_.endo_names_tex, 'rk');
M_.endo_names_long = char(M_.endo_names_long, 'rk');
M_.endo_names = char(M_.endo_names, 'rnot');
M_.endo_names_tex = char(M_.endo_names_tex, 'rnot');
M_.endo_names_long = char(M_.endo_names_long, 'rnot');
M_.endo_names = char(M_.endo_names, 'tax');
M_.endo_names_tex = char(M_.endo_names_tex, 'tax');
M_.endo_names_long = char(M_.endo_names_long, 'tax');
M_.endo_names = char(M_.endo_names, 'uc');
M_.endo_names_tex = char(M_.endo_names_tex, 'uc');
M_.endo_names_long = char(M_.endo_names_long, 'uc');
M_.endo_names = char(M_.endo_names, 'un');
M_.endo_names_tex = char(M_.endo_names_tex, 'un');
M_.endo_names_long = char(M_.endo_names_long, 'un');
M_.endo_names = char(M_.endo_names, 'vk');
M_.endo_names_tex = char(M_.endo_names_tex, 'vk');
M_.endo_names_long = char(M_.endo_names_long, 'vk');
M_.endo_names = char(M_.endo_names, 'w');
M_.endo_names_tex = char(M_.endo_names_tex, 'w');
M_.endo_names_long = char(M_.endo_names_long, 'w');
M_.endo_names = char(M_.endo_names, 'xp');
M_.endo_names_tex = char(M_.endo_names_tex, 'xp');
M_.endo_names_long = char(M_.endo_names_long, 'xp');
M_.endo_names = char(M_.endo_names, 'xw');
M_.endo_names_tex = char(M_.endo_names_tex, 'xw');
M_.endo_names_long = char(M_.endo_names_long, 'xw');
M_.endo_names = char(M_.endo_names, 'y');
M_.endo_names_tex = char(M_.endo_names_tex, 'y');
M_.endo_names_long = char(M_.endo_names_long, 'y');
M_.endo_names = char(M_.endo_names, 'zk');
M_.endo_names_tex = char(M_.endo_names_tex, 'zk');
M_.endo_names_long = char(M_.endo_names_long, 'zk');
M_.param_names = 'BETA';
M_.param_names_tex = 'BETA';
M_.param_names_long = 'BETA';
M_.param_names = char(M_.param_names, 'ALPHA');
M_.param_names_tex = char(M_.param_names_tex, 'ALPHA');
M_.param_names_long = char(M_.param_names_long, 'ALPHA');
M_.param_names = char(M_.param_names, 'DK');
M_.param_names_tex = char(M_.param_names_tex, 'DK');
M_.param_names_long = char(M_.param_names_long, 'DK');
M_.param_names = char(M_.param_names, 'ETA');
M_.param_names_tex = char(M_.param_names_tex, 'ETA');
M_.param_names_long = char(M_.param_names_long, 'ETA');
M_.param_names = char(M_.param_names, 'EC');
M_.param_names_tex = char(M_.param_names_tex, 'EC');
M_.param_names_long = char(M_.param_names_long, 'EC');
M_.param_names = char(M_.param_names, 'FIK');
M_.param_names_tex = char(M_.param_names_tex, 'FIK');
M_.param_names_long = char(M_.param_names_long, 'FIK');
M_.param_names = char(M_.param_names, 'TETAP');
M_.param_names_tex = char(M_.param_names_tex, 'TETAP');
M_.param_names_long = char(M_.param_names_long, 'TETAP');
M_.param_names = char(M_.param_names, 'TAYLOR_R');
M_.param_names_tex = char(M_.param_names_tex, 'TAYLOR\_R');
M_.param_names_long = char(M_.param_names_long, 'TAYLOR_R');
M_.param_names = char(M_.param_names, 'TAYLOR_Y');
M_.param_names_tex = char(M_.param_names_tex, 'TAYLOR\_Y');
M_.param_names_long = char(M_.param_names_long, 'TAYLOR_Y');
M_.param_names = char(M_.param_names, 'TAYLOR_P');
M_.param_names_tex = char(M_.param_names_tex, 'TAYLOR\_P');
M_.param_names_long = char(M_.param_names_long, 'TAYLOR_P');
M_.param_names = char(M_.param_names, 'XP_SS');
M_.param_names_tex = char(M_.param_names_tex, 'XP\_SS');
M_.param_names_long = char(M_.param_names_long, 'XP_SS');
M_.param_names = char(M_.param_names, 'LAGP');
M_.param_names_tex = char(M_.param_names_tex, 'LAGP');
M_.param_names_long = char(M_.param_names_long, 'LAGP');
M_.param_names = char(M_.param_names, 'XW_SS');
M_.param_names_tex = char(M_.param_names_tex, 'XW\_SS');
M_.param_names_long = char(M_.param_names_long, 'XW_SS');
M_.param_names = char(M_.param_names, 'TETAW');
M_.param_names_tex = char(M_.param_names_tex, 'TETAW');
M_.param_names_long = char(M_.param_names_long, 'TETAW');
M_.param_names = char(M_.param_names, 'LAGW');
M_.param_names_tex = char(M_.param_names_tex, 'LAGW');
M_.param_names_long = char(M_.param_names_long, 'LAGW');
M_.param_names = char(M_.param_names, 'ZETAK');
M_.param_names_tex = char(M_.param_names_tex, 'ZETAK');
M_.param_names_long = char(M_.param_names_long, 'ZETAK');
M_.param_names = char(M_.param_names, 'GBAR');
M_.param_names_tex = char(M_.param_names_tex, 'GBAR');
M_.param_names_long = char(M_.param_names_long, 'GBAR');
M_.param_names = char(M_.param_names, 'RHO_AG');
M_.param_names_tex = char(M_.param_names_tex, 'RHO\_AG');
M_.param_names_long = char(M_.param_names_long, 'RHO_AG');
M_.param_names = char(M_.param_names, 'RHO_AZ');
M_.param_names_tex = char(M_.param_names_tex, 'RHO\_AZ');
M_.param_names_long = char(M_.param_names_long, 'RHO_AZ');
M_.param_names = char(M_.param_names, 'RHO_AC');
M_.param_names_tex = char(M_.param_names_tex, 'RHO\_AC');
M_.param_names_long = char(M_.param_names_long, 'RHO_AC');
M_.param_names = char(M_.param_names, 'TAU');
M_.param_names_tex = char(M_.param_names_tex, 'TAU');
M_.param_names_long = char(M_.param_names_long, 'TAU');
M_.param_names = char(M_.param_names, 'ETAXB');
M_.param_names_tex = char(M_.param_names_tex, 'ETAXB');
M_.param_names_long = char(M_.param_names_long, 'ETAXB');
M_.param_names = char(M_.param_names, 'ETAXG');
M_.param_names_tex = char(M_.param_names_tex, 'ETAXG');
M_.param_names_long = char(M_.param_names_long, 'ETAXG');
M_.param_names = char(M_.param_names, 'RHOTAX');
M_.param_names_tex = char(M_.param_names_tex, 'RHOTAX');
M_.param_names_long = char(M_.param_names_long, 'RHOTAX');
M_.param_names = char(M_.param_names, 'YY_SS');
M_.param_names_tex = char(M_.param_names_tex, 'YY\_SS');
M_.param_names_long = char(M_.param_names_long, 'YY_SS');
M_.param_names = char(M_.param_names, 'CHI');
M_.param_names_tex = char(M_.param_names_tex, 'CHI');
M_.param_names_long = char(M_.param_names_long, 'CHI');
M_.exo_det_nbr = 0;
M_.exo_nbr = 3;
M_.endo_nbr = 23;
M_.param_nbr = 26;
M_.orig_endo_nbr = 23;
M_.aux_vars = [];
M_.Sigma_e = zeros(3, 3);
M_.Correlation_matrix = eye(3, 3);
M_.H = 0;
M_.Correlation_matrix_ME = 1;
options_.block=0;
options_.bytecode=0;
options_.use_dll=0;
erase_compiled_function('dnk_static');
erase_compiled_function('dnk_dynamic');
M_.lead_lag_incidence = [
 1 14 0;
 2 15 0;
 3 16 0;
 4 17 0;
 5 18 37;
 6 19 38;
 7 20 0;
 8 21 0;
 0 22 39;
 0 23 0;
 9 24 0;
 10 25 0;
 0 26 40;
 11 27 0;
 12 28 0;
 0 29 41;
 0 30 0;
 0 31 42;
 13 32 43;
 0 33 0;
 0 34 0;
 0 35 0;
 0 36 44;]';
M_.nstatic = 5;
M_.nfwrd   = 5;
M_.npred   = 10;
M_.nboth   = 3;
M_.nsfwrd   = 8;
M_.nspred   = 13;
M_.ndynamic   = 18;
M_.equations_tags = {
};
M_.static_and_dynamic_models_differ = 0;
M_.exo_names_orig_ord = [1:3];
M_.maximum_lag = 1;
M_.maximum_lead = 1;
M_.maximum_endo_lag = 1;
M_.maximum_endo_lead = 1;
oo_.steady_state = zeros(23, 1);
M_.maximum_exo_lag = 0;
M_.maximum_exo_lead = 0;
oo_.exo_steady_state = zeros(3, 1);
M_.params = NaN(26, 1);
M_.NNZDerivatives = zeros(3, 1);
M_.NNZDerivatives(1) = 99;
M_.NNZDerivatives(2) = -1;
M_.NNZDerivatives(3) = -1;
warning off;
steady;
%
% SHOCKS instructions
%
make_ex_;
M_.exo_det_length = 0;
M_.Sigma_e(1, 1) = (0.01)^2;
M_.Sigma_e(2, 2) = (0.01)^2;
M_.Sigma_e(3, 3) = (0.01)^2;
M_.sigma_e_is_diagonal = 1;
options_.irf = 0;
options_.order = 1;
options_.periods = 1000;
var_list_=[];
info = stoch_simul(var_list_);
save('dnk_results.mat', 'oo_', 'M_', 'options_');
if exist('estim_params_', 'var') == 1
  save('dnk_results.mat', 'estim_params_', '-append');
end
if exist('bayestopt_', 'var') == 1
  save('dnk_results.mat', 'bayestopt_', '-append');
end
if exist('dataset_', 'var') == 1
  save('dnk_results.mat', 'dataset_', '-append');
end
if exist('estimation_info', 'var') == 1
  save('dnk_results.mat', 'estimation_info', '-append');
end


disp(['Total computing time : ' dynsec2hms(toc) ]);
if ~isempty(lastwarn)
  disp('Note: warning(s) encountered in MATLAB/Octave code')
end
