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

clear all
tic;
global M_ oo_ options_ ys0_ ex0_ estimation_info
options_ = [];
M_.fname = 'mp_cur_un';
%
% Some global variables initialization
%
global_initialization;
diary off;
diary('mp_cur_un.log');
M_.exo_names = 'e_a';
M_.exo_names_tex = 'e\_a';
M_.exo_names_long = 'e_a';
M_.exo_names = char(M_.exo_names, 'e_b');
M_.exo_names_tex = char(M_.exo_names_tex, 'e\_b');
M_.exo_names_long = char(M_.exo_names_long, 'e_b');
M_.endo_names = 'u_a';
M_.endo_names_tex = 'u\_a';
M_.endo_names_long = 'u_a';
M_.endo_names = char(M_.endo_names, 'u_b');
M_.endo_names_tex = char(M_.endo_names_tex, 'u\_b');
M_.endo_names_long = char(M_.endo_names_long, 'u_b');
M_.endo_names = char(M_.endo_names, 'pi_ad');
M_.endo_names_tex = char(M_.endo_names_tex, 'pi\_ad');
M_.endo_names_long = char(M_.endo_names_long, 'pi_ad');
M_.endo_names = char(M_.endo_names, 'pi_bd');
M_.endo_names_tex = char(M_.endo_names_tex, 'pi\_bd');
M_.endo_names_long = char(M_.endo_names_long, 'pi_bd');
M_.endo_names = char(M_.endo_names, 'cpi_a');
M_.endo_names_tex = char(M_.endo_names_tex, 'cpi\_a');
M_.endo_names_long = char(M_.endo_names_long, 'cpi_a');
M_.endo_names = char(M_.endo_names, 'cpi_b');
M_.endo_names_tex = char(M_.endo_names_tex, 'cpi\_b');
M_.endo_names_long = char(M_.endo_names_long, 'cpi_b');
M_.endo_names = char(M_.endo_names, 's_ba');
M_.endo_names_tex = char(M_.endo_names_tex, 's\_ba');
M_.endo_names_long = char(M_.endo_names_long, 's_ba');
M_.endo_names = char(M_.endo_names, 'r_a');
M_.endo_names_tex = char(M_.endo_names_tex, 'r\_a');
M_.endo_names_long = char(M_.endo_names_long, 'r_a');
M_.endo_names = char(M_.endo_names, 'r_b');
M_.endo_names_tex = char(M_.endo_names_tex, 'r\_b');
M_.endo_names_long = char(M_.endo_names_long, 'r_b');
M_.endo_names = char(M_.endo_names, 'q_ab');
M_.endo_names_tex = char(M_.endo_names_tex, 'q\_ab');
M_.endo_names_long = char(M_.endo_names_long, 'q_ab');
M_.endo_names = char(M_.endo_names, 'z_a');
M_.endo_names_tex = char(M_.endo_names_tex, 'z\_a');
M_.endo_names_long = char(M_.endo_names_long, 'z_a');
M_.endo_names = char(M_.endo_names, 'z_b');
M_.endo_names_tex = char(M_.endo_names_tex, 'z\_b');
M_.endo_names_long = char(M_.endo_names_long, 'z_b');
M_.param_names = 'sigma_a';
M_.param_names_tex = 'sigma\_a';
M_.param_names_long = 'sigma_a';
M_.param_names = char(M_.param_names, 'sigma_b');
M_.param_names_tex = char(M_.param_names_tex, 'sigma\_b');
M_.param_names_long = char(M_.param_names_long, 'sigma_b');
M_.param_names = char(M_.param_names, 'omega_r');
M_.param_names_tex = char(M_.param_names_tex, 'omega\_r');
M_.param_names_long = char(M_.param_names_long, 'omega_r');
M_.param_names = char(M_.param_names, 'omega_p');
M_.param_names_tex = char(M_.param_names_tex, 'omega\_p');
M_.param_names_long = char(M_.param_names_long, 'omega_p');
M_.param_names = char(M_.param_names, 'omega_u');
M_.param_names_tex = char(M_.param_names_tex, 'omega\_u');
M_.param_names_long = char(M_.param_names_long, 'omega_u');
M_.param_names = char(M_.param_names, 'beta');
M_.param_names_tex = char(M_.param_names_tex, 'beta');
M_.param_names_long = char(M_.param_names_long, 'beta');
M_.param_names = char(M_.param_names, 'zeta');
M_.param_names_tex = char(M_.param_names_tex, 'zeta');
M_.param_names_long = char(M_.param_names_long, 'zeta');
M_.param_names = char(M_.param_names, 'phi_a1');
M_.param_names_tex = char(M_.param_names_tex, 'phi\_a1');
M_.param_names_long = char(M_.param_names_long, 'phi_a1');
M_.param_names = char(M_.param_names, 'phi_a2');
M_.param_names_tex = char(M_.param_names_tex, 'phi\_a2');
M_.param_names_long = char(M_.param_names_long, 'phi_a2');
M_.param_names = char(M_.param_names, 'phi_a3');
M_.param_names_tex = char(M_.param_names_tex, 'phi\_a3');
M_.param_names_long = char(M_.param_names_long, 'phi_a3');
M_.param_names = char(M_.param_names, 'phi_a4');
M_.param_names_tex = char(M_.param_names_tex, 'phi\_a4');
M_.param_names_long = char(M_.param_names_long, 'phi_a4');
M_.param_names = char(M_.param_names, 'phi_a5');
M_.param_names_tex = char(M_.param_names_tex, 'phi\_a5');
M_.param_names_long = char(M_.param_names_long, 'phi_a5');
M_.param_names = char(M_.param_names, 'phi_b1');
M_.param_names_tex = char(M_.param_names_tex, 'phi\_b1');
M_.param_names_long = char(M_.param_names_long, 'phi_b1');
M_.param_names = char(M_.param_names, 'phi_b2');
M_.param_names_tex = char(M_.param_names_tex, 'phi\_b2');
M_.param_names_long = char(M_.param_names_long, 'phi_b2');
M_.param_names = char(M_.param_names, 'phi_b3');
M_.param_names_tex = char(M_.param_names_tex, 'phi\_b3');
M_.param_names_long = char(M_.param_names_long, 'phi_b3');
M_.param_names = char(M_.param_names, 'phi_b4');
M_.param_names_tex = char(M_.param_names_tex, 'phi\_b4');
M_.param_names_long = char(M_.param_names_long, 'phi_b4');
M_.param_names = char(M_.param_names, 'phi_b5');
M_.param_names_tex = char(M_.param_names_tex, 'phi\_b5');
M_.param_names_long = char(M_.param_names_long, 'phi_b5');
M_.param_names = char(M_.param_names, 'delta_ap');
M_.param_names_tex = char(M_.param_names_tex, 'delta\_ap');
M_.param_names_long = char(M_.param_names_long, 'delta_ap');
M_.param_names = char(M_.param_names, 'delta_bp');
M_.param_names_tex = char(M_.param_names_tex, 'delta\_bp');
M_.param_names_long = char(M_.param_names_long, 'delta_bp');
M_.param_names = char(M_.param_names, 'rho_a0');
M_.param_names_tex = char(M_.param_names_tex, 'rho\_a0');
M_.param_names_long = char(M_.param_names_long, 'rho_a0');
M_.param_names = char(M_.param_names, 'rho_a1');
M_.param_names_tex = char(M_.param_names_tex, 'rho\_a1');
M_.param_names_long = char(M_.param_names_long, 'rho_a1');
M_.param_names = char(M_.param_names, 'rho_a2');
M_.param_names_tex = char(M_.param_names_tex, 'rho\_a2');
M_.param_names_long = char(M_.param_names_long, 'rho_a2');
M_.param_names = char(M_.param_names, 'rho_a3');
M_.param_names_tex = char(M_.param_names_tex, 'rho\_a3');
M_.param_names_long = char(M_.param_names_long, 'rho_a3');
M_.param_names = char(M_.param_names, 'rho_a4');
M_.param_names_tex = char(M_.param_names_tex, 'rho\_a4');
M_.param_names_long = char(M_.param_names_long, 'rho_a4');
M_.param_names = char(M_.param_names, 'rho_b0');
M_.param_names_tex = char(M_.param_names_tex, 'rho\_b0');
M_.param_names_long = char(M_.param_names_long, 'rho_b0');
M_.param_names = char(M_.param_names, 'rho_b1');
M_.param_names_tex = char(M_.param_names_tex, 'rho\_b1');
M_.param_names_long = char(M_.param_names_long, 'rho_b1');
M_.param_names = char(M_.param_names, 'rho_b2');
M_.param_names_tex = char(M_.param_names_tex, 'rho\_b2');
M_.param_names_long = char(M_.param_names_long, 'rho_b2');
M_.param_names = char(M_.param_names, 'rho_b3');
M_.param_names_tex = char(M_.param_names_tex, 'rho\_b3');
M_.param_names_long = char(M_.param_names_long, 'rho_b3');
M_.param_names = char(M_.param_names, 'rho_b4');
M_.param_names_tex = char(M_.param_names_tex, 'rho\_b4');
M_.param_names_long = char(M_.param_names_long, 'rho_b4');
M_.param_names = char(M_.param_names, 'rho_a');
M_.param_names_tex = char(M_.param_names_tex, 'rho\_a');
M_.param_names_long = char(M_.param_names_long, 'rho_a');
M_.param_names = char(M_.param_names, 'rho_b');
M_.param_names_tex = char(M_.param_names_tex, 'rho\_b');
M_.param_names_long = char(M_.param_names_long, 'rho_b');
M_.exo_det_nbr = 0;
M_.exo_nbr = 2;
M_.endo_nbr = 12;
M_.param_nbr = 31;
M_.orig_endo_nbr = 12;
M_.aux_vars = [];
M_.Sigma_e = zeros(2, 2);
M_.Correlation_matrix = eye(2, 2);
M_.H = 0;
M_.Correlation_matrix_ME = 1;
options_.linear = 1;
options_.block=0;
options_.bytecode=0;
options_.use_dll=0;
erase_compiled_function('mp_cur_un_static');
erase_compiled_function('mp_cur_un_dynamic');
M_.lead_lag_incidence = [
 1 7 19;
 2 8 20;
 0 9 21;
 0 10 22;
 0 11 23;
 0 12 24;
 3 13 25;
 0 14 0;
 0 15 0;
 4 16 0;
 5 17 0;
 6 18 0;]';
M_.nstatic = 2;
M_.nfwrd   = 4;
M_.npred   = 3;
M_.nboth   = 3;
M_.nsfwrd   = 7;
M_.nspred   = 6;
M_.ndynamic   = 10;
M_.equations_tags = {
};
M_.static_and_dynamic_models_differ = 0;
M_.exo_names_orig_ord = [1:2];
M_.maximum_lag = 1;
M_.maximum_lead = 1;
M_.maximum_endo_lag = 1;
M_.maximum_endo_lead = 1;
oo_.steady_state = zeros(12, 1);
M_.maximum_exo_lag = 0;
M_.maximum_exo_lead = 0;
oo_.exo_steady_state = zeros(2, 1);
M_.params = NaN(31, 1);
M_.NNZDerivatives = zeros(3, 1);
M_.NNZDerivatives(1) = 60;
M_.NNZDerivatives(2) = 0;
M_.NNZDerivatives(3) = -1;
M_.params( 4 ) = 1.5;
omega_p = M_.params( 4 );
M_.params( 5 ) = 0.125;
omega_u = M_.params( 5 );
M_.params( 1 ) = 0.00624;
sigma_a = M_.params( 1 );
M_.params( 2 ) = 0.00624;
sigma_b = M_.params( 2 );
M_.params( 3 ) = 0.85;
omega_r = M_.params( 3 );
M_.params( 7 ) = 0.5;
zeta = M_.params( 7 );
M_.params( 6 ) = 0.99;
beta = M_.params( 6 );
M_.params( 8 ) = (-0.3182);
phi_a1 = M_.params( 8 );
M_.params( 9 ) = 1.3182;
phi_a2 = M_.params( 9 );
M_.params( 10 ) = (-2.2727);
phi_a3 = M_.params( 10 );
M_.params( 11 ) = (-1.1478);
phi_a4 = M_.params( 11 );
M_.params( 12 ) = (-0.1148);
phi_a5 = M_.params( 12 );
M_.params( 13 ) = (-0.3182);
phi_b1 = M_.params( 13 );
M_.params( 14 ) = 1.3182;
phi_b2 = M_.params( 14 );
M_.params( 15 ) = (-2.2727);
phi_b3 = M_.params( 15 );
M_.params( 16 ) = (-2.2957);
phi_b4 = M_.params( 16 );
M_.params( 17 ) = (-0.1148);
phi_b5 = M_.params( 17 );
M_.params( 18 ) = 0.0858;
delta_ap = M_.params( 18 );
M_.params( 19 ) = 0.0858;
delta_bp = M_.params( 19 );
M_.params( 20 ) = 0.0452;
rho_a0 = M_.params( 20 );
M_.params( 21 ) = (-0.2872);
rho_a1 = M_.params( 21 );
M_.params( 22 ) = (-0.1219);
rho_a2 = M_.params( 22 );
M_.params( 23 ) = 0.7085;
rho_a3 = M_.params( 23 );
M_.params( 24 ) = 0.1236;
rho_a4 = M_.params( 24 );
M_.params( 25 ) = 0.0452;
rho_b0 = M_.params( 25 );
M_.params( 26 ) = (-0.2872);
rho_b1 = M_.params( 26 );
M_.params( 27 ) = (-0.1219);
rho_b2 = M_.params( 27 );
M_.params( 28 ) = 0.2915;
rho_b3 = M_.params( 28 );
M_.params( 29 ) = 0.1236;
rho_b4 = M_.params( 29 );
M_.params( 30 ) = 0.95;
rho_a = M_.params( 30 );
M_.params( 31 ) = 0.95;
rho_b = M_.params( 31 );
%
% INITVAL instructions
%
options_.initval_file = 0;
oo_.steady_state( 1 ) = 0;
oo_.steady_state( 2 ) = 0;
oo_.steady_state( 3 ) = 0;
oo_.steady_state( 4 ) = 0;
oo_.steady_state( 5 ) = 0;
oo_.steady_state( 6 ) = 0;
oo_.steady_state( 7 ) = 0;
oo_.steady_state( 8 ) = 0;
oo_.steady_state( 9 ) = 0;
oo_.steady_state( 10 ) = 0;
oo_.steady_state( 11 ) = 0;
oo_.steady_state( 12 ) = 0;
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;
steady;
oo_.dr.eigval = check(M_,options_,oo_);
%
% SHOCKS instructions
%
make_ex_;
M_.exo_det_length = 0;
M_.Sigma_e(1, 1) = M_.params(1)^2;
M_.Sigma_e(2, 2) = M_.params(2)^2;
M_.sigma_e_is_diagonal = 1;
options_.periods = 2100;
var_list_=[];
info = stoch_simul(var_list_);
save('mp_cur_un_results.mat', 'oo_', 'M_', 'options_');
if exist('estim_params_', 'var') == 1
  save('mp_cur_un_results.mat', 'estim_params_', '-append');
end
if exist('bayestopt_', 'var') == 1
  save('mp_cur_un_results.mat', 'bayestopt_', '-append');
end
if exist('dataset_', 'var') == 1
  save('mp_cur_un_results.mat', 'dataset_', '-append');
end
if exist('estimation_info', 'var') == 1
  save('mp_cur_un_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
diary off
