%
% 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 = 'NK_financial';
M_.dynare_version = '4.6.1';
oo_.dynare_version = '4.6.1';
options_.dynare_version = '4.6.1';
%
% Some global variables initialization
%
global_initialization;
diary off;
diary('NK_financial.log');
M_.exo_names = cell(7,1);
M_.exo_names_tex = cell(7,1);
M_.exo_names_long = cell(7,1);
M_.exo_names(1) = {'epsA'};
M_.exo_names_tex(1) = {'epsA'};
M_.exo_names_long(1) = {'epsA'};
M_.exo_names(2) = {'epsG'};
M_.exo_names_tex(2) = {'epsG'};
M_.exo_names_long(2) = {'epsG'};
M_.exo_names(3) = {'epsMCS'};
M_.exo_names_tex(3) = {'epsMCS'};
M_.exo_names_long(3) = {'epsMCS'};
M_.exo_names(4) = {'epsMPS'};
M_.exo_names_tex(4) = {'epsMPS'};
M_.exo_names_long(4) = {'epsMPS'};
M_.exo_names(5) = {'epsIS'};
M_.exo_names_tex(5) = {'epsIS'};
M_.exo_names_long(5) = {'epsIS'};
M_.exo_names(6) = {'epsMRSS'};
M_.exo_names_tex(6) = {'epsMRSS'};
M_.exo_names_long(6) = {'epsMRSS'};
M_.exo_names(7) = {'epsRPS'};
M_.exo_names_tex(7) = {'epsRPS'};
M_.exo_names_long(7) = {'epsRPS'};
M_.endo_names = cell(51,1);
M_.endo_names_tex = cell(51,1);
M_.endo_names_long = cell(51,1);
M_.endo_names(1) = {'V'};
M_.endo_names_tex(1) = {'V'};
M_.endo_names_long(1) = {'V'};
M_.endo_names(2) = {'Vmodified'};
M_.endo_names_tex(2) = {'Vmodified'};
M_.endo_names_long(2) = {'Vmodified'};
M_.endo_names(3) = {'U'};
M_.endo_names_tex(3) = {'U'};
M_.endo_names_long(3) = {'U'};
M_.endo_names(4) = {'C'};
M_.endo_names_tex(4) = {'C'};
M_.endo_names_long(4) = {'C'};
M_.endo_names(5) = {'H'};
M_.endo_names_tex(5) = {'H'};
M_.endo_names_long(5) = {'H'};
M_.endo_names(6) = {'K'};
M_.endo_names_tex(6) = {'K'};
M_.endo_names_long(6) = {'K'};
M_.endo_names(7) = {'S'};
M_.endo_names_tex(7) = {'S'};
M_.endo_names_long(7) = {'S'};
M_.endo_names(8) = {'X'};
M_.endo_names_tex(8) = {'X'};
M_.endo_names_long(8) = {'X'};
M_.endo_names(9) = {'I'};
M_.endo_names_tex(9) = {'I'};
M_.endo_names_long(9) = {'I'};
M_.endo_names(10) = {'IS'};
M_.endo_names_tex(10) = {'IS'};
M_.endo_names_long(10) = {'IS'};
M_.endo_names(11) = {'Sdash'};
M_.endo_names_tex(11) = {'Sdash'};
M_.endo_names_long(11) = {'Sdash'};
M_.endo_names(12) = {'lambda'};
M_.endo_names_tex(12) = {'lambda'};
M_.endo_names_long(12) = {'lambda'};
M_.endo_names(13) = {'Wh'};
M_.endo_names_tex(13) = {'Wh'};
M_.endo_names_long(13) = {'Wh'};
M_.endo_names(14) = {'rK'};
M_.endo_names_tex(14) = {'rK'};
M_.endo_names_long(14) = {'rK'};
M_.endo_names(15) = {'RPS'};
M_.endo_names_tex(15) = {'RPS'};
M_.endo_names_long(15) = {'RPS'};
M_.endo_names(16) = {'R'};
M_.endo_names_tex(16) = {'R'};
M_.endo_names_long(16) = {'R'};
M_.endo_names(17) = {'Q'};
M_.endo_names_tex(17) = {'Q'};
M_.endo_names_long(17) = {'Q'};
M_.endo_names(18) = {'Rn'};
M_.endo_names_tex(18) = {'Rn'};
M_.endo_names_long(18) = {'Rn'};
M_.endo_names(19) = {'PIE'};
M_.endo_names_tex(19) = {'PIE'};
M_.endo_names_long(19) = {'PIE'};
M_.endo_names(20) = {'PIEw'};
M_.endo_names_tex(20) = {'PIEw'};
M_.endo_names_long(20) = {'PIEw'};
M_.endo_names(21) = {'W'};
M_.endo_names_tex(21) = {'W'};
M_.endo_names_long(21) = {'W'};
M_.endo_names(22) = {'Jw'};
M_.endo_names_tex(22) = {'Jw'};
M_.endo_names_long(22) = {'Jw'};
M_.endo_names(23) = {'Hd'};
M_.endo_names_tex(23) = {'Hd'};
M_.endo_names_long(23) = {'Hd'};
M_.endo_names(24) = {'MRSS'};
M_.endo_names_tex(24) = {'MRSS'};
M_.endo_names_long(24) = {'MRSS'};
M_.endo_names(25) = {'JJw'};
M_.endo_names_tex(25) = {'JJw'};
M_.endo_names_long(25) = {'JJw'};
M_.endo_names(26) = {'WO'};
M_.endo_names_tex(26) = {'WO'};
M_.endo_names_long(26) = {'WO'};
M_.endo_names(27) = {'Deltaw'};
M_.endo_names_tex(27) = {'Deltaw'};
M_.endo_names_long(27) = {'Deltaw'};
M_.endo_names(28) = {'YW'};
M_.endo_names_tex(28) = {'YW'};
M_.endo_names_long(28) = {'YW'};
M_.endo_names(29) = {'A'};
M_.endo_names_tex(29) = {'A'};
M_.endo_names_long(29) = {'A'};
M_.endo_names(30) = {'PWP'};
M_.endo_names_tex(30) = {'PWP'};
M_.endo_names_long(30) = {'PWP'};
M_.endo_names(31) = {'MC'};
M_.endo_names_tex(31) = {'MC'};
M_.endo_names_long(31) = {'MC'};
M_.endo_names(32) = {'Jp'};
M_.endo_names_tex(32) = {'Jp'};
M_.endo_names_long(32) = {'Jp'};
M_.endo_names(33) = {'Y'};
M_.endo_names_tex(33) = {'Y'};
M_.endo_names_long(33) = {'Y'};
M_.endo_names(34) = {'MCS'};
M_.endo_names_tex(34) = {'MCS'};
M_.endo_names_long(34) = {'MCS'};
M_.endo_names(35) = {'JJp'};
M_.endo_names_tex(35) = {'JJp'};
M_.endo_names_long(35) = {'JJp'};
M_.endo_names(36) = {'PO'};
M_.endo_names_tex(36) = {'PO'};
M_.endo_names_long(36) = {'PO'};
M_.endo_names(37) = {'Deltap'};
M_.endo_names_tex(37) = {'Deltap'};
M_.endo_names_long(37) = {'Deltap'};
M_.endo_names(38) = {'MPS'};
M_.endo_names_tex(38) = {'MPS'};
M_.endo_names_long(38) = {'MPS'};
M_.endo_names(39) = {'G'};
M_.endo_names_tex(39) = {'G'};
M_.endo_names_long(39) = {'G'};
M_.endo_names(40) = {'RK'};
M_.endo_names_tex(40) = {'RK'};
M_.endo_names_long(40) = {'RK'};
M_.endo_names(41) = {'spread'};
M_.endo_names_tex(41) = {'spread'};
M_.endo_names_long(41) = {'spread'};
M_.endo_names(42) = {'CEquiv'};
M_.endo_names_tex(42) = {'CEquiv'};
M_.endo_names_long(42) = {'CEquiv'};
M_.endo_names(43) = {'dyobs'};
M_.endo_names_tex(43) = {'dyobs'};
M_.endo_names_long(43) = {'dyobs'};
M_.endo_names(44) = {'dcobs'};
M_.endo_names_tex(44) = {'dcobs'};
M_.endo_names_long(44) = {'dcobs'};
M_.endo_names(45) = {'pinfobs'};
M_.endo_names_tex(45) = {'pinfobs'};
M_.endo_names_long(45) = {'pinfobs'};
M_.endo_names(46) = {'robs'};
M_.endo_names_tex(46) = {'robs'};
M_.endo_names_long(46) = {'robs'};
M_.endo_names(47) = {'labobs'};
M_.endo_names_tex(47) = {'labobs'};
M_.endo_names_long(47) = {'labobs'};
M_.endo_names(48) = {'spreadobs'};
M_.endo_names_tex(48) = {'spreadobs'};
M_.endo_names_long(48) = {'spreadobs'};
M_.endo_names(49) = {'dinvobs'};
M_.endo_names_tex(49) = {'dinvobs'};
M_.endo_names_long(49) = {'dinvobs'};
M_.endo_names(50) = {'dwobs'};
M_.endo_names_tex(50) = {'dwobs'};
M_.endo_names_long(50) = {'dwobs'};
M_.endo_names(51) = {'UH'};
M_.endo_names_tex(51) = {'UH'};
M_.endo_names_long(51) = {'UH'};
M_.endo_partitions = struct();
M_.param_names = cell(29,1);
M_.param_names_tex = cell(29,1);
M_.param_names_long = cell(29,1);
M_.param_names(1) = {'gy'};
M_.param_names_tex(1) = {'gy'};
M_.param_names_long(1) = {'gy'};
M_.param_names(2) = {'alp'};
M_.param_names_tex(2) = {'alp'};
M_.param_names_long(2) = {'alp'};
M_.param_names(3) = {'delta'};
M_.param_names_tex(3) = {'delta'};
M_.param_names_long(3) = {'delta'};
M_.param_names(4) = {'zzetap'};
M_.param_names_tex(4) = {'zzetap'};
M_.param_names_long(4) = {'zzetap'};
M_.param_names(5) = {'zzetaw'};
M_.param_names_tex(5) = {'zzetaw'};
M_.param_names_long(5) = {'zzetaw'};
M_.param_names(6) = {'sigma_c'};
M_.param_names_tex(6) = {'sigma\_c'};
M_.param_names_long(6) = {'sigma_c'};
M_.param_names(7) = {'chi'};
M_.param_names_tex(7) = {'chi'};
M_.param_names_long(7) = {'chi'};
M_.param_names(8) = {'phiX'};
M_.param_names_tex(8) = {'phiX'};
M_.param_names_long(8) = {'phiX'};
M_.param_names(9) = {'xip'};
M_.param_names_tex(9) = {'xip'};
M_.param_names_long(9) = {'xip'};
M_.param_names(10) = {'xiw'};
M_.param_names_tex(10) = {'xiw'};
M_.param_names_long(10) = {'xiw'};
M_.param_names(11) = {'gammap'};
M_.param_names_tex(11) = {'gammap'};
M_.param_names_long(11) = {'gammap'};
M_.param_names(12) = {'gammaw'};
M_.param_names_tex(12) = {'gammaw'};
M_.param_names_long(12) = {'gammaw'};
M_.param_names(13) = {'PIE_bar'};
M_.param_names_tex(13) = {'PIE\_bar'};
M_.param_names_long(13) = {'PIE_bar'};
M_.param_names(14) = {'g_bar'};
M_.param_names_tex(14) = {'g\_bar'};
M_.param_names_long(14) = {'g_bar'};
M_.param_names(15) = {'Rn_bar'};
M_.param_names_tex(15) = {'Rn\_bar'};
M_.param_names_long(15) = {'Rn_bar'};
M_.param_names(16) = {'rho_r'};
M_.param_names_tex(16) = {'rho\_r'};
M_.param_names_long(16) = {'rho_r'};
M_.param_names(17) = {'theta_pie'};
M_.param_names_tex(17) = {'theta\_pie'};
M_.param_names_long(17) = {'theta_pie'};
M_.param_names(18) = {'theta_y'};
M_.param_names_tex(18) = {'theta\_y'};
M_.param_names_long(18) = {'theta_y'};
M_.param_names(19) = {'theta_dy'};
M_.param_names_tex(19) = {'theta\_dy'};
M_.param_names_long(19) = {'theta_dy'};
M_.param_names(20) = {'rhoA'};
M_.param_names_tex(20) = {'rhoA'};
M_.param_names_long(20) = {'rhoA'};
M_.param_names(21) = {'rhoG'};
M_.param_names_tex(21) = {'rhoG'};
M_.param_names_long(21) = {'rhoG'};
M_.param_names(22) = {'rhoMCS'};
M_.param_names_tex(22) = {'rhoMCS'};
M_.param_names_long(22) = {'rhoMCS'};
M_.param_names(23) = {'rhoMRSS'};
M_.param_names_tex(23) = {'rhoMRSS'};
M_.param_names_long(23) = {'rhoMRSS'};
M_.param_names(24) = {'rhoMPS'};
M_.param_names_tex(24) = {'rhoMPS'};
M_.param_names_long(24) = {'rhoMPS'};
M_.param_names(25) = {'rhoRPS'};
M_.param_names_tex(25) = {'rhoRPS'};
M_.param_names_long(25) = {'rhoRPS'};
M_.param_names(26) = {'rhoIS'};
M_.param_names_tex(26) = {'rhoIS'};
M_.param_names_long(26) = {'rhoIS'};
M_.param_names(27) = {'sigma_s'};
M_.param_names_tex(27) = {'sigma\_s'};
M_.param_names_long(27) = {'sigma_s'};
M_.param_names(28) = {'wr'};
M_.param_names_tex(28) = {'wr'};
M_.param_names_long(28) = {'wr'};
M_.param_names(29) = {'psi'};
M_.param_names_tex(29) = {'psi'};
M_.param_names_long(29) = {'psi'};
M_.param_partitions = struct();
M_.exo_det_nbr = 0;
M_.exo_nbr = 7;
M_.endo_nbr = 51;
M_.param_nbr = 29;
M_.orig_endo_nbr = 51;
M_.aux_vars = [];
options_.varobs = cell(7, 1);
options_.varobs(1)  = {'dyobs'};
options_.varobs(2)  = {'dcobs'};
options_.varobs(3)  = {'dinvobs'};
options_.varobs(4)  = {'dwobs'};
options_.varobs(5)  = {'robs'};
options_.varobs(6)  = {'pinfobs'};
options_.varobs(7)  = {'labobs'};
options_.varobs_id = [ 43 44 49 50 46 45 47  ];
M_.Sigma_e = zeros(7, 7);
M_.Correlation_matrix = eye(7, 7);
M_.H = 0;
M_.Correlation_matrix_ME = 1;
M_.sigma_e_is_diagonal = true;
M_.det_shocks = [];
options_.linear = false;
options_.block = false;
options_.bytecode = false;
options_.use_dll = false;
options_.linear_decomposition = false;
M_.nonzero_hessian_eqs = [3 4 5 6 7 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26 27 28 29 30 31 33 34 35 37 38 39 40 41 42 43 44 45 46 47 50];
M_.hessian_eq_zero = isempty(M_.nonzero_hessian_eqs);
M_.orig_eq_nbr = 51;
M_.eq_nbr = 51;
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 = 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 18 69;
 0 19 70;
 0 20 71;
 1 21 72;
 0 22 0;
 2 23 0;
 0 24 0;
 0 25 73;
 3 26 0;
 4 27 74;
 0 28 75;
 0 29 76;
 0 30 0;
 0 31 77;
 5 32 0;
 0 33 78;
 6 34 79;
 7 35 0;
 8 36 80;
 0 37 81;
 9 38 0;
 0 39 82;
 0 40 0;
 10 41 0;
 0 42 83;
 0 43 0;
 11 44 0;
 0 45 0;
 12 46 0;
 0 47 0;
 0 48 0;
 0 49 84;
 13 50 0;
 14 51 0;
 0 52 85;
 0 53 0;
 15 54 0;
 16 55 0;
 17 56 0;
 0 57 0;
 0 58 0;
 0 59 86;
 0 60 0;
 0 61 0;
 0 62 0;
 0 63 0;
 0 64 0;
 0 65 0;
 0 66 0;
 0 67 0;
 0 68 0;]';
M_.nstatic = 20;
M_.nfwrd   = 14;
M_.npred   = 13;
M_.nboth   = 4;
M_.nsfwrd   = 18;
M_.nspred   = 17;
M_.ndynamic   = 31;
M_.dynamic_tmp_nbr = [47; 53; 8; 0; ];
M_.equations_tags = {
  1 , 'name' , '(226) Consumption equivalent variation' ;
  2 , 'name' , '(185) Intertemporal welfare' ;
  3 , 'name' , '(185b) Modified intertemporal welfare' ;
  4 , 'name' , '(186) Flow utility' ;
  5 , 'name' , '(187) Law of motion for capital' ;
  6 , 'name' , '(188) Investment' ;
  7 , 'name' , '(189) Capital adjustment cost' ;
  8 , 'name' , '(190) Capital adjustment cost' ;
  9 , 'name' , '(191) MUC' ;
  10 , 'name' , '(192) Household foc for hours' ;
  11 , 'name' , '(193) Euler equation' ;
  12 , 'name' , '(194) Household foc for capital' ;
  13 , 'name' , '(195) Household foc for investment' ;
  14 , 'name' , '(197) Fischer equation' ;
  15 , 'name' , 'UH' ;
  16 , 'name' , '(198) Wage inflation' ;
  17 , 'name' , '(199) Wage setting condition I' ;
  18 , 'name' , '(200) Wage setting condition II' ;
  19 , 'name' , '(201) Wage setting condition III' ;
  20 , 'name' , '(202) Law of motion for wage level' ;
  21 , 'name' , '(203) Law of motion for wage dispersion' ;
  22 , 'name' , '(204) Production function' ;
  23 , 'name' , '(205) Firm for for labour' ;
  24 , 'name' , '(206) Firm foc: return on capital' ;
  25 , 'name' , '(207) Marginal cost' ;
  26 , 'name' , '(208) Price setting condition' ;
  27 , 'name' , '(209) Price setting condition' ;
  28 , 'name' , '(210) Price setting condition' ;
  29 , 'name' , '(211) Law of motion for price level' ;
  30 , 'name' , '(212) Law of motion for price dispersion' ;
  31 , 'name' , '(213) Taylor rule' ;
  32 , 'name' , '(214) Resource constraint' ;
  33 , 'name' , '(215) Market clearing for labour)' ;
  34 , 'name' , '(216) Market clearing for goods' ;
  35 , 'name' , '(217) Gross real return on capital' ;
  36 , 'name' , '(218)' ;
  37 , 'name' , '(219) Law of motion for productivity' ;
  38 , 'name' , '(220) Law of motion for government expenditure' ;
  39 , 'name' , '(221) Law of motion for price markup shock' ;
  40 , 'name' , '(232) Law of motion for wage markup shock' ;
  41 , 'name' , '(233) Law of motion for capital quality shock' ;
  42 , 'name' , '(234) Law of motion for monetary policy shock' ;
  43 , 'name' , '(235) Law of motion for risk premium shock' ;
  44 , 'name' , '(264) Measurement equation for output growth' ;
  45 , 'name' , '(265) Measurement equation for consumption growth' ;
  46 , 'name' , '(266) Measurement equation for investment growth' ;
  47 , 'name' , '(267) Measurement equation for real wage growth' ;
  48 , 'name' , '(268) Measurement equation for hours' ;
  49 , 'name' , '(269) Measurement equation for policy rate' ;
  50 , 'name' , '(270) Measurement equation for inflation' ;
  51 , 'name' , '(271) Measurement equation for spread' ;
};
M_.mapping.V.eqidx = [2 ];
M_.mapping.Vmodified.eqidx = [3 ];
M_.mapping.U.eqidx = [1 2 3 4 9 15 ];
M_.mapping.C.eqidx = [4 9 32 45 ];
M_.mapping.H.eqidx = [4 15 33 ];
M_.mapping.K.eqidx = [5 22 24 ];
M_.mapping.S.eqidx = [5 7 13 ];
M_.mapping.X.eqidx = [6 7 8 13 ];
M_.mapping.I.eqidx = [5 6 32 46 ];
M_.mapping.IS.eqidx = [5 13 41 ];
M_.mapping.Sdash.eqidx = [8 13 ];
M_.mapping.lambda.eqidx = [9 10 11 12 13 17 18 26 27 ];
M_.mapping.Wh.eqidx = [10 17 ];
M_.mapping.rK.eqidx = [12 24 35 ];
M_.mapping.RPS.eqidx = [11 43 ];
M_.mapping.R.eqidx = [11 14 36 ];
M_.mapping.Q.eqidx = [12 13 35 ];
M_.mapping.Rn.eqidx = [3 14 31 49 ];
M_.mapping.PIE.eqidx = [14 16 17 18 20 21 26 27 29 30 31 50 ];
M_.mapping.PIEw.eqidx = [16 17 18 20 21 ];
M_.mapping.W.eqidx = [16 19 23 47 ];
M_.mapping.Jw.eqidx = [17 19 ];
M_.mapping.Hd.eqidx = [17 18 22 23 33 48 ];
M_.mapping.MRSS.eqidx = [17 40 ];
M_.mapping.JJw.eqidx = [18 19 ];
M_.mapping.WO.eqidx = [19 20 21 ];
M_.mapping.Deltaw.eqidx = [21 33 ];
M_.mapping.YW.eqidx = [22 23 24 34 ];
M_.mapping.A.eqidx = [22 37 ];
M_.mapping.PWP.eqidx = [23 24 25 ];
M_.mapping.MC.eqidx = [25 26 ];
M_.mapping.Jp.eqidx = [26 28 ];
M_.mapping.Y.eqidx = [26 27 31 32 34 44 ];
M_.mapping.MCS.eqidx = [26 39 ];
M_.mapping.JJp.eqidx = [27 28 ];
M_.mapping.PO.eqidx = [28 29 30 ];
M_.mapping.Deltap.eqidx = [30 34 ];
M_.mapping.MPS.eqidx = [31 42 ];
M_.mapping.G.eqidx = [32 38 ];
M_.mapping.RK.eqidx = [35 36 ];
M_.mapping.spread.eqidx = [36 51 ];
M_.mapping.CEquiv.eqidx = [1 ];
M_.mapping.dyobs.eqidx = [44 ];
M_.mapping.dcobs.eqidx = [45 ];
M_.mapping.pinfobs.eqidx = [50 ];
M_.mapping.robs.eqidx = [49 ];
M_.mapping.labobs.eqidx = [48 ];
M_.mapping.spreadobs.eqidx = [51 ];
M_.mapping.dinvobs.eqidx = [46 ];
M_.mapping.dwobs.eqidx = [47 ];
M_.mapping.UH.eqidx = [10 15 ];
M_.mapping.epsA.eqidx = [37 ];
M_.mapping.epsG.eqidx = [38 ];
M_.mapping.epsMCS.eqidx = [39 ];
M_.mapping.epsMPS.eqidx = [42 ];
M_.mapping.epsIS.eqidx = [41 ];
M_.mapping.epsMRSS.eqidx = [40 ];
M_.mapping.epsRPS.eqidx = [43 ];
M_.static_and_dynamic_models_differ = false;
M_.has_external_function = false;
M_.state_var = [4 6 9 10 15 17 18 19 21 24 27 29 33 34 37 38 39 ];
M_.exo_names_orig_ord = [1:7];
M_.maximum_lag = 1;
M_.maximum_lead = 1;
M_.maximum_endo_lag = 1;
M_.maximum_endo_lead = 1;
oo_.steady_state = zeros(51, 1);
M_.maximum_exo_lag = 0;
M_.maximum_exo_lead = 0;
oo_.exo_steady_state = zeros(7, 1);
M_.params = NaN(29, 1);
M_.endo_trends = struct('deflator', cell(51, 1), 'log_deflator', cell(51, 1), 'growth_factor', cell(51, 1), 'log_growth_factor', cell(51, 1));
M_.NNZDerivatives = [199; 348; -1; ];
M_.static_tmp_nbr = [27; 13; 0; 0; ];
M_.params(1) = 0.18;
gy = M_.params(1);
M_.params(2) = 0.67;
alp = M_.params(2);
M_.params(3) = 0.0250;
delta = M_.params(3);
M_.params(4) = 7.0;
zzetap = M_.params(4);
M_.params(5) = 3.0;
zzetaw = M_.params(5);
M_.params(13) = 0.8662984461054001;
PIE_bar = M_.params(13);
M_.params(14) = 0.3550693291143;
g_bar = M_.params(14);
M_.params(15) = 1.3318469551282;
Rn_bar = M_.params(15);
M_.params(6) = 1.5;
sigma_c = M_.params(6);
M_.params(7) = 0.7;
chi = M_.params(7);
M_.params(8) = 2.0;
phiX = M_.params(8);
M_.params(9) = 0.7;
xip = M_.params(9);
M_.params(10) = 0.7;
xiw = M_.params(10);
M_.params(11) = 0.5;
gammap = M_.params(11);
M_.params(12) = 0.5;
gammaw = M_.params(12);
M_.params(29) = 2;
psi = M_.params(29);
M_.params(16) = 0.7;
rho_r = M_.params(16);
M_.params(17) = 1.5;
theta_pie = M_.params(17);
M_.params(18) = 0.3;
theta_y = M_.params(18);
M_.params(19) = 0.3;
theta_dy = M_.params(19);
M_.params(20) = 0.7;
rhoA = M_.params(20);
M_.params(21) = 0.7;
rhoG = M_.params(21);
M_.params(22) = 0.7;
rhoMCS = M_.params(22);
M_.params(23) = 0.7;
rhoMRSS = M_.params(23);
M_.params(24) = 0.7;
rhoMPS = M_.params(24);
M_.params(25) = 0.7;
rhoRPS = M_.params(25);
M_.params(26) = 0.7;
rhoIS = M_.params(26);
M_.params(27) = 0.01;
sigma_s = M_.params(27);
M_.params(28) = 0.0;
wr = M_.params(28);
%
% SHOCKS instructions
%
M_.exo_det_length = 0;
M_.Sigma_e(1, 1) = (M_.params(27))^2;
M_.Sigma_e(2, 2) = (M_.params(27))^2;
M_.Sigma_e(3, 3) = (M_.params(27))^2;
M_.Sigma_e(4, 4) = (M_.params(27))^2;
M_.Sigma_e(5, 5) = (M_.params(27))^2;
M_.Sigma_e(6, 6) = (M_.params(27))^2;
M_.Sigma_e(7, 7) = (M_.params(27))^2;
oo_.dr.eigval = check(M_,options_,oo_);
steady;
estim_params_.var_exo = zeros(0, 10);
estim_params_.var_endo = zeros(0, 10);
estim_params_.corrx = zeros(0, 11);
estim_params_.corrn = zeros(0, 11);
estim_params_.param_vals = zeros(0, 10);
estim_params_.param_vals = [estim_params_.param_vals; 6, NaN, (-Inf), Inf, 3, 1.50, 0.375, NaN, NaN, NaN ];
estim_params_.param_vals = [estim_params_.param_vals; 29, NaN, (-Inf), Inf, 3, 2.00, 0.75, NaN, NaN, NaN ];
estim_params_.param_vals = [estim_params_.param_vals; 7, NaN, (-Inf), Inf, 1, 0.50, 0.10, NaN, NaN, NaN ];
estim_params_.param_vals = [estim_params_.param_vals; 8, NaN, (-Inf), Inf, 3, 2.00, 0.75, NaN, NaN, NaN ];
estim_params_.param_vals = [estim_params_.param_vals; 9, NaN, (-Inf), Inf, 1, 0.50, 0.10, NaN, NaN, NaN ];
estim_params_.param_vals = [estim_params_.param_vals; 10, NaN, (-Inf), Inf, 1, 0.50, 0.10, NaN, NaN, NaN ];
estim_params_.param_vals = [estim_params_.param_vals; 11, NaN, (-Inf), Inf, 1, 0.50, 0.10, NaN, NaN, NaN ];
estim_params_.param_vals = [estim_params_.param_vals; 12, NaN, (-Inf), Inf, 1, 0.50, 0.10, NaN, NaN, NaN ];
estim_params_.param_vals = [estim_params_.param_vals; 13, NaN, (-Inf), Inf, 3, 1.0, 0.50, NaN, NaN, NaN ];
estim_params_.param_vals = [estim_params_.param_vals; 14, NaN, (-Inf), Inf, 3, 0.4, 0.50, NaN, NaN, NaN ];
estim_params_.param_vals = [estim_params_.param_vals; 15, NaN, (-Inf), Inf, 3, 1.6, 0.50, NaN, NaN, NaN ];
estim_params_.param_vals = [estim_params_.param_vals; 16, NaN, (-Inf), Inf, 1, 0.75, 0.10, NaN, NaN, NaN ];
estim_params_.param_vals = [estim_params_.param_vals; 17, NaN, (-Inf), Inf, 3, 1.50, 0.25, NaN, NaN, NaN ];
estim_params_.param_vals = [estim_params_.param_vals; 18, NaN, (-Inf), Inf, 3, 0.12, 0.05, NaN, NaN, NaN ];
estim_params_.param_vals = [estim_params_.param_vals; 19, NaN, (-Inf), Inf, 3, 0.12, 0.05, NaN, NaN, NaN ];
estim_params_.param_vals = [estim_params_.param_vals; 20, NaN, (-Inf), Inf, 1, 0.50, 0.20, NaN, NaN, NaN ];
estim_params_.param_vals = [estim_params_.param_vals; 21, NaN, (-Inf), Inf, 1, 0.50, 0.20, NaN, NaN, NaN ];
estim_params_.param_vals = [estim_params_.param_vals; 22, NaN, (-Inf), Inf, 1, 0.50, 0.20, NaN, NaN, NaN ];
estim_params_.param_vals = [estim_params_.param_vals; 23, NaN, (-Inf), Inf, 1, 0.50, 0.20, NaN, NaN, NaN ];
estim_params_.param_vals = [estim_params_.param_vals; 24, NaN, (-Inf), Inf, 1, 0.50, 0.20, NaN, NaN, NaN ];
estim_params_.param_vals = [estim_params_.param_vals; 25, NaN, (-Inf), Inf, 1, 0.50, 0.20, NaN, NaN, NaN ];
estim_params_.param_vals = [estim_params_.param_vals; 26, NaN, (-Inf), Inf, 1, 0.50, 0.20, NaN, NaN, NaN ];
estim_params_.var_exo = [estim_params_.var_exo; 1, NaN, (-Inf), Inf, 4, 0.001, 0.020, NaN, NaN, NaN ];
estim_params_.var_exo = [estim_params_.var_exo; 2, NaN, (-Inf), Inf, 4, 0.001, 0.020, NaN, NaN, NaN ];
estim_params_.var_exo = [estim_params_.var_exo; 3, NaN, (-Inf), Inf, 4, 0.001, 0.020, NaN, NaN, NaN ];
estim_params_.var_exo = [estim_params_.var_exo; 6, NaN, (-Inf), Inf, 4, 0.001, 0.020, NaN, NaN, NaN ];
estim_params_.var_exo = [estim_params_.var_exo; 4, NaN, (-Inf), Inf, 4, 0.001, 0.020, NaN, NaN, NaN ];
estim_params_.var_exo = [estim_params_.var_exo; 7, NaN, (-Inf), Inf, 4, 0.001, 0.020, NaN, NaN, NaN ];
estim_params_.var_exo = [estim_params_.var_exo; 5, NaN, (-Inf), Inf, 4, 0.001, 0.020, NaN, NaN, NaN ];
options_.lik_init = 1;
options_.mh_drop = 0.25;
options_.mh_jscale = 0.4;
options_.mh_nblck = 2;
options_.mh_replic = 5000;
options_.mode_check.status = true;
options_.mode_compute = 4;
options_.plot_priors = 0;
options_.prefilter = 0;
options_.presample = 0;
options_.datafile = 'usdata_47q1_17q4_unscaled';
options_.first_obs = 75;
options_.nobs = 208;
options_.order = 1;
var_list_ = {};
oo_recursive_=dynare_estimation(var_list_);
options_.ar = 10;
options_.irf = 20;
options_.nograph = true;
var_list_ = {};
[info, oo_, options_, M_] = stoch_simul(M_, options_, oo_, var_list_);
save('NK_financial_results.mat', 'oo_', 'M_', 'options_');
if exist('estim_params_', 'var') == 1
  save('NK_financial_results.mat', 'estim_params_', '-append');
end
if exist('bayestopt_', 'var') == 1
  save('NK_financial_results.mat', 'bayestopt_', '-append');
end
if exist('dataset_', 'var') == 1
  save('NK_financial_results.mat', 'dataset_', '-append');
end
if exist('estimation_info', 'var') == 1
  save('NK_financial_results.mat', 'estimation_info', '-append');
end
if exist('dataset_info', 'var') == 1
  save('NK_financial_results.mat', 'dataset_info', '-append');
end
if exist('oo_recursive_', 'var') == 1
  save('NK_financial_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
