%
% 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;
% Save empty dates and dseries objects in memory.
dates('initialize');
dseries('initialize');
% Define global variables.
global M_ options_ oo_ estim_params_ bayestopt_ dataset_ dataset_info estimation_info ys0_ ex0_
options_ = [];
M_.fname = 'bench_nosb';
M_.dynare_version = '4.5.6';
oo_.dynare_version = '4.5.6';
options_.dynare_version = '4.5.6';
%
% Some global variables initialization
%
global_initialization;
diary off;
diary('bench_nosb.log');
M_.exo_names = 'exp_tau';
M_.exo_names_tex = 'exp\_tau';
M_.exo_names_long = 'exp_tau';
M_.exo_names = char(M_.exo_names, 'exp_m');
M_.exo_names_tex = char(M_.exo_names_tex, 'exp\_m');
M_.exo_names_long = char(M_.exo_names_long, 'exp_m');
M_.exo_names = char(M_.exo_names, 'exp_a');
M_.exo_names_tex = char(M_.exo_names_tex, 'exp\_a');
M_.exo_names_long = char(M_.exo_names_long, 'exp_a');
M_.exo_names = char(M_.exo_names, 'exp_g');
M_.exo_names_tex = char(M_.exo_names_tex, 'exp\_g');
M_.exo_names_long = char(M_.exo_names_long, 'exp_g');
M_.endo_names = 'ch';
M_.endo_names_tex = 'ch';
M_.endo_names_long = 'ch';
M_.endo_names = char(M_.endo_names, 'h');
M_.endo_names_tex = char(M_.endo_names_tex, 'h');
M_.endo_names_long = char(M_.endo_names_long, 'h');
M_.endo_names = char(M_.endo_names, 'i');
M_.endo_names_tex = char(M_.endo_names_tex, 'i');
M_.endo_names_long = char(M_.endo_names_long, 'i');
M_.endo_names = char(M_.endo_names, 'd');
M_.endo_names_tex = char(M_.endo_names_tex, 'd');
M_.endo_names_long = char(M_.endo_names_long, 'd');
M_.endo_names = char(M_.endo_names, 'lambda_h');
M_.endo_names_tex = char(M_.endo_names_tex, 'lambda\_h');
M_.endo_names_long = char(M_.endo_names_long, 'lambda_h');
M_.endo_names = char(M_.endo_names, 'm');
M_.endo_names_tex = char(M_.endo_names_tex, 'm');
M_.endo_names_long = char(M_.endo_names_long, 'm');
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, 'pi');
M_.endo_names_tex = char(M_.endo_names_tex, 'pi');
M_.endo_names_long = char(M_.endo_names_long, 'pi');
M_.endo_names = char(M_.endo_names, 'ks');
M_.endo_names_tex = char(M_.endo_names_tex, 'ks');
M_.endo_names_long = char(M_.endo_names_long, 'ks');
M_.endo_names = char(M_.endo_names, 'ls');
M_.endo_names_tex = char(M_.endo_names_tex, 'ls');
M_.endo_names_long = char(M_.endo_names_long, 'ls');
M_.endo_names = char(M_.endo_names, 'qk');
M_.endo_names_tex = char(M_.endo_names_tex, 'qk');
M_.endo_names_long = char(M_.endo_names_long, 'qk');
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, 'hs');
M_.endo_names_tex = char(M_.endo_names_tex, 'hs');
M_.endo_names_long = char(M_.endo_names_long, 'hs');
M_.endo_names = char(M_.endo_names, 'ys');
M_.endo_names_tex = char(M_.endo_names_tex, 'ys');
M_.endo_names_long = char(M_.endo_names_long, 'ys');
M_.endo_names = char(M_.endo_names, 'ps');
M_.endo_names_tex = char(M_.endo_names_tex, 'ps');
M_.endo_names_long = char(M_.endo_names_long, 'ps');
M_.endo_names = char(M_.endo_names, 'div_s');
M_.endo_names_tex = char(M_.endo_names_tex, 'div\_s');
M_.endo_names_long = char(M_.endo_names_long, 'div_s');
M_.endo_names = char(M_.endo_names, 'bg');
M_.endo_names_tex = char(M_.endo_names_tex, 'bg');
M_.endo_names_long = char(M_.endo_names_long, 'bg');
M_.endo_names = char(M_.endo_names, 'Rg');
M_.endo_names_tex = char(M_.endo_names_tex, 'Rg');
M_.endo_names_long = char(M_.endo_names_long, 'Rg');
M_.endo_names = char(M_.endo_names, 'kp');
M_.endo_names_tex = char(M_.endo_names_tex, 'kp');
M_.endo_names_long = char(M_.endo_names_long, 'kp');
M_.endo_names = char(M_.endo_names, 'lp');
M_.endo_names_tex = char(M_.endo_names_tex, 'lp');
M_.endo_names_long = char(M_.endo_names_long, 'lp');
M_.endo_names = char(M_.endo_names, 'hp');
M_.endo_names_tex = char(M_.endo_names_tex, 'hp');
M_.endo_names_long = char(M_.endo_names_long, 'hp');
M_.endo_names = char(M_.endo_names, 'yp');
M_.endo_names_tex = char(M_.endo_names_tex, 'yp');
M_.endo_names_long = char(M_.endo_names_long, 'yp');
M_.endo_names = char(M_.endo_names, 'pp');
M_.endo_names_tex = char(M_.endo_names_tex, 'pp');
M_.endo_names_long = char(M_.endo_names_long, 'pp');
M_.endo_names = char(M_.endo_names, 'div_p');
M_.endo_names_tex = char(M_.endo_names_tex, 'div\_p');
M_.endo_names_long = char(M_.endo_names_long, 'div_p');
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, 'Rs');
M_.endo_names_tex = char(M_.endo_names_tex, 'Rs');
M_.endo_names_long = char(M_.endo_names_long, 'Rs');
M_.endo_names = char(M_.endo_names, 'Rp');
M_.endo_names_tex = char(M_.endo_names_tex, 'Rp');
M_.endo_names_long = char(M_.endo_names_long, 'Rp');
M_.endo_names = char(M_.endo_names, 'lambda_c');
M_.endo_names_tex = char(M_.endo_names_tex, 'lambda\_c');
M_.endo_names_long = char(M_.endo_names_long, 'lambda_c');
M_.endo_names = char(M_.endo_names, 'div_cb');
M_.endo_names_tex = char(M_.endo_names_tex, 'div\_cb');
M_.endo_names_long = char(M_.endo_names_long, 'div_cb');
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, 'utility');
M_.endo_names_tex = char(M_.endo_names_tex, 'utility');
M_.endo_names_long = char(M_.endo_names_long, 'utility');
M_.endo_names = char(M_.endo_names, 'totutility');
M_.endo_names_tex = char(M_.endo_names_tex, 'totutility');
M_.endo_names_long = char(M_.endo_names_long, 'totutility');
M_.endo_names = char(M_.endo_names, 'lls');
M_.endo_names_tex = char(M_.endo_names_tex, 'lls');
M_.endo_names_long = char(M_.endo_names_long, 'lls');
M_.endo_names = char(M_.endo_names, 'yys');
M_.endo_names_tex = char(M_.endo_names_tex, 'yys');
M_.endo_names_long = char(M_.endo_names_long, 'yys');
M_.endo_names = char(M_.endo_names, 'tau_p');
M_.endo_names_tex = char(M_.endo_names_tex, 'tau\_p');
M_.endo_names_long = char(M_.endo_names_long, 'tau_p');
M_.endo_names = char(M_.endo_names, 'pw');
M_.endo_names_tex = char(M_.endo_names_tex, 'pw');
M_.endo_names_long = char(M_.endo_names_long, 'pw');
M_.endo_names = char(M_.endo_names, 'gdp');
M_.endo_names_tex = char(M_.endo_names_tex, 'gdp');
M_.endo_names_long = char(M_.endo_names_long, 'gdp');
M_.endo_names = char(M_.endo_names, 'gy');
M_.endo_names_tex = char(M_.endo_names_tex, 'gy');
M_.endo_names_long = char(M_.endo_names_long, 'gy');
M_.endo_names = char(M_.endo_names, 'gm');
M_.endo_names_tex = char(M_.endo_names_tex, 'gm');
M_.endo_names_long = char(M_.endo_names_long, 'gm');
M_.endo_names = char(M_.endo_names, 'gl');
M_.endo_names_tex = char(M_.endo_names_tex, 'gl');
M_.endo_names_long = char(M_.endo_names_long, 'gl');
M_.endo_names = char(M_.endo_names, 'A');
M_.endo_names_tex = char(M_.endo_names_tex, 'A');
M_.endo_names_long = char(M_.endo_names_long, 'A');
M_.endo_names = char(M_.endo_names, 'rs');
M_.endo_names_tex = char(M_.endo_names_tex, 'rs');
M_.endo_names_long = char(M_.endo_names_long, 'rs');
M_.endo_names = char(M_.endo_names, 'rp');
M_.endo_names_tex = char(M_.endo_names_tex, 'rp');
M_.endo_names_long = char(M_.endo_names_long, 'rp');
M_.endo_names = char(M_.endo_names, 'GAMMA');
M_.endo_names_tex = char(M_.endo_names_tex, 'GAMMA');
M_.endo_names_long = char(M_.endo_names_long, 'GAMMA');
M_.endo_partitions = struct();
M_.param_names = 'BETA';
M_.param_names_tex = 'BETA';
M_.param_names_long = 'BETA';
M_.param_names = char(M_.param_names, 'DELTA');
M_.param_names_tex = char(M_.param_names_tex, 'DELTA');
M_.param_names_long = char(M_.param_names_long, 'DELTA');
M_.param_names = char(M_.param_names, 'THETA_S');
M_.param_names_tex = char(M_.param_names_tex, 'THETA\_S');
M_.param_names_long = char(M_.param_names_long, 'THETA_S');
M_.param_names = char(M_.param_names, 'THETA_P');
M_.param_names_tex = char(M_.param_names_tex, 'THETA\_P');
M_.param_names_long = char(M_.param_names_long, 'THETA_P');
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, 'As');
M_.param_names_tex = char(M_.param_names_tex, 'As');
M_.param_names_long = char(M_.param_names_long, 'As');
M_.param_names = char(M_.param_names, 'Ap');
M_.param_names_tex = char(M_.param_names_tex, 'Ap');
M_.param_names_long = char(M_.param_names_long, 'Ap');
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, 'GAMMA_SS');
M_.param_names_tex = char(M_.param_names_tex, 'GAMMA\_SS');
M_.param_names_long = char(M_.param_names_long, 'GAMMA_SS');
M_.param_names = char(M_.param_names, 'TAU_S');
M_.param_names_tex = char(M_.param_names_tex, 'TAU\_S');
M_.param_names_long = char(M_.param_names_long, 'TAU_S');
M_.param_names = char(M_.param_names, 'TAU_P');
M_.param_names_tex = char(M_.param_names_tex, 'TAU\_P');
M_.param_names_long = char(M_.param_names_long, 'TAU_P');
M_.param_names = char(M_.param_names, 'SIGMA');
M_.param_names_tex = char(M_.param_names_tex, 'SIGMA');
M_.param_names_long = char(M_.param_names_long, 'SIGMA');
M_.param_names = char(M_.param_names, 'OMEGAI');
M_.param_names_tex = char(M_.param_names_tex, 'OMEGAI');
M_.param_names_long = char(M_.param_names_long, 'OMEGAI');
M_.param_names = char(M_.param_names, 'A_SS');
M_.param_names_tex = char(M_.param_names_tex, 'A\_SS');
M_.param_names_long = char(M_.param_names_long, 'A_SS');
M_.param_names = char(M_.param_names, 'MU');
M_.param_names_tex = char(M_.param_names_tex, 'MU');
M_.param_names_long = char(M_.param_names_long, 'MU');
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, 'EPSILON');
M_.param_names_tex = char(M_.param_names_tex, 'EPSILON');
M_.param_names_long = char(M_.param_names_long, 'EPSILON');
M_.param_names = char(M_.param_names, 'PI');
M_.param_names_tex = char(M_.param_names_tex, 'PI');
M_.param_names_long = char(M_.param_names_long, 'PI');
M_.param_names = char(M_.param_names, 'RL');
M_.param_names_tex = char(M_.param_names_tex, 'RL');
M_.param_names_long = char(M_.param_names_long, 'RL');
M_.param_names = char(M_.param_names, 'SIGMA_S');
M_.param_names_tex = char(M_.param_names_tex, 'SIGMA\_S');
M_.param_names_long = char(M_.param_names_long, 'SIGMA_S');
M_.param_names = char(M_.param_names, 'BETA_B');
M_.param_names_tex = char(M_.param_names_tex, 'BETA\_B');
M_.param_names_long = char(M_.param_names_long, 'BETA_B');
M_.param_names = char(M_.param_names, 'BETA_E');
M_.param_names_tex = char(M_.param_names_tex, 'BETA\_E');
M_.param_names_long = char(M_.param_names_long, 'BETA_E');
M_.param_names = char(M_.param_names, 'PHI');
M_.param_names_tex = char(M_.param_names_tex, 'PHI');
M_.param_names_long = char(M_.param_names_long, 'PHI');
M_.param_names = char(M_.param_names, 'ALPHA_S');
M_.param_names_tex = char(M_.param_names_tex, 'ALPHA\_S');
M_.param_names_long = char(M_.param_names_long, 'ALPHA_S');
M_.param_names = char(M_.param_names, 'ALPHA_P');
M_.param_names_tex = char(M_.param_names_tex, 'ALPHA\_P');
M_.param_names_long = char(M_.param_names_long, 'ALPHA_P');
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, 'KAPPA');
M_.param_names_tex = char(M_.param_names_tex, 'KAPPA');
M_.param_names_long = char(M_.param_names_long, 'KAPPA');
M_.param_names = char(M_.param_names, 'XI');
M_.param_names_tex = char(M_.param_names_tex, 'XI');
M_.param_names_long = char(M_.param_names_long, 'XI');
M_.param_names = char(M_.param_names, 'KAPPA_M');
M_.param_names_tex = char(M_.param_names_tex, 'KAPPA\_M');
M_.param_names_long = char(M_.param_names_long, 'KAPPA_M');
M_.param_names = char(M_.param_names, 'ZETAL');
M_.param_names_tex = char(M_.param_names_tex, 'ZETAL');
M_.param_names_long = char(M_.param_names_long, 'ZETAL');
M_.param_names = char(M_.param_names, 'SIGTAU');
M_.param_names_tex = char(M_.param_names_tex, 'SIGTAU');
M_.param_names_long = char(M_.param_names_long, 'SIGTAU');
M_.param_names = char(M_.param_names, 'SIGA');
M_.param_names_tex = char(M_.param_names_tex, 'SIGA');
M_.param_names_long = char(M_.param_names_long, 'SIGA');
M_.param_names = char(M_.param_names, 'SIGM');
M_.param_names_tex = char(M_.param_names_tex, 'SIGM');
M_.param_names_long = char(M_.param_names_long, 'SIGM');
M_.param_names = char(M_.param_names, 'SIGG');
M_.param_names_tex = char(M_.param_names_tex, 'SIGG');
M_.param_names_long = char(M_.param_names_long, 'SIGG');
M_.param_partitions = struct();
M_.exo_det_nbr = 0;
M_.exo_nbr = 4;
M_.endo_nbr = 44;
M_.param_nbr = 34;
M_.orig_endo_nbr = 44;
M_.aux_vars = [];
M_.Sigma_e = zeros(4, 4);
M_.Correlation_matrix = eye(4, 4);
M_.H = 0;
M_.Correlation_matrix_ME = 1;
M_.sigma_e_is_diagonal = 1;
M_.det_shocks = [];
options_.block=0;
options_.bytecode=0;
options_.use_dll=0;
M_.hessian_eq_zero = 1;
erase_compiled_function('bench_nosb_static');
erase_compiled_function('bench_nosb_dynamic');
M_.orig_eq_nbr = 44;
M_.eq_nbr = 44;
M_.ramsey_eq_nbr = 0;
M_.set_auxiliary_variables = exist(['./' M_.fname '_set_auxiliary_variables.m'], 'file') == 2;
M_.lead_lag_incidence = [
 0 17 61;
 0 18 0;
 1 19 62;
 2 20 0;
 0 21 63;
 3 22 0;
 4 23 0;
 0 24 64;
 5 25 0;
 6 26 0;
 0 27 65;
 0 28 0;
 0 29 0;
 0 30 66;
 0 31 67;
 0 32 0;
 7 33 0;
 0 34 68;
 8 35 0;
 9 36 0;
 0 37 0;
 0 38 69;
 0 39 70;
 0 40 0;
 0 41 0;
 10 42 0;
 11 43 0;
 0 44 0;
 0 45 0;
 12 46 0;
 0 47 0;
 0 48 71;
 0 49 0;
 0 50 0;
 13 51 0;
 0 52 0;
 14 53 0;
 0 54 0;
 0 55 0;
 0 56 0;
 15 57 0;
 0 58 0;
 0 59 0;
 16 60 0;]';
M_.nstatic = 18;
M_.nfwrd   = 10;
M_.npred   = 15;
M_.nboth   = 1;
M_.nsfwrd   = 11;
M_.nspred   = 16;
M_.ndynamic   = 26;
M_.equations_tags = {
};
M_.static_and_dynamic_models_differ = 0;
M_.exo_names_orig_ord = [1:4];
M_.maximum_lag = 1;
M_.maximum_lead = 1;
M_.maximum_endo_lag = 1;
M_.maximum_endo_lead = 1;
oo_.steady_state = zeros(44, 1);
M_.maximum_exo_lag = 0;
M_.maximum_exo_lead = 0;
oo_.exo_steady_state = zeros(4, 1);
M_.params = NaN(34, 1);
M_.NNZDerivatives = [212; -1; -1];
parameter=calibration;
M_.params( 1 ) = parameter(1);
BETA = M_.params( 1 );
M_.params( 2 ) = parameter(2);
DELTA = M_.params( 2 );
M_.params( 3 ) = parameter(3);
THETA_S = M_.params( 3 );
M_.params( 4 ) = parameter(4);
THETA_P = M_.params( 4 );
M_.params( 5 ) = parameter(5);
ALPHA = M_.params( 5 );
M_.params( 6 ) = parameter(6);
As = M_.params( 6 );
M_.params( 7 ) = parameter(7);
Ap = M_.params( 7 );
M_.params( 8 ) = parameter(8);
ETA = M_.params( 8 );
M_.params( 9 ) = parameter(9);
GAMMA_SS = M_.params( 9 );
M_.params( 10 ) = parameter(10);
TAU_S = M_.params( 10 );
M_.params( 11 ) = parameter(11);
TAU_P = M_.params( 11 );
M_.params( 12 ) = parameter(12);
SIGMA = M_.params( 12 );
M_.params( 13 ) = parameter(13);
OMEGAI = M_.params( 13 );
M_.params( 15 ) = parameter(14);
MU = M_.params( 15 );
M_.params( 16 ) = parameter(15);
ZETA = M_.params( 16 );
M_.params( 17 ) = parameter(16);
EPSILON = M_.params( 17 );
M_.params( 18 ) = parameter(17);
PI = M_.params( 18 );
M_.params( 19 ) = parameter(18);
RL = M_.params( 19 );
M_.params( 20 ) = parameter(19);
SIGMA_S = M_.params( 20 );
M_.params( 21 ) = parameter(20);
BETA_B = M_.params( 21 );
M_.params( 22 ) = parameter(21);
BETA_E = M_.params( 22 );
M_.params( 23 ) = parameter(22);
PHI = M_.params( 23 );
M_.params( 26 ) = parameter(25);
OMEGA_P = M_.params( 26 );
M_.params( 30 ) = parameter(31);
ZETAL = M_.params( 30 );
M_.params( 24 ) = parameter(23);
ALPHA_S = M_.params( 24 );
M_.params( 25 ) = parameter(24);
ALPHA_P = M_.params( 25 );
M_.params( 27 ) = parameter(26);
KAPPA = M_.params( 27 );
M_.params( 28 ) = parameter(27);
XI = M_.params( 28 );
M_.params( 29 ) = parameter(28);
KAPPA_M = M_.params( 29 );
M_.params( 14 ) = 1;
A_SS = M_.params( 14 );
load shock_type
M_.params( 31 ) = sig_tau*0.01;
SIGTAU = M_.params( 31 );
M_.params( 32 ) = 0.01*sig_a;
SIGA = M_.params( 32 );
M_.params( 33 ) = 0.01*sig_m;
SIGM = M_.params( 33 );
M_.params( 34 ) = 0.01*sig_g;
SIGG = M_.params( 34 );
%
% SHOCKS instructions
%
M_.exo_det_length = 0;
M_.Sigma_e(1, 1) = (M_.params(31))^2;
M_.Sigma_e(2, 2) = (M_.params(33))^2;
M_.Sigma_e(3, 3) = (M_.params(32))^2;
M_.Sigma_e(4, 4) = (M_.params(34))^2;
model_diagnostics(M_,options_,oo_);
resid;
steady;
oo_.dr.eigval = check(M_,options_,oo_);
options_.irf = 10;
options_.nograph = 1;
options_.order = 1;
var_list_ = char();
info = stoch_simul(var_list_);
save('bench_nosb_results.mat', 'oo_', 'M_', 'options_');
if exist('estim_params_', 'var') == 1
  save('bench_nosb_results.mat', 'estim_params_', '-append');
end
if exist('bayestopt_', 'var') == 1
  save('bench_nosb_results.mat', 'bayestopt_', '-append');
end
if exist('dataset_', 'var') == 1
  save('bench_nosb_results.mat', 'dataset_', '-append');
end
if exist('estimation_info', 'var') == 1
  save('bench_nosb_results.mat', 'estimation_info', '-append');
end
if exist('dataset_info', 'var') == 1
  save('bench_nosb_results.mat', 'dataset_info', '-append');
end
if exist('oo_recursive_', 'var') == 1
  save('bench_nosb_results.mat', 'oo_recursive_', '-append');
end


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