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

clearvars -global
clear_persistent_variables(fileparts(which('dynare')), false)
tic0 = tic;
% Define global variables.
global M_ options_ oo_ estim_params_ bayestopt_ dataset_ dataset_info estimation_info
options_ = [];
M_.fname = 'Born_Pfeifer_2018_welfare';
M_.dynare_version = '6.0';
oo_.dynare_version = '6.0';
options_.dynare_version = '6.0';
%
% Some global variables initialization
%
global_initialization;
M_.exo_names = cell(4,1);
M_.exo_names_tex = cell(4,1);
M_.exo_names_long = cell(4,1);
M_.exo_names(1) = {'eps_a'};
M_.exo_names_tex(1) = {'{\varepsilon_a}'};
M_.exo_names_long(1) = {'technology shock'};
M_.exo_names(2) = {'eps_z'};
M_.exo_names_tex(2) = {'{\varepsilon_z}'};
M_.exo_names_long(2) = {'preference shock'};
M_.exo_names(3) = {'eps_nu'};
M_.exo_names_tex(3) = {'{\varepsilon_\nu}'};
M_.exo_names_long(3) = {'monetary policy shock'};
M_.exo_names(4) = {'eps_tau_n'};
M_.exo_names_tex(4) = {'{\varepsilon_{\tau^n}}'};
M_.exo_names_long(4) = {'labor tax shock'};
M_.endo_names = cell(44,1);
M_.endo_names_tex = cell(44,1);
M_.endo_names_long = cell(44,1);
M_.endo_names(1) = {'C'};
M_.endo_names_tex(1) = {'{C}'};
M_.endo_names_long(1) = {'Consumption'};
M_.endo_names(2) = {'W_real'};
M_.endo_names_tex(2) = {'{\frac{W}{P}}'};
M_.endo_names_long(2) = {'Real Wage'};
M_.endo_names(3) = {'Pi'};
M_.endo_names_tex(3) = {'{\Pi}'};
M_.endo_names_long(3) = {'inflation'};
M_.endo_names(4) = {'A'};
M_.endo_names_tex(4) = {'{A}'};
M_.endo_names_long(4) = {'AR(1) technology process'};
M_.endo_names(5) = {'N'};
M_.endo_names_tex(5) = {'{N}'};
M_.endo_names_long(5) = {'Hours worked'};
M_.endo_names(6) = {'R'};
M_.endo_names_tex(6) = {'{R^n}'};
M_.endo_names_long(6) = {'Nominal Interest Rate'};
M_.endo_names(7) = {'realinterest'};
M_.endo_names_tex(7) = {'{R^{r}}'};
M_.endo_names_long(7) = {'Real Interest Rate'};
M_.endo_names(8) = {'Y'};
M_.endo_names_tex(8) = {'{Y}'};
M_.endo_names_long(8) = {'Output'};
M_.endo_names(9) = {'Q'};
M_.endo_names_tex(9) = {'{Q}'};
M_.endo_names_long(9) = {'Bond price'};
M_.endo_names(10) = {'Z'};
M_.endo_names_tex(10) = {'{Z}'};
M_.endo_names_long(10) = {'AR(1) preference shock process'};
M_.endo_names(11) = {'S'};
M_.endo_names_tex(11) = {'{S}'};
M_.endo_names_long(11) = {'Price dispersion'};
M_.endo_names(12) = {'Pi_star'};
M_.endo_names_tex(12) = {'{\Pi^*}'};
M_.endo_names_long(12) = {'Optimal reset price'};
M_.endo_names(13) = {'x_aux_1'};
M_.endo_names_tex(13) = {'{x_1}'};
M_.endo_names_long(13) = {'aux. var. 1 recursive price setting'};
M_.endo_names(14) = {'x_aux_2'};
M_.endo_names_tex(14) = {'{x_2}'};
M_.endo_names_long(14) = {'aux. var. 2 recursive price setting'};
M_.endo_names(15) = {'MC'};
M_.endo_names_tex(15) = {'{mc}'};
M_.endo_names_long(15) = {'real marginal costs'};
M_.endo_names(16) = {'M_real'};
M_.endo_names_tex(16) = {'{M/P}'};
M_.endo_names_long(16) = {'real money stock'};
M_.endo_names(17) = {'i_ann'};
M_.endo_names_tex(17) = {'{i^{ann}}'};
M_.endo_names_long(17) = {'annualized nominal interest rate'};
M_.endo_names(18) = {'pi_p_ann'};
M_.endo_names_tex(18) = {'{\pi^{ann}}'};
M_.endo_names_long(18) = {'annualized inflation rate'};
M_.endo_names(19) = {'r_real_ann'};
M_.endo_names_tex(19) = {'{r^{r,ann}}'};
M_.endo_names_long(19) = {'annualized real interest rate'};
M_.endo_names(20) = {'log_y'};
M_.endo_names_tex(20) = {'{\log(Y)}'};
M_.endo_names_long(20) = {'log output'};
M_.endo_names(21) = {'log_W_real'};
M_.endo_names_tex(21) = {'{\log(W/P)}'};
M_.endo_names_long(21) = {'log real wage'};
M_.endo_names(22) = {'log_N'};
M_.endo_names_tex(22) = {'{\log(N)}'};
M_.endo_names_long(22) = {'log hours'};
M_.endo_names(23) = {'log_A'};
M_.endo_names_tex(23) = {'{\log(A)}'};
M_.endo_names_long(23) = {'log technology level'};
M_.endo_names(24) = {'log_Z'};
M_.endo_names_tex(24) = {'{\log(Z)}'};
M_.endo_names_long(24) = {'log preference shock'};
M_.endo_names(25) = {'log_Pi'};
M_.endo_names_tex(25) = {'{\log(\Pi)}'};
M_.endo_names_long(25) = {'log inflation'};
M_.endo_names(26) = {'log_Pi_w'};
M_.endo_names_tex(26) = {'{\log(\Pi_w)}'};
M_.endo_names_long(26) = {'log wage inflation'};
M_.endo_names(27) = {'nu'};
M_.endo_names_tex(27) = {'{\nu}'};
M_.endo_names_long(27) = {'AR(1) monetary policy shock process'};
M_.endo_names(28) = {'Pi_w'};
M_.endo_names_tex(28) = {'{\Pi^w}'};
M_.endo_names_long(28) = {'wage inflation'};
M_.endo_names(29) = {'Pi_w_star'};
M_.endo_names_tex(29) = {'{\Pi^*_w}'};
M_.endo_names_long(29) = {'Optimal reset wage'};
M_.endo_names(30) = {'f'};
M_.endo_names_tex(30) = {'{f}'};
M_.endo_names_long(30) = {'aux. var. recursive wage setting'};
M_.endo_names(31) = {'S_w'};
M_.endo_names_tex(31) = {'{S^w}'};
M_.endo_names_long(31) = {'Wage dispersion'};
M_.endo_names(32) = {'pi_w_ann'};
M_.endo_names_tex(32) = {'{\pi^{w,ann}}'};
M_.endo_names_long(32) = {'annualized wage inflation rate'};
M_.endo_names(33) = {'N_d'};
M_.endo_names_tex(33) = {'{N^d}'};
M_.endo_names_long(33) = {'Effective Hours worked'};
M_.endo_names(34) = {'tau_n'};
M_.endo_names_tex(34) = {'{\tau_n}'};
M_.endo_names_long(34) = {'labor tax'};
M_.endo_names(35) = {'MPN'};
M_.endo_names_tex(35) = {'{MPN}'};
M_.endo_names_long(35) = {'Marginal product of labor'};
M_.endo_names(36) = {'MRS'};
M_.endo_names_tex(36) = {'{MRS}'};
M_.endo_names_long(36) = {'After tax marginal rate of substitution'};
M_.endo_names(37) = {'Utility'};
M_.endo_names_tex(37) = {'{\mathbb{W}}'};
M_.endo_names_long(37) = {'Period Utility'};
M_.endo_names(38) = {'X_w'};
M_.endo_names_tex(38) = {'{X^{W}}'};
M_.endo_names_long(38) = {'Auxiliary variable from aggregation in utility'};
M_.endo_names(39) = {'N_nat'};
M_.endo_names_tex(39) = {'{N^{nat}}'};
M_.endo_names_long(39) = {'Natural hours worked'};
M_.endo_names(40) = {'Y_nat'};
M_.endo_names_tex(40) = {'{Y^{nat}}'};
M_.endo_names_long(40) = {'Natural output'};
M_.endo_names(41) = {'log_Y_gap'};
M_.endo_names_tex(41) = {'{\log{Y^{gap}}}'};
M_.endo_names_long(41) = {'Log output gap'};
M_.endo_names(42) = {'Recursive_Welfare'};
M_.endo_names_tex(42) = {'{\mathbb{V}}'};
M_.endo_names_long(42) = {'Recursive welfare'};
M_.endo_names(43) = {'Welfare_gap'};
M_.endo_names_tex(43) = {'{\mathbb{V^{gap}}}'};
M_.endo_names_long(43) = {'Welfare gap given lambda'};
M_.endo_names(44) = {'Recursive_natural_welfare_equivalent'};
M_.endo_names_tex(44) = {'{\mathbb{V^{nat}_{gap}}}'};
M_.endo_names_long(44) = {'Recursive welfare natural EQ, given lambda'};
M_.endo_partitions = struct();
M_.param_names = cell(23,1);
M_.param_names_tex = cell(23,1);
M_.param_names_long = cell(23,1);
M_.param_names(1) = {'alppha'};
M_.param_names_tex(1) = {'{\alpha}'};
M_.param_names_long(1) = {'capital share'};
M_.param_names(2) = {'betta'};
M_.param_names_tex(2) = {'{\beta}'};
M_.param_names_long(2) = {'discount factor'};
M_.param_names(3) = {'rho_a'};
M_.param_names_tex(3) = {'{\rho_a}'};
M_.param_names_long(3) = {'autocorrelation technology shock'};
M_.param_names(4) = {'rho_nu'};
M_.param_names_tex(4) = {'{\rho_{\nu}}'};
M_.param_names_long(4) = {'autocorrelation monetary policy shock'};
M_.param_names(5) = {'rho_z'};
M_.param_names_tex(5) = {'{\rho_{z}}'};
M_.param_names_long(5) = {'autocorrelation demand shock'};
M_.param_names(6) = {'siggma'};
M_.param_names_tex(6) = {'{\sigma}'};
M_.param_names_long(6) = {'inverse EIS'};
M_.param_names(7) = {'varphi'};
M_.param_names_tex(7) = {'{\varphi}'};
M_.param_names_long(7) = {'inverse Frisch elasticity'};
M_.param_names(8) = {'phi_pi'};
M_.param_names_tex(8) = {'{\phi_{\pi}}'};
M_.param_names_long(8) = {'inflation feedback Taylor Rule'};
M_.param_names(9) = {'phi_y'};
M_.param_names_tex(9) = {'{\phi_{y}}'};
M_.param_names_long(9) = {'output feedback Taylor Rule'};
M_.param_names(10) = {'eta'};
M_.param_names_tex(10) = {'{\eta}'};
M_.param_names_long(10) = {'semi-elasticity of money demand'};
M_.param_names(11) = {'epsilon_p'};
M_.param_names_tex(11) = {'{\epsilon_p}'};
M_.param_names_long(11) = {'demand elasticity'};
M_.param_names(12) = {'theta_p'};
M_.param_names_tex(12) = {'{\theta_p}'};
M_.param_names_long(12) = {'Calvo parameter'};
M_.param_names(13) = {'tau_s_p'};
M_.param_names_tex(13) = {'{\tau^{s}_p}'};
M_.param_names_long(13) = {'labor subsidy firms'};
M_.param_names(14) = {'tau_s_w'};
M_.param_names_tex(14) = {'{\tau^{s}_w}'};
M_.param_names_long(14) = {'labor subsidy workers'};
M_.param_names(15) = {'epsilon_w'};
M_.param_names_tex(15) = {'{\epsilon_w}'};
M_.param_names_long(15) = {'demand elasticity labor services'};
M_.param_names(16) = {'theta_w'};
M_.param_names_tex(16) = {'{\theta_w}'};
M_.param_names_long(16) = {'Calvo parameter wages'};
M_.param_names(17) = {'phi_w'};
M_.param_names_tex(17) = {'{\phi_w}'};
M_.param_names_long(17) = {'Rotemberg parameter wages'};
M_.param_names(18) = {'tau_n_SS'};
M_.param_names_tex(18) = {'{\bar {\tau^n}}'};
M_.param_names_long(18) = {'Steady state labor tax'};
M_.param_names(19) = {'tau_c'};
M_.param_names_tex(19) = {'{\tau_c}'};
M_.param_names_long(19) = {'Consumption taxes'};
M_.param_names(20) = {'rho_tau_n'};
M_.param_names_tex(20) = {'{\rho_{\tau^n}}'};
M_.param_names_long(20) = {'labor tax persistence'};
M_.param_names(21) = {'lambda_w'};
M_.param_names_tex(21) = {'{\lambda_{w}}'};
M_.param_names_long(21) = {'slope of the Wage PC'};
M_.param_names(22) = {'lambda_p'};
M_.param_names_tex(22) = {'{\lambda_{p}}'};
M_.param_names_long(22) = {'slope of the PC'};
M_.param_names(23) = {'lambda_utility'};
M_.param_names_tex(23) = {'{\lambda}'};
M_.param_names_long(23) = {'Welfare_relevant consumption fraction'};
M_.param_partitions = struct();
M_.exo_det_nbr = 0;
M_.exo_nbr = 4;
M_.endo_nbr = 44;
M_.param_nbr = 23;
M_.orig_endo_nbr = 44;
M_.aux_vars = [];
options_.varobs = cell(1, 1);
options_.varobs(1)  = {'C'};
options_.varobs_id = [ 1  ];
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 = true;
M_.det_shocks = [];
M_.surprise_shocks = [];
M_.learnt_shocks = [];
M_.learnt_endval = [];
M_.heteroskedastic_shocks.Qvalue_orig = [];
M_.heteroskedastic_shocks.Qscale_orig = [];
M_.matched_irfs = {};
M_.matched_irfs_weights = {};
options_.linear = false;
options_.block = false;
options_.bytecode = false;
options_.use_dll = false;
options_.ramsey_policy = false;
options_.discretionary_policy = false;
M_.nonzero_hessian_eqs = [1 2 3 4 5 6 7 8 9 13 14 16 17 18 19 20 21 22 23 24 26 27 28 29 30 32 33 35 36 38 40 41 42 43 44];
M_.hessian_eq_zero = isempty(M_.nonzero_hessian_eqs);
M_.eq_nbr = 44;
M_.ramsey_orig_eq_nbr = 0;
M_.ramsey_orig_endo_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 = 0;
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 = [
 0 9 53;
 1 10 0;
 0 11 0;
 2 12 0;
 0 13 0;
 0 14 0;
 0 15 0;
 0 16 0;
 0 17 0;
 3 18 54;
 4 19 0;
 0 20 0;
 0 21 55;
 0 22 56;
 0 23 0;
 0 24 0;
 0 25 0;
 0 26 0;
 0 27 0;
 0 28 0;
 0 29 0;
 0 30 0;
 0 31 0;
 0 32 0;
 0 33 0;
 0 34 0;
 5 35 0;
 0 36 57;
 0 37 58;
 0 38 59;
 6 39 0;
 0 40 0;
 0 41 0;
 7 42 0;
 0 43 0;
 0 44 0;
 0 45 0;
 8 46 0;
 0 47 0;
 0 48 0;
 0 49 0;
 0 50 60;
 0 51 0;
 0 52 61;]';
M_.nstatic = 28;
M_.nfwrd   = 8;
M_.npred   = 7;
M_.nboth   = 1;
M_.nsfwrd   = 9;
M_.nspred   = 8;
M_.ndynamic   = 16;
M_.dynamic_tmp_nbr = [29; 34; 14; 0; ];
M_.equations_tags = {
  1 , 'name' , 'LOM wages' ;
  2 , 'name' , 'LOM wage dispersion' ;
  3 , 'name' , 'Auxiliary wage setting recursion 1' ;
  4 , 'name' , 'Auxiliary wage setting recursion 2' ;
  5 , 'name' , 'Definition effective labor' ;
  6 , 'name' , 'Definition wage inflation' ;
  7 , 'name' , 'Euler equation eq. (3)' ;
  8 , 'name' , 'Definition nominal interest rate), p. 22 top' ;
  9 , 'name' , 'Aggregate output, above eq. (14)' ;
  10 , 'name' , 'Definition Real interest rate' ;
  11 , 'name' , 'Simple rule' ;
  12 , 'name' , 'Market Clearing, eq. (15)' ;
  13 , 'name' , 'Technology Shock, eq. (6)' ;
  14 , 'name' , 'Preference Shock, p.54' ;
  15 , 'name' , 'Monetary policy shock' ;
  16 , 'name' , 'Definition marginal cost' ;
  17 , 'name' , 'LOM prices, eq. (7)' ;
  18 , 'name' , 'LOM price dispersion' ;
  19 , 'name' , 'FOC price setting' ;
  20 , 'name' , 'Auxiliary price setting recursion 1' ;
  21 , 'name' , 'Auxiliary price setting recursion 2' ;
  22 , 'name' , 'Definition log output' ;
  23 , 'name' , 'Definition log real wage' ;
  24 , 'name' , 'Definition log hours' ;
  25 , 'name' , 'Annualized inflation' ;
  26 , 'name' , 'Annualized wage inflation' ;
  27 , 'name' , 'Annualized nominal interest rate' ;
  28 , 'name' , 'Annualized real interest rate' ;
  29 , 'name' , 'Real money demand, eq. (4)' ;
  30 , 'name' , 'Definition log TFP' ;
  31 , 'name' , 'Definition log preference' ;
  32 , 'name' , 'Definition log preference' ;
  33 , 'name' , 'Definition log preference' ;
  34 , 'name' , 'Labor tax process' ;
  35 , 'name' , 'Period utility' ;
  36 , 'name' , 'Auxiliary variable wage dispersion utility' ;
  37 , 'name' , 'Recursive Welfare' ;
  38 , 'name' , 'Natural Recursive Welfare' ;
  39 , 'name' , 'Definition welfare gap' ;
  40 , 'name' , 'Definition marginal product of labor' ;
  41 , 'name' , 'Definition after tax marginal rate of substitution (not sure about correct aggregation/concept of aggregate MRS, only used to check steady state)' ;
  42 , 'name' , 'Definition natural hours worked (MRS=MPN with Y=C)' ;
  43 , 'name' , 'Definition natural output' ;
  44 , 'name' , 'Definition log output gap' ;
};
M_.mapping.C.eqidx = [3 7 12 20 21 35 41 ];
M_.mapping.W_real.eqidx = [3 6 16 23 ];
M_.mapping.Pi.eqidx = [11 ];
M_.mapping.A.eqidx = [9 13 30 40 42 43 ];
M_.mapping.N.eqidx = [5 24 41 ];
M_.mapping.R.eqidx = [8 10 27 29 ];
M_.mapping.realinterest.eqidx = [10 28 ];
M_.mapping.Y.eqidx = [9 12 16 20 21 22 29 44 ];
M_.mapping.Q.eqidx = [7 8 ];
M_.mapping.Z.eqidx = [3 4 7 14 20 21 33 35 38 ];
M_.mapping.S.eqidx = [9 16 18 40 ];
M_.mapping.Pi_star.eqidx = [17 18 19 ];
M_.mapping.x_aux_1.eqidx = [19 20 ];
M_.mapping.x_aux_2.eqidx = [19 21 ];
M_.mapping.MC.eqidx = [16 20 ];
M_.mapping.M_real.eqidx = [29 ];
M_.mapping.i_ann.eqidx = [27 ];
M_.mapping.pi_p_ann.eqidx = [25 ];
M_.mapping.r_real_ann.eqidx = [28 ];
M_.mapping.log_y.eqidx = [22 ];
M_.mapping.log_W_real.eqidx = [23 ];
M_.mapping.log_N.eqidx = [24 ];
M_.mapping.log_A.eqidx = [30 ];
M_.mapping.log_Z.eqidx = [33 ];
M_.mapping.log_Pi.eqidx = [31 ];
M_.mapping.log_Pi_w.eqidx = [32 ];
M_.mapping.nu.eqidx = [15 ];
M_.mapping.Pi_w.eqidx = [1 2 3 4 6 26 32 36 ];
M_.mapping.Pi_w_star.eqidx = [1 2 3 4 36 ];
M_.mapping.f.eqidx = [3 4 ];
M_.mapping.S_w.eqidx = [2 5 ];
M_.mapping.pi_w_ann.eqidx = [26 ];
M_.mapping.N_d.eqidx = [3 4 5 9 16 35 40 ];
M_.mapping.tau_n.eqidx = [3 34 41 42 ];
M_.mapping.MPN.eqidx = [40 ];
M_.mapping.MRS.eqidx = [41 ];
M_.mapping.Utility.eqidx = [35 37 ];
M_.mapping.X_w.eqidx = [35 36 ];
M_.mapping.N_nat.eqidx = [38 42 43 ];
M_.mapping.Y_nat.eqidx = [38 43 44 ];
M_.mapping.log_Y_gap.eqidx = [44 ];
M_.mapping.Recursive_Welfare.eqidx = [37 39 ];
M_.mapping.Welfare_gap.eqidx = [39 ];
M_.mapping.Recursive_natural_welfare_equivalent.eqidx = [38 39 ];
M_.mapping.eps_a.eqidx = [13 ];
M_.mapping.eps_z.eqidx = [14 ];
M_.mapping.eps_nu.eqidx = [15 ];
M_.mapping.eps_tau_n.eqidx = [34 ];
M_.static_and_dynamic_models_differ = false;
M_.has_external_function = false;
M_.block_structure.time_recursive = false;
M_.block_structure.block(1).Simulation_Type = 1;
M_.block_structure.block(1).endo_nbr = 1;
M_.block_structure.block(1).mfs = 1;
M_.block_structure.block(1).equation = [ 11];
M_.block_structure.block(1).variable = [ 3];
M_.block_structure.block(1).is_linear = true;
M_.block_structure.block(1).NNZDerivatives = 1;
M_.block_structure.block(1).bytecode_jacob_cols_to_sparse = [2 ];
M_.block_structure.block(2).Simulation_Type = 3;
M_.block_structure.block(2).endo_nbr = 1;
M_.block_structure.block(2).mfs = 1;
M_.block_structure.block(2).equation = [ 13];
M_.block_structure.block(2).variable = [ 4];
M_.block_structure.block(2).is_linear = false;
M_.block_structure.block(2).NNZDerivatives = 2;
M_.block_structure.block(2).bytecode_jacob_cols_to_sparse = [0 1 ];
M_.block_structure.block(3).Simulation_Type = 3;
M_.block_structure.block(3).endo_nbr = 1;
M_.block_structure.block(3).mfs = 1;
M_.block_structure.block(3).equation = [ 14];
M_.block_structure.block(3).variable = [ 10];
M_.block_structure.block(3).is_linear = false;
M_.block_structure.block(3).NNZDerivatives = 2;
M_.block_structure.block(3).bytecode_jacob_cols_to_sparse = [0 1 ];
M_.block_structure.block(4).Simulation_Type = 1;
M_.block_structure.block(4).endo_nbr = 1;
M_.block_structure.block(4).mfs = 1;
M_.block_structure.block(4).equation = [ 15];
M_.block_structure.block(4).variable = [ 27];
M_.block_structure.block(4).is_linear = true;
M_.block_structure.block(4).NNZDerivatives = 2;
M_.block_structure.block(4).bytecode_jacob_cols_to_sparse = [1 2 ];
M_.block_structure.block(5).Simulation_Type = 3;
M_.block_structure.block(5).endo_nbr = 1;
M_.block_structure.block(5).mfs = 1;
M_.block_structure.block(5).equation = [ 17];
M_.block_structure.block(5).variable = [ 12];
M_.block_structure.block(5).is_linear = false;
M_.block_structure.block(5).NNZDerivatives = 1;
M_.block_structure.block(5).bytecode_jacob_cols_to_sparse = [1 ];
M_.block_structure.block(6).Simulation_Type = 1;
M_.block_structure.block(6).endo_nbr = 6;
M_.block_structure.block(6).mfs = 6;
M_.block_structure.block(6).equation = [ 18 25 30 31 33 34];
M_.block_structure.block(6).variable = [ 11 18 23 25 24 34];
M_.block_structure.block(6).is_linear = true;
M_.block_structure.block(6).NNZDerivatives = 8;
M_.block_structure.block(6).bytecode_jacob_cols_to_sparse = [1 6 7 8 9 10 11 12 ];
M_.block_structure.block(7).Simulation_Type = 3;
M_.block_structure.block(7).endo_nbr = 1;
M_.block_structure.block(7).mfs = 1;
M_.block_structure.block(7).equation = [ 42];
M_.block_structure.block(7).variable = [ 39];
M_.block_structure.block(7).is_linear = false;
M_.block_structure.block(7).NNZDerivatives = 1;
M_.block_structure.block(7).bytecode_jacob_cols_to_sparse = [1 ];
M_.block_structure.block(8).Simulation_Type = 1;
M_.block_structure.block(8).endo_nbr = 1;
M_.block_structure.block(8).mfs = 1;
M_.block_structure.block(8).equation = [ 43];
M_.block_structure.block(8).variable = [ 40];
M_.block_structure.block(8).is_linear = true;
M_.block_structure.block(8).NNZDerivatives = 1;
M_.block_structure.block(8).bytecode_jacob_cols_to_sparse = [2 ];
M_.block_structure.block(9).Simulation_Type = 2;
M_.block_structure.block(9).endo_nbr = 1;
M_.block_structure.block(9).mfs = 1;
M_.block_structure.block(9).equation = [ 38];
M_.block_structure.block(9).variable = [ 44];
M_.block_structure.block(9).is_linear = true;
M_.block_structure.block(9).NNZDerivatives = 2;
M_.block_structure.block(9).bytecode_jacob_cols_to_sparse = [2 3 ];
M_.block_structure.block(10).Simulation_Type = 8;
M_.block_structure.block(10).endo_nbr = 10;
M_.block_structure.block(10).mfs = 8;
M_.block_structure.block(10).equation = [ 9 12 20 3 16 4 6 19 21 1];
M_.block_structure.block(10).variable = [ 8 1 15 33 2 30 28 13 14 29];
M_.block_structure.block(10).is_linear = false;
M_.block_structure.block(10).NNZDerivatives = 36;
M_.block_structure.block(10).bytecode_jacob_cols_to_sparse = [3 0 0 9 10 11 12 13 14 15 16 20 21 22 23 24 ];
M_.block_structure.block(11).Simulation_Type = 1;
M_.block_structure.block(11).endo_nbr = 2;
M_.block_structure.block(11).mfs = 2;
M_.block_structure.block(11).equation = [ 36 35];
M_.block_structure.block(11).variable = [ 38 37];
M_.block_structure.block(11).is_linear = true;
M_.block_structure.block(11).NNZDerivatives = 4;
M_.block_structure.block(11).bytecode_jacob_cols_to_sparse = [1 3 4 ];
M_.block_structure.block(12).Simulation_Type = 2;
M_.block_structure.block(12).endo_nbr = 1;
M_.block_structure.block(12).mfs = 1;
M_.block_structure.block(12).equation = [ 37];
M_.block_structure.block(12).variable = [ 42];
M_.block_structure.block(12).is_linear = true;
M_.block_structure.block(12).NNZDerivatives = 2;
M_.block_structure.block(12).bytecode_jacob_cols_to_sparse = [2 3 ];
M_.block_structure.block(13).Simulation_Type = 1;
M_.block_structure.block(13).endo_nbr = 2;
M_.block_structure.block(13).mfs = 2;
M_.block_structure.block(13).equation = [ 7 2];
M_.block_structure.block(13).variable = [ 9 31];
M_.block_structure.block(13).is_linear = true;
M_.block_structure.block(13).NNZDerivatives = 2;
M_.block_structure.block(13).bytecode_jacob_cols_to_sparse = [2 3 4 ];
M_.block_structure.block(14).Simulation_Type = 3;
M_.block_structure.block(14).endo_nbr = 1;
M_.block_structure.block(14).mfs = 1;
M_.block_structure.block(14).equation = [ 5];
M_.block_structure.block(14).variable = [ 5];
M_.block_structure.block(14).is_linear = true;
M_.block_structure.block(14).NNZDerivatives = 1;
M_.block_structure.block(14).bytecode_jacob_cols_to_sparse = [1 ];
M_.block_structure.block(15).Simulation_Type = 1;
M_.block_structure.block(15).endo_nbr = 5;
M_.block_structure.block(15).mfs = 5;
M_.block_structure.block(15).equation = [ 8 39 40 41 44];
M_.block_structure.block(15).variable = [ 6 43 35 36 41];
M_.block_structure.block(15).is_linear = true;
M_.block_structure.block(15).NNZDerivatives = 5;
M_.block_structure.block(15).bytecode_jacob_cols_to_sparse = [6 7 8 9 10 ];
M_.block_structure.block(16).Simulation_Type = 3;
M_.block_structure.block(16).endo_nbr = 1;
M_.block_structure.block(16).mfs = 1;
M_.block_structure.block(16).equation = [ 10];
M_.block_structure.block(16).variable = [ 7];
M_.block_structure.block(16).is_linear = true;
M_.block_structure.block(16).NNZDerivatives = 1;
M_.block_structure.block(16).bytecode_jacob_cols_to_sparse = [1 ];
M_.block_structure.block(17).Simulation_Type = 1;
M_.block_structure.block(17).endo_nbr = 8;
M_.block_structure.block(17).mfs = 8;
M_.block_structure.block(17).equation = [ 32 29 28 27 26 24 23 22];
M_.block_structure.block(17).variable = [ 26 16 19 17 32 22 21 20];
M_.block_structure.block(17).is_linear = true;
M_.block_structure.block(17).NNZDerivatives = 8;
M_.block_structure.block(17).bytecode_jacob_cols_to_sparse = [9 10 11 12 13 14 15 16 ];
M_.block_structure.block(1).g1_sparse_rowval = int32([]);
M_.block_structure.block(1).g1_sparse_colval = int32([]);
M_.block_structure.block(1).g1_sparse_colptr = int32([]);
M_.block_structure.block(2).g1_sparse_rowval = int32([1 ]);
M_.block_structure.block(2).g1_sparse_colval = int32([1 ]);
M_.block_structure.block(2).g1_sparse_colptr = int32([1 2 ]);
M_.block_structure.block(3).g1_sparse_rowval = int32([1 ]);
M_.block_structure.block(3).g1_sparse_colval = int32([1 ]);
M_.block_structure.block(3).g1_sparse_colptr = int32([1 2 ]);
M_.block_structure.block(4).g1_sparse_rowval = int32([]);
M_.block_structure.block(4).g1_sparse_colval = int32([]);
M_.block_structure.block(4).g1_sparse_colptr = int32([]);
M_.block_structure.block(5).g1_sparse_rowval = int32([1 ]);
M_.block_structure.block(5).g1_sparse_colval = int32([1 ]);
M_.block_structure.block(5).g1_sparse_colptr = int32([1 2 ]);
M_.block_structure.block(6).g1_sparse_rowval = int32([]);
M_.block_structure.block(6).g1_sparse_colval = int32([]);
M_.block_structure.block(6).g1_sparse_colptr = int32([]);
M_.block_structure.block(7).g1_sparse_rowval = int32([1 ]);
M_.block_structure.block(7).g1_sparse_colval = int32([1 ]);
M_.block_structure.block(7).g1_sparse_colptr = int32([1 2 ]);
M_.block_structure.block(8).g1_sparse_rowval = int32([]);
M_.block_structure.block(8).g1_sparse_colval = int32([]);
M_.block_structure.block(8).g1_sparse_colptr = int32([]);
M_.block_structure.block(9).g1_sparse_rowval = int32([]);
M_.block_structure.block(9).g1_sparse_colval = int32([]);
M_.block_structure.block(9).g1_sparse_colptr = int32([]);
M_.block_structure.block(10).g1_sparse_rowval = int32([5 1 3 1 2 3 4 7 2 3 5 2 4 5 8 1 6 6 7 2 4 8 2 4 2 4 1 7 2 4 ]);
M_.block_structure.block(10).g1_sparse_colval = int32([3 9 9 10 10 10 10 10 11 11 11 12 12 13 13 14 14 15 15 16 16 16 20 20 21 21 22 23 24 24 ]);
M_.block_structure.block(10).g1_sparse_colptr = int32([1 1 1 2 2 2 2 2 2 4 9 12 14 16 18 20 23 23 23 23 25 27 28 29 31 ]);
M_.block_structure.block(11).g1_sparse_rowval = int32([]);
M_.block_structure.block(11).g1_sparse_colval = int32([]);
M_.block_structure.block(11).g1_sparse_colptr = int32([]);
M_.block_structure.block(12).g1_sparse_rowval = int32([]);
M_.block_structure.block(12).g1_sparse_colval = int32([]);
M_.block_structure.block(12).g1_sparse_colptr = int32([]);
M_.block_structure.block(13).g1_sparse_rowval = int32([]);
M_.block_structure.block(13).g1_sparse_colval = int32([]);
M_.block_structure.block(13).g1_sparse_colptr = int32([]);
M_.block_structure.block(14).g1_sparse_rowval = int32([1 ]);
M_.block_structure.block(14).g1_sparse_colval = int32([1 ]);
M_.block_structure.block(14).g1_sparse_colptr = int32([1 2 ]);
M_.block_structure.block(15).g1_sparse_rowval = int32([]);
M_.block_structure.block(15).g1_sparse_colval = int32([]);
M_.block_structure.block(15).g1_sparse_colptr = int32([]);
M_.block_structure.block(16).g1_sparse_rowval = int32([1 ]);
M_.block_structure.block(16).g1_sparse_colval = int32([1 ]);
M_.block_structure.block(16).g1_sparse_colptr = int32([1 2 ]);
M_.block_structure.block(17).g1_sparse_rowval = int32([]);
M_.block_structure.block(17).g1_sparse_colval = int32([]);
M_.block_structure.block(17).g1_sparse_colptr = int32([]);
M_.block_structure.variable_reordered = [ 3 4 10 27 12 11 18 23 25 24 34 39 40 44 8 1 15 33 2 30 28 13 14 29 38 37 42 9 31 5 6 43 35 36 41 7 26 16 19 17 32 22 21 20];
M_.block_structure.equation_reordered = [ 11 13 14 15 17 18 25 30 31 33 34 42 43 38 9 12 20 3 16 4 6 19 21 1 36 35 37 7 2 5 8 39 40 41 44 10 32 29 28 27 26 24 23 22];
M_.block_structure.incidence(1).lead_lag = -1;
M_.block_structure.incidence(1).sparse_IM = [
 2 31;
 6 2;
 13 4;
 14 10;
 15 27;
 18 11;
 34 34;
 36 38;
];
M_.block_structure.incidence(2).lead_lag = 0;
M_.block_structure.incidence(2).sparse_IM = [
 1 28;
 1 29;
 2 28;
 2 29;
 2 31;
 3 1;
 3 2;
 3 10;
 3 29;
 3 30;
 3 33;
 3 34;
 4 10;
 4 29;
 4 30;
 4 33;
 5 5;
 5 31;
 5 33;
 6 2;
 6 28;
 7 1;
 7 9;
 7 10;
 8 6;
 8 9;
 9 4;
 9 8;
 9 11;
 9 33;
 10 6;
 10 7;
 11 3;
 12 1;
 12 8;
 13 4;
 14 10;
 15 27;
 16 2;
 16 8;
 16 11;
 16 15;
 16 33;
 17 12;
 18 11;
 18 12;
 19 12;
 19 13;
 19 14;
 20 1;
 20 8;
 20 10;
 20 13;
 20 15;
 21 1;
 21 8;
 21 10;
 21 14;
 22 8;
 22 20;
 23 2;
 23 21;
 24 5;
 24 22;
 25 18;
 26 28;
 26 32;
 27 6;
 27 17;
 28 7;
 28 19;
 29 6;
 29 8;
 29 16;
 30 4;
 30 23;
 31 25;
 32 26;
 32 28;
 33 10;
 33 24;
 34 34;
 35 1;
 35 10;
 35 33;
 35 37;
 35 38;
 36 28;
 36 29;
 36 38;
 37 37;
 37 42;
 38 10;
 38 39;
 38 40;
 38 44;
 39 42;
 39 43;
 39 44;
 40 4;
 40 11;
 40 33;
 40 35;
 41 1;
 41 5;
 41 34;
 41 36;
 42 4;
 42 34;
 42 39;
 43 4;
 43 39;
 43 40;
 44 8;
 44 40;
 44 41;
];
M_.block_structure.incidence(3).lead_lag = 1;
M_.block_structure.incidence(3).sparse_IM = [
 3 28;
 3 29;
 3 30;
 4 28;
 4 29;
 4 30;
 7 1;
 7 10;
 20 13;
 21 14;
 37 42;
 38 44;
];
M_.block_structure.dyn_tmp_nbr = 22;
M_.state_var = [4 10 27 11 34 2 38 31 ];
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(23, 1);
M_.endo_trends = struct('deflator', cell(44, 1), 'log_deflator', cell(44, 1), 'growth_factor', cell(44, 1), 'log_growth_factor', cell(44, 1));
M_.NNZDerivatives = [140; 212; -1; ];
M_.dynamic_g1_sparse_rowval = int32([6 13 14 18 15 2 34 36 3 7 12 20 21 35 41 3 6 16 23 11 9 13 30 40 42 43 5 24 41 8 10 27 29 10 28 9 12 16 20 21 22 29 44 7 8 3 4 7 14 20 21 33 35 38 9 16 18 40 17 18 19 19 20 19 21 16 20 29 27 25 28 22 23 24 30 33 31 32 15 1 2 6 26 32 36 1 2 3 4 36 3 4 2 5 26 3 4 5 9 16 35 40 3 34 41 42 40 41 35 37 35 36 38 42 43 38 43 44 44 37 39 39 38 39 7 7 20 21 3 4 3 4 3 4 37 38 13 14 15 34 ]);
M_.dynamic_g1_sparse_colval = int32([2 4 10 11 27 31 34 38 45 45 45 45 45 45 45 46 46 46 46 47 48 48 48 48 48 48 49 49 49 50 50 50 50 51 51 52 52 52 52 52 52 52 52 53 53 54 54 54 54 54 54 54 54 54 55 55 55 55 56 56 56 57 57 58 58 59 59 60 61 62 63 64 65 66 67 68 69 70 71 72 72 72 72 72 72 73 73 73 73 73 74 74 75 75 76 77 77 77 77 77 77 77 78 78 78 78 79 80 81 81 82 82 83 83 83 84 84 84 85 86 86 87 88 88 89 98 101 102 116 116 117 117 118 118 130 132 133 134 135 136 ]);
M_.dynamic_g1_sparse_colptr = int32([1 1 2 2 3 3 3 3 3 3 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 7 7 7 8 8 8 8 9 9 9 9 9 9 9 16 20 21 27 30 34 36 44 46 55 59 62 64 66 68 69 70 71 72 73 74 75 76 77 78 79 80 86 91 93 95 96 103 107 108 109 111 113 116 119 120 122 123 125 126 126 126 126 126 126 126 126 126 127 127 127 128 129 129 129 129 129 129 129 129 129 129 129 129 129 129 131 133 135 135 135 135 135 135 135 135 135 135 135 135 136 136 137 138 139 140 141 ]);
M_.dynamic_g2_sparse_indices = int32([1 72 72 ;
1 73 73 ;
2 72 72 ;
2 72 31 ;
2 73 73 ;
3 45 45 ;
3 45 46 ;
3 45 54 ;
3 45 73 ;
3 45 77 ;
3 45 78 ;
3 46 54 ;
3 46 73 ;
3 46 77 ;
3 46 78 ;
3 54 73 ;
3 54 77 ;
3 54 78 ;
3 116 116 ;
3 116 73 ;
3 116 117 ;
3 116 118 ;
3 73 73 ;
3 73 117 ;
3 73 118 ;
3 73 77 ;
3 73 78 ;
3 117 117 ;
3 117 118 ;
3 77 78 ;
4 54 73 ;
4 54 77 ;
4 116 116 ;
4 116 73 ;
4 116 117 ;
4 116 118 ;
4 73 73 ;
4 73 117 ;
4 73 118 ;
4 73 77 ;
4 117 117 ;
4 117 118 ;
4 77 77 ;
5 49 75 ;
5 75 75 ;
6 2 2 ;
6 2 46 ;
7 45 45 ;
7 45 89 ;
7 45 54 ;
7 45 98 ;
7 89 89 ;
7 89 54 ;
7 89 98 ;
7 54 54 ;
7 54 98 ;
8 53 53 ;
9 48 55 ;
9 48 77 ;
9 55 55 ;
9 55 77 ;
9 77 77 ;
13 4 4 ;
13 48 48 ;
14 10 10 ;
14 54 54 ;
16 46 52 ;
16 46 55 ;
16 46 77 ;
16 52 52 ;
16 52 55 ;
16 52 77 ;
16 55 55 ;
16 55 77 ;
16 77 77 ;
17 56 56 ;
18 56 56 ;
19 56 56 ;
19 57 58 ;
19 58 58 ;
20 45 45 ;
20 45 52 ;
20 45 54 ;
20 45 59 ;
20 52 54 ;
20 52 59 ;
20 54 59 ;
21 45 45 ;
21 45 52 ;
21 45 54 ;
21 52 54 ;
22 52 52 ;
23 46 46 ;
24 49 49 ;
26 72 72 ;
27 50 50 ;
28 51 51 ;
29 50 50 ;
29 50 52 ;
30 48 48 ;
32 72 72 ;
33 54 54 ;
35 45 45 ;
35 45 54 ;
35 54 77 ;
35 54 82 ;
35 77 77 ;
35 77 82 ;
36 72 72 ;
36 72 38 ;
36 73 73 ;
38 54 83 ;
38 54 84 ;
38 83 83 ;
38 84 84 ;
40 48 55 ;
40 48 77 ;
40 55 55 ;
40 55 77 ;
40 77 77 ;
41 45 45 ;
41 45 49 ;
41 45 78 ;
41 49 49 ;
41 49 78 ;
41 78 78 ;
42 48 48 ;
42 48 78 ;
42 48 83 ;
42 78 78 ;
42 78 83 ;
42 83 83 ;
43 48 83 ;
43 83 83 ;
44 52 52 ;
44 84 84 ;
]);
M_.lhs = {
'1'; 
'S_w'; 
'f'; 
'f'; 
'N_d'; 
'Pi_w'; 
'Q'; 
'R'; 
'Y'; 
'R'; 
'Pi'; 
'C'; 
'log(A)'; 
'log(Z)'; 
'nu'; 
'MC'; 
'1'; 
'S'; 
'Pi_star^(1+epsilon_p*alppha/(1-alppha))'; 
'x_aux_1'; 
'x_aux_2'; 
'log_y'; 
'log_W_real'; 
'log_N'; 
'pi_p_ann'; 
'pi_w_ann'; 
'i_ann'; 
'r_real_ann'; 
'M_real'; 
'log_A'; 
'log_Pi'; 
'log_Pi_w'; 
'log_Z'; 
'tau_n'; 
'Utility'; 
'X_w'; 
'Recursive_Welfare'; 
'Recursive_natural_welfare_equivalent'; 
'Welfare_gap'; 
'MPN'; 
'MRS'; 
'epsilon_w*(1+tau_c)/(1+tau_n)*N_nat^varphi/(A*N_nat^(1-alppha))^(-siggma)/(epsilon_w-1)/tau_s_w'; 
'Y_nat'; 
'log_Y_gap'; 
};
M_.static_tmp_nbr = [22; 9; 0; 0; ];
M_.block_structure_stat.block(1).Simulation_Type = 1;
M_.block_structure_stat.block(1).endo_nbr = 3;
M_.block_structure_stat.block(1).mfs = 3;
M_.block_structure_stat.block(1).equation = [ 6 7 8];
M_.block_structure_stat.block(1).variable = [ 28 9 6];
M_.block_structure_stat.block(2).Simulation_Type = 3;
M_.block_structure_stat.block(2).endo_nbr = 1;
M_.block_structure_stat.block(2).mfs = 1;
M_.block_structure_stat.block(2).equation = [ 10];
M_.block_structure_stat.block(2).variable = [ 7];
M_.block_structure_stat.block(3).Simulation_Type = 1;
M_.block_structure_stat.block(3).endo_nbr = 1;
M_.block_structure_stat.block(3).mfs = 1;
M_.block_structure_stat.block(3).equation = [ 11];
M_.block_structure_stat.block(3).variable = [ 3];
M_.block_structure_stat.block(4).Simulation_Type = 3;
M_.block_structure_stat.block(4).endo_nbr = 1;
M_.block_structure_stat.block(4).mfs = 1;
M_.block_structure_stat.block(4).equation = [ 13];
M_.block_structure_stat.block(4).variable = [ 4];
M_.block_structure_stat.block(5).Simulation_Type = 3;
M_.block_structure_stat.block(5).endo_nbr = 1;
M_.block_structure_stat.block(5).mfs = 1;
M_.block_structure_stat.block(5).equation = [ 14];
M_.block_structure_stat.block(5).variable = [ 10];
M_.block_structure_stat.block(6).Simulation_Type = 3;
M_.block_structure_stat.block(6).endo_nbr = 1;
M_.block_structure_stat.block(6).mfs = 1;
M_.block_structure_stat.block(6).equation = [ 15];
M_.block_structure_stat.block(6).variable = [ 27];
M_.block_structure_stat.block(7).Simulation_Type = 3;
M_.block_structure_stat.block(7).endo_nbr = 1;
M_.block_structure_stat.block(7).mfs = 1;
M_.block_structure_stat.block(7).equation = [ 17];
M_.block_structure_stat.block(7).variable = [ 12];
M_.block_structure_stat.block(8).Simulation_Type = 3;
M_.block_structure_stat.block(8).endo_nbr = 1;
M_.block_structure_stat.block(8).mfs = 1;
M_.block_structure_stat.block(8).equation = [ 18];
M_.block_structure_stat.block(8).variable = [ 11];
M_.block_structure_stat.block(9).Simulation_Type = 1;
M_.block_structure_stat.block(9).endo_nbr = 8;
M_.block_structure_stat.block(9).mfs = 8;
M_.block_structure_stat.block(9).equation = [ 25 26 27 28 30 31 32 33];
M_.block_structure_stat.block(9).variable = [ 18 32 17 19 23 25 26 24];
M_.block_structure_stat.block(10).Simulation_Type = 3;
M_.block_structure_stat.block(10).endo_nbr = 1;
M_.block_structure_stat.block(10).mfs = 1;
M_.block_structure_stat.block(10).equation = [ 34];
M_.block_structure_stat.block(10).variable = [ 34];
M_.block_structure_stat.block(11).Simulation_Type = 3;
M_.block_structure_stat.block(11).endo_nbr = 1;
M_.block_structure_stat.block(11).mfs = 1;
M_.block_structure_stat.block(11).equation = [ 42];
M_.block_structure_stat.block(11).variable = [ 39];
M_.block_structure_stat.block(12).Simulation_Type = 1;
M_.block_structure_stat.block(12).endo_nbr = 1;
M_.block_structure_stat.block(12).mfs = 1;
M_.block_structure_stat.block(12).equation = [ 43];
M_.block_structure_stat.block(12).variable = [ 40];
M_.block_structure_stat.block(13).Simulation_Type = 3;
M_.block_structure_stat.block(13).endo_nbr = 1;
M_.block_structure_stat.block(13).mfs = 1;
M_.block_structure_stat.block(13).equation = [ 1];
M_.block_structure_stat.block(13).variable = [ 29];
M_.block_structure_stat.block(14).Simulation_Type = 3;
M_.block_structure_stat.block(14).endo_nbr = 1;
M_.block_structure_stat.block(14).mfs = 1;
M_.block_structure_stat.block(14).equation = [ 2];
M_.block_structure_stat.block(14).variable = [ 31];
M_.block_structure_stat.block(15).Simulation_Type = 3;
M_.block_structure_stat.block(15).endo_nbr = 1;
M_.block_structure_stat.block(15).mfs = 1;
M_.block_structure_stat.block(15).equation = [ 36];
M_.block_structure_stat.block(15).variable = [ 38];
M_.block_structure_stat.block(16).Simulation_Type = 3;
M_.block_structure_stat.block(16).endo_nbr = 1;
M_.block_structure_stat.block(16).mfs = 1;
M_.block_structure_stat.block(16).equation = [ 38];
M_.block_structure_stat.block(16).variable = [ 44];
M_.block_structure_stat.block(17).Simulation_Type = 6;
M_.block_structure_stat.block(17).endo_nbr = 8;
M_.block_structure_stat.block(17).mfs = 8;
M_.block_structure_stat.block(17).equation = [ 12 19 21 20 3 16 9 4];
M_.block_structure_stat.block(17).variable = [ 1 13 14 8 2 15 33 30];
M_.block_structure_stat.block(18).Simulation_Type = 3;
M_.block_structure_stat.block(18).endo_nbr = 1;
M_.block_structure_stat.block(18).mfs = 1;
M_.block_structure_stat.block(18).equation = [ 5];
M_.block_structure_stat.block(18).variable = [ 5];
M_.block_structure_stat.block(19).Simulation_Type = 1;
M_.block_structure_stat.block(19).endo_nbr = 2;
M_.block_structure_stat.block(19).mfs = 2;
M_.block_structure_stat.block(19).equation = [ 35 40];
M_.block_structure_stat.block(19).variable = [ 37 35];
M_.block_structure_stat.block(20).Simulation_Type = 3;
M_.block_structure_stat.block(20).endo_nbr = 1;
M_.block_structure_stat.block(20).mfs = 1;
M_.block_structure_stat.block(20).equation = [ 37];
M_.block_structure_stat.block(20).variable = [ 42];
M_.block_structure_stat.block(21).Simulation_Type = 1;
M_.block_structure_stat.block(21).endo_nbr = 7;
M_.block_structure_stat.block(21).mfs = 7;
M_.block_structure_stat.block(21).equation = [ 41 44 39 24 29 23 22];
M_.block_structure_stat.block(21).variable = [ 36 41 43 22 16 21 20];
M_.block_structure_stat.variable_reordered = [ 28 9 6 7 3 4 10 27 12 11 18 32 17 19 23 25 26 24 34 39 40 29 31 38 44 1 13 14 8 2 15 33 30 5 37 35 42 36 41 43 22 16 21 20];
M_.block_structure_stat.equation_reordered = [ 6 7 8 10 11 13 14 15 17 18 25 26 27 28 30 31 32 33 34 42 43 1 2 36 38 12 19 21 20 3 16 9 4 5 35 40 37 41 44 39 24 29 23 22];
M_.block_structure_stat.incidence.sparse_IM = [
 1 28;
 1 29;
 2 28;
 2 29;
 2 31;
 3 1;
 3 2;
 3 10;
 3 28;
 3 29;
 3 30;
 3 33;
 3 34;
 4 10;
 4 28;
 4 29;
 4 30;
 4 33;
 5 5;
 5 31;
 5 33;
 6 28;
 7 9;
 8 6;
 8 9;
 9 4;
 9 8;
 9 11;
 9 33;
 10 6;
 10 7;
 11 3;
 12 1;
 12 8;
 13 4;
 14 10;
 15 27;
 16 2;
 16 8;
 16 11;
 16 15;
 16 33;
 17 12;
 18 11;
 18 12;
 19 12;
 19 13;
 19 14;
 20 1;
 20 8;
 20 10;
 20 13;
 20 15;
 21 1;
 21 8;
 21 10;
 21 14;
 22 8;
 22 20;
 23 2;
 23 21;
 24 5;
 24 22;
 25 18;
 26 28;
 26 32;
 27 6;
 27 17;
 28 7;
 28 19;
 29 6;
 29 8;
 29 16;
 30 4;
 30 23;
 31 25;
 32 26;
 32 28;
 33 10;
 33 24;
 34 34;
 35 1;
 35 10;
 35 33;
 35 37;
 35 38;
 36 28;
 36 29;
 36 38;
 37 37;
 37 42;
 38 10;
 38 39;
 38 40;
 38 44;
 39 42;
 39 43;
 39 44;
 40 4;
 40 11;
 40 33;
 40 35;
 41 1;
 41 5;
 41 34;
 41 36;
 42 4;
 42 34;
 42 39;
 43 4;
 43 39;
 43 40;
 44 8;
 44 40;
 44 41;
];
M_.block_structure_stat.tmp_nbr = 19;
M_.block_structure_stat.block(1).g1_sparse_rowval = int32([]);
M_.block_structure_stat.block(1).g1_sparse_colval = int32([]);
M_.block_structure_stat.block(1).g1_sparse_colptr = int32([]);
M_.block_structure_stat.block(2).g1_sparse_rowval = int32([1 ]);
M_.block_structure_stat.block(2).g1_sparse_colval = int32([1 ]);
M_.block_structure_stat.block(2).g1_sparse_colptr = int32([1 2 ]);
M_.block_structure_stat.block(3).g1_sparse_rowval = int32([]);
M_.block_structure_stat.block(3).g1_sparse_colval = int32([]);
M_.block_structure_stat.block(3).g1_sparse_colptr = int32([]);
M_.block_structure_stat.block(4).g1_sparse_rowval = int32([1 ]);
M_.block_structure_stat.block(4).g1_sparse_colval = int32([1 ]);
M_.block_structure_stat.block(4).g1_sparse_colptr = int32([1 2 ]);
M_.block_structure_stat.block(5).g1_sparse_rowval = int32([1 ]);
M_.block_structure_stat.block(5).g1_sparse_colval = int32([1 ]);
M_.block_structure_stat.block(5).g1_sparse_colptr = int32([1 2 ]);
M_.block_structure_stat.block(6).g1_sparse_rowval = int32([1 ]);
M_.block_structure_stat.block(6).g1_sparse_colval = int32([1 ]);
M_.block_structure_stat.block(6).g1_sparse_colptr = int32([1 2 ]);
M_.block_structure_stat.block(7).g1_sparse_rowval = int32([1 ]);
M_.block_structure_stat.block(7).g1_sparse_colval = int32([1 ]);
M_.block_structure_stat.block(7).g1_sparse_colptr = int32([1 2 ]);
M_.block_structure_stat.block(8).g1_sparse_rowval = int32([1 ]);
M_.block_structure_stat.block(8).g1_sparse_colval = int32([1 ]);
M_.block_structure_stat.block(8).g1_sparse_colptr = int32([1 2 ]);
M_.block_structure_stat.block(9).g1_sparse_rowval = int32([]);
M_.block_structure_stat.block(9).g1_sparse_colval = int32([]);
M_.block_structure_stat.block(9).g1_sparse_colptr = int32([]);
M_.block_structure_stat.block(10).g1_sparse_rowval = int32([1 ]);
M_.block_structure_stat.block(10).g1_sparse_colval = int32([1 ]);
M_.block_structure_stat.block(10).g1_sparse_colptr = int32([1 2 ]);
M_.block_structure_stat.block(11).g1_sparse_rowval = int32([1 ]);
M_.block_structure_stat.block(11).g1_sparse_colval = int32([1 ]);
M_.block_structure_stat.block(11).g1_sparse_colptr = int32([1 2 ]);
M_.block_structure_stat.block(12).g1_sparse_rowval = int32([]);
M_.block_structure_stat.block(12).g1_sparse_colval = int32([]);
M_.block_structure_stat.block(12).g1_sparse_colptr = int32([]);
M_.block_structure_stat.block(13).g1_sparse_rowval = int32([1 ]);
M_.block_structure_stat.block(13).g1_sparse_colval = int32([1 ]);
M_.block_structure_stat.block(13).g1_sparse_colptr = int32([1 2 ]);
M_.block_structure_stat.block(14).g1_sparse_rowval = int32([1 ]);
M_.block_structure_stat.block(14).g1_sparse_colval = int32([1 ]);
M_.block_structure_stat.block(14).g1_sparse_colptr = int32([1 2 ]);
M_.block_structure_stat.block(15).g1_sparse_rowval = int32([1 ]);
M_.block_structure_stat.block(15).g1_sparse_colval = int32([1 ]);
M_.block_structure_stat.block(15).g1_sparse_colptr = int32([1 2 ]);
M_.block_structure_stat.block(16).g1_sparse_rowval = int32([1 ]);
M_.block_structure_stat.block(16).g1_sparse_colval = int32([1 ]);
M_.block_structure_stat.block(16).g1_sparse_colptr = int32([1 2 ]);
M_.block_structure_stat.block(17).g1_sparse_rowval = int32([1 3 4 5 2 4 2 3 1 3 4 6 7 5 6 4 6 5 6 7 8 5 8 ]);
M_.block_structure_stat.block(17).g1_sparse_colval = int32([1 1 1 1 2 2 3 3 4 4 4 4 4 5 5 6 6 7 7 7 7 8 8 ]);
M_.block_structure_stat.block(17).g1_sparse_colptr = int32([1 5 7 9 14 16 18 22 24 ]);
M_.block_structure_stat.block(18).g1_sparse_rowval = int32([1 ]);
M_.block_structure_stat.block(18).g1_sparse_colval = int32([1 ]);
M_.block_structure_stat.block(18).g1_sparse_colptr = int32([1 2 ]);
M_.block_structure_stat.block(19).g1_sparse_rowval = int32([]);
M_.block_structure_stat.block(19).g1_sparse_colval = int32([]);
M_.block_structure_stat.block(19).g1_sparse_colptr = int32([]);
M_.block_structure_stat.block(20).g1_sparse_rowval = int32([1 ]);
M_.block_structure_stat.block(20).g1_sparse_colval = int32([1 ]);
M_.block_structure_stat.block(20).g1_sparse_colptr = int32([1 2 ]);
M_.block_structure_stat.block(21).g1_sparse_rowval = int32([]);
M_.block_structure_stat.block(21).g1_sparse_colval = int32([]);
M_.block_structure_stat.block(21).g1_sparse_colptr = int32([]);
M_.static_g1_sparse_rowval = int32([3 12 20 21 35 41 3 16 23 11 9 13 30 40 42 43 5 24 41 8 10 27 29 10 28 9 12 16 20 21 22 29 44 7 8 3 4 14 20 21 33 35 38 9 16 18 40 17 18 19 19 20 19 21 16 20 29 27 25 28 22 23 24 30 33 31 32 15 1 2 3 4 6 26 32 36 1 2 3 4 36 3 4 2 5 26 3 4 5 9 16 35 40 3 34 41 42 40 41 35 37 35 36 38 42 43 38 43 44 44 37 39 39 38 39 ]);
M_.static_g1_sparse_colval = int32([1 1 1 1 1 1 2 2 2 3 4 4 4 4 4 4 5 5 5 6 6 6 6 7 7 8 8 8 8 8 8 8 8 9 9 10 10 10 10 10 10 10 10 11 11 11 11 12 12 12 13 13 14 14 15 15 16 17 18 19 20 21 22 23 24 25 26 27 28 28 28 28 28 28 28 28 29 29 29 29 29 30 30 31 31 32 33 33 33 33 33 33 33 34 34 34 34 35 36 37 37 38 38 39 39 39 40 40 40 41 42 42 43 44 44 ]);
M_.static_g1_sparse_colptr = int32([1 7 10 11 17 20 24 26 34 36 44 48 51 53 55 57 58 59 60 61 62 63 64 65 66 67 68 69 77 82 84 86 87 94 98 99 100 102 104 107 110 111 113 114 116 ]);
table_title='Strict targeting';
case_title='Price';
table_title=[table_title,' Calvo'];
M_.params(6) = 1;
siggma = M_.params(6);
M_.params(7) = 5;
varphi = M_.params(7);
M_.params(8) = 1.5;
phi_pi = M_.params(8);
M_.params(9) = 0.125;
phi_y = M_.params(9);
M_.params(12) = 0.75;
theta_p = M_.params(12);
M_.params(4) = 0.5;
rho_nu = M_.params(4);
M_.params(5) = 0.5;
rho_z = M_.params(5);
M_.params(3) = 0.9;
rho_a = M_.params(3);
M_.params(2) = 0.99;
betta = M_.params(2);
M_.params(10) = 3.77;
eta = M_.params(10);
M_.params(1) = 0.25;
alppha = M_.params(1);
M_.params(11) = 9;
epsilon_p = M_.params(11);
M_.params(15) = 4.5;
epsilon_w = M_.params(15);
M_.params(13) = (M_.params(11)-1)/M_.params(11);
tau_s_p = M_.params(13);
M_.params(14) = M_.params(15)/(M_.params(15)-1);
tau_s_w = M_.params(14);
M_.params(19) = 0;
tau_c = M_.params(19);
M_.params(18) = 0;
tau_n_SS = M_.params(18);
M_.params(20) = 0;
rho_tau_n = M_.params(20);
M_.params(16) = 0.75;
theta_w = M_.params(16);
M_.params(23) = 0;
lambda_utility = M_.params(23);
%
% SHOCKS instructions
%
M_.exo_det_length = 0;
M_.Sigma_e(1, 1) = 0.0001;
M_.Sigma_e(2, 2) = 0;
options_.irf = 0;
options_.order = 2;
var_list_ = {'log_Pi';'log_Pi_w';'log_Y_gap';'log_N'};
[info, oo_, options_, M_] = stoch_simul(M_, options_, oo_, var_list_);
pi_p_pos=strmatch('log_Pi',var_list_ ,'exact');
pi_w_pos=strmatch('log_Pi_w',var_list_ ,'exact');
y_gap_pos=strmatch('log_Y_gap',var_list_ ,'exact');
variance.pi_p=oo_.var(pi_p_pos,pi_p_pos);
variance.pi_w=oo_.var(pi_w_pos,pi_w_pos);
variance.y_gap=oo_.var(y_gap_pos,y_gap_pos);
options_old=options_;
options_.nocorr=1;
options_.noprint=1;
lambda_unconditional_technology=csolve('get_consumption_equivalent_unconditional_welfare',0,[],1e-8,1000,M_,oo_,options_)
lambda_conditional_technology=csolve('get_consumption_equivalent_conditional_welfare',lambda_unconditional_technology,[],1e-8,1000,M_,oo_,options_)
options_=options_old;
labels={'sigma(pi_p)';'sigma(pi_w)';'sigma(tilde y)';'L unc';'L cond'};
headers={'Technology shocks';case_title};
values_technology=[sqrt([variance.pi_p;variance.pi_w;variance.y_gap]);lambda_unconditional_technology;lambda_conditional_technology];
options_.noprint=0;
dyntable(options_,table_title,headers,labels,100*values_technology,size(labels,2)+2,4,3)
%
% SHOCKS instructions
%
M_.exo_det_length = 0;
M_.Sigma_e(1, 1) = 0;
M_.Sigma_e(2, 2) = 0.0001;
options_.irf = 0;
options_.order = 2;
var_list_ = {'log_Pi';'log_Pi_w';'log_Y_gap';'log_N';'log_y'};
[info, oo_, options_, M_] = stoch_simul(M_, options_, oo_, var_list_);
pi_p_pos=strmatch('log_Pi',var_list_ ,'exact');
pi_w_pos=strmatch('log_Pi_w',var_list_ ,'exact');
y_gap_pos=strmatch('log_Y_gap',var_list_ ,'exact');
variance.pi_p=oo_.var(pi_p_pos,pi_p_pos);
variance.pi_w=oo_.var(pi_w_pos,pi_w_pos);
variance.y_gap=oo_.var(y_gap_pos,y_gap_pos);
options_old=options_;
options_.nocorr=1;
options_.noprint=1;
lambda_unconditional_demand=csolve('get_consumption_equivalent_unconditional_welfare',0,[],1e-8,1000,M_,oo_,options_)
lambda_conditional_demand=csolve('get_consumption_equivalent_conditional_welfare',lambda_unconditional_demand,[],1e-8,1000,M_,oo_,options_)
options_=options_old;
labels={'sigma(pi_p)';'sigma(pi_w)';'sigma(tilde y)';'L unc';'L cond'};
headers={'Demand shocks   ';case_title};
values_demand=[sqrt([variance.pi_p;variance.pi_w;variance.y_gap]);lambda_unconditional_demand;lambda_conditional_demand];
options_.noprint=0;
dyntable(options_,table_title,headers,labels,100*values_demand,size(labels,2)+2,5,4)      
/Observable Variables
options_.datafile = 'welfare';
options_.order = 1;
var_list_ = {};
oo_recursive_=dynare_estimation(var_list_);
options_.order = 2;
var_list_ = {};
[info, oo_, options_, M_] = stoch_simul(M_, options_, oo_, var_list_);


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 'Born_Pfeifer_2018_welfare_results.mat'], 'oo_', 'M_', 'options_');
if exist('estim_params_', 'var') == 1
  save([M_.dname filesep 'Output' filesep 'Born_Pfeifer_2018_welfare_results.mat'], 'estim_params_', '-append');
end
if exist('bayestopt_', 'var') == 1
  save([M_.dname filesep 'Output' filesep 'Born_Pfeifer_2018_welfare_results.mat'], 'bayestopt_', '-append');
end
if exist('dataset_', 'var') == 1
  save([M_.dname filesep 'Output' filesep 'Born_Pfeifer_2018_welfare_results.mat'], 'dataset_', '-append');
end
if exist('estimation_info', 'var') == 1
  save([M_.dname filesep 'Output' filesep 'Born_Pfeifer_2018_welfare_results.mat'], 'estimation_info', '-append');
end
if exist('dataset_info', 'var') == 1
  save([M_.dname filesep 'Output' filesep 'Born_Pfeifer_2018_welfare_results.mat'], 'dataset_info', '-append');
end
if exist('oo_recursive_', 'var') == 1
  save([M_.dname filesep 'Output' filesep 'Born_Pfeifer_2018_welfare_results.mat'], 'oo_recursive_', '-append');
end
if exist('options_mom_', 'var') == 1
  save([M_.dname filesep 'Output' filesep 'Born_Pfeifer_2018_welfare_results.mat'], 'options_mom_', '-append');
end
if ~isempty(lastwarn)
  disp('Note: warning(s) encountered in MATLAB/Octave code')
end
