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

clear all
clear global
tic;
global M_ oo_ options_ ys0_ ex0_ estimation_info
options_ = [];
M_.fname = 'model_cs';
%
% Some global variables initialization
%
global_initialization;
diary off;
logname_ = 'model_cs.log';
if exist(logname_, 'file')
    delete(logname_)
end
diary(logname_)
M_.exo_names = 'kl1';
M_.exo_names_tex = 'kl1';
M_.exo_names = char(M_.exo_names, 'kl2');
M_.exo_names_tex = char(M_.exo_names_tex, 'kl2');
M_.exo_names = char(M_.exo_names, 'ke1');
M_.exo_names_tex = char(M_.exo_names_tex, 'ke1');
M_.exo_names = char(M_.exo_names, 'ke2');
M_.exo_names_tex = char(M_.exo_names_tex, 'ke2');
M_.exo_names = char(M_.exo_names, 'kr1');
M_.exo_names_tex = char(M_.exo_names_tex, 'kr1');
M_.exo_names = char(M_.exo_names, 'kr2');
M_.exo_names_tex = char(M_.exo_names_tex, 'kr2');
M_.endo_names = 'c';
M_.endo_names_tex = 'c';
M_.endo_names = char(M_.endo_names, 'W');
M_.endo_names_tex = char(M_.endo_names_tex, 'W');
M_.endo_names = char(M_.endo_names, 'kp');
M_.endo_names_tex = char(M_.endo_names_tex, 'kp');
M_.endo_names = char(M_.endo_names, 'kl');
M_.endo_names_tex = char(M_.endo_names_tex, 'kl');
M_.endo_names = char(M_.endo_names, 'ke');
M_.endo_names_tex = char(M_.endo_names_tex, 'ke');
M_.endo_names = char(M_.endo_names, 'kr');
M_.endo_names_tex = char(M_.endo_names_tex, 'kr');
M_.endo_names = char(M_.endo_names, 'c1');
M_.endo_names_tex = char(M_.endo_names_tex, 'c1');
M_.endo_names = char(M_.endo_names, 'c2');
M_.endo_names_tex = char(M_.endo_names_tex, 'c2');
M_.endo_names = char(M_.endo_names, 'W1');
M_.endo_names_tex = char(M_.endo_names_tex, 'W1');
M_.endo_names = char(M_.endo_names, 'W2');
M_.endo_names_tex = char(M_.endo_names_tex, 'W2');
M_.endo_names = char(M_.endo_names, 'kp1');
M_.endo_names_tex = char(M_.endo_names_tex, 'kp1');
M_.endo_names = char(M_.endo_names, 'w1');
M_.endo_names_tex = char(M_.endo_names_tex, 'w1');
M_.endo_names = char(M_.endo_names, 'p1');
M_.endo_names_tex = char(M_.endo_names_tex, 'p1');
M_.endo_names = char(M_.endo_names, 'e1');
M_.endo_names_tex = char(M_.endo_names_tex, 'e1');
M_.endo_names = char(M_.endo_names, 'r1');
M_.endo_names_tex = char(M_.endo_names_tex, 'r1');
M_.endo_names = char(M_.endo_names, 'kp2');
M_.endo_names_tex = char(M_.endo_names_tex, 'kp2');
M_.endo_names = char(M_.endo_names, 'w2');
M_.endo_names_tex = char(M_.endo_names_tex, 'w2');
M_.endo_names = char(M_.endo_names, 'p2');
M_.endo_names_tex = char(M_.endo_names_tex, 'p2');
M_.endo_names = char(M_.endo_names, 'e2');
M_.endo_names_tex = char(M_.endo_names_tex, 'e2');
M_.endo_names = char(M_.endo_names, 'r2');
M_.endo_names_tex = char(M_.endo_names_tex, 'r2');
M_.endo_names = char(M_.endo_names, 'sigma');
M_.endo_names_tex = char(M_.endo_names_tex, 'sigma');
M_.endo_names = char(M_.endo_names, 'nu');
M_.endo_names_tex = char(M_.endo_names_tex, 'nu');
M_.endo_names = char(M_.endo_names, 'tau');
M_.endo_names_tex = char(M_.endo_names_tex, 'tau');
M_.endo_names = char(M_.endo_names, 'kappa');
M_.endo_names_tex = char(M_.endo_names_tex, 'kappa');
M_.param_names = 'xi';
M_.param_names_tex = 'xi';
M_.param_names = char(M_.param_names, 'x');
M_.param_names_tex = char(M_.param_names_tex, 'x');
M_.param_names = char(M_.param_names, 'rho');
M_.param_names_tex = char(M_.param_names_tex, 'rho');
M_.param_names = char(M_.param_names, 'beta');
M_.param_names_tex = char(M_.param_names_tex, 'beta');
M_.param_names = char(M_.param_names, 'alpha');
M_.param_names_tex = char(M_.param_names_tex, 'alpha');
M_.param_names = char(M_.param_names, 'delta');
M_.param_names_tex = char(M_.param_names_tex, 'delta');
M_.param_names = char(M_.param_names, 'epsi');
M_.param_names_tex = char(M_.param_names_tex, 'epsi');
M_.param_names = char(M_.param_names, 'phi');
M_.param_names_tex = char(M_.param_names_tex, 'phi');
M_.exo_det_nbr = 0;
M_.exo_nbr = 6;
M_.endo_nbr = 24;
M_.param_nbr = 8;
M_.orig_endo_nbr = 24;
M_.aux_vars = [];
M_.Sigma_e = zeros(6, 6);
M_.H = 0;
options_.block=0;
options_.bytecode=0;
options_.use_dll=0;
erase_compiled_function('model_cs_static');
erase_compiled_function('model_cs_dynamic');
M_.lead_lag_incidence = [
 1 0;
 2 0;
 3 0;
 4 0;
 5 0;
 6 0;
 7 25;
 8 26;
 9 0;
 10 0;
 11 27;
 12 0;
 13 28;
 14 0;
 15 0;
 16 29;
 17 0;
 18 30;
 19 0;
 20 0;
 21 0;
 22 0;
 23 0;
 24 0;]';
M_.nstatic = 18;
M_.nfwrd   = 6;
M_.npred   = 0;
M_.nboth   = 0;
M_.equations_tags = {
};
M_.exo_names_orig_ord = [1:6];
M_.maximum_lag = 0;
M_.maximum_lead = 1;
M_.maximum_endo_lag = 0;
M_.maximum_endo_lead = 1;
oo_.steady_state = zeros(24, 1);
M_.maximum_exo_lag = 0;
M_.maximum_exo_lead = 0;
oo_.exo_steady_state = zeros(6, 1);
M_.params = NaN(8, 1);
M_.NNZDerivatives = zeros(3, 1);
M_.NNZDerivatives(1) = 147;
M_.NNZDerivatives(2) = 0;
M_.NNZDerivatives(3) = -1;
M_.params( 5 ) = 0.15;
alpha = M_.params( 5 );
M_.params( 4 ) = 0.949;
beta = M_.params( 4 );
M_.params( 6 ) = 0.044;
delta = M_.params( 6 );
M_.params( 8 ) = 0.553;
phi = M_.params( 8 );
M_.params( 1 ) = 1/(M_.params(8)*(M_.params(5)/4)^M_.params(5)*(1-M_.params(5))^(1-M_.params(5)));
xi = M_.params( 1 );
M_.params( 7 ) = 4^(M_.params(5)-1)/M_.params(1);
epsi = M_.params( 7 );
M_.params( 3 ) = 0.015;
rho = M_.params( 3 );
M_.params( 2 ) = 0.01;
x = M_.params( 2 );
%
% INITVAL instructions
%
options_.initval_file = 0;
oo_.steady_state( 7 ) = 0.3404;
oo_.steady_state( 8 ) = 0.3175;
oo_.exo_steady_state( 1 ) = 1.01;
oo_.steady_state( 11 ) = 1.07134;
oo_.exo_steady_state( 3 ) = 0.99;
oo_.exo_steady_state( 5 ) = 0.99;
oo_.exo_steady_state( 2 ) = 0.99;
oo_.steady_state( 16 ) = 0.7197606;
oo_.exo_steady_state( 4 ) = 1.01;
oo_.exo_steady_state( 6 ) = 1.01;
oo_.steady_state( 1 ) = oo_.steady_state(7)+oo_.steady_state(8);
oo_.steady_state( 4 ) = oo_.exo_steady_state(1)+oo_.exo_steady_state(2);
oo_.steady_state( 3 ) = oo_.steady_state(11)+oo_.steady_state(16);
oo_.steady_state( 5 ) = oo_.exo_steady_state(3)+oo_.exo_steady_state(4);
oo_.steady_state( 6 ) = oo_.exo_steady_state(5)+oo_.exo_steady_state(6);
oo_.steady_state( 12 ) = 0.1036777;
oo_.steady_state( 13 ) = 0.09774078;
oo_.steady_state( 14 ) = 0.07924;
oo_.steady_state( 15 ) = 0.07924;
oo_.steady_state( 17 ) = 0.07106;
oo_.steady_state( 18 ) = 0.09774078;
oo_.steady_state( 19 ) = 0.095722;
oo_.steady_state( 20 ) = 0.095722;
oo_.steady_state( 9 ) = oo_.exo_steady_state(5)+oo_.exo_steady_state(3)+oo_.exo_steady_state(1)+oo_.steady_state(11);
oo_.steady_state( 10 ) = oo_.exo_steady_state(6)+oo_.exo_steady_state(4)+oo_.exo_steady_state(2)+oo_.steady_state(16);
oo_.steady_state( 2 ) = oo_.steady_state(9)+oo_.steady_state(10);
oo_.steady_state( 21 ) = oo_.steady_state(17)/oo_.steady_state(19);
oo_.steady_state( 22 ) = oo_.steady_state(13)/oo_.steady_state(15);
oo_.steady_state( 23 ) = oo_.steady_state(12)/oo_.steady_state(14);
oo_.steady_state( 24 ) = oo_.steady_state(18)/oo_.steady_state(20);
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;
%
% ENDVAL instructions
%
ys0_= oo_.steady_state;
ex0_ = oo_.exo_steady_state;
oo_.steady_state( 7 ) = 0.325800719244995;
oo_.steady_state( 8 ) = 0.33030409546673;
oo_.exo_steady_state( 1 ) = 1.1;
oo_.steady_state( 11 ) = 1.05223598875987;
oo_.exo_steady_state( 3 ) = 0.9;
oo_.exo_steady_state( 5 ) = 0.9;
oo_.exo_steady_state( 2 ) = 0.9;
oo_.steady_state( 16 ) = 0.747974273026956;
oo_.exo_steady_state( 4 ) = 1.1;
oo_.exo_steady_state( 6 ) = 1.1;
oo_.steady_state( 1 ) = oo_.steady_state(7)+oo_.steady_state(8);
oo_.steady_state( 4 ) = oo_.exo_steady_state(1)+oo_.exo_steady_state(2);
oo_.steady_state( 3 ) = oo_.steady_state(11)+oo_.steady_state(16);
oo_.steady_state( 5 ) = oo_.exo_steady_state(3)+oo_.exo_steady_state(4);
oo_.steady_state( 6 ) = oo_.exo_steady_state(5)+oo_.exo_steady_state(6);
oo_.steady_state( 12 ) = 0.0934966964013899;
oo_.steady_state( 13 ) = 0.09774078;
oo_.steady_state( 14 ) = 0.30849479837040955;
oo_.steady_state( 15 ) = 0.0849479837040955;
oo_.steady_state( 17 ) = 0.0812306541024335;
oo_.steady_state( 18 ) = 0.09774078;
oo_.steady_state( 19 ) = 0.0911362664070617;
oo_.steady_state( 20 ) = 0.0911362664070617;
oo_.steady_state( 9 ) = oo_.exo_steady_state(5)+oo_.exo_steady_state(3)+oo_.exo_steady_state(1)+oo_.steady_state(11);
oo_.steady_state( 10 ) = oo_.exo_steady_state(6)+oo_.exo_steady_state(4)+oo_.exo_steady_state(2)+oo_.steady_state(16);
oo_.steady_state( 2 ) = oo_.steady_state(9)+oo_.steady_state(10);
oo_.steady_state( 21 ) = oo_.steady_state(17)/oo_.steady_state(19);
oo_.steady_state( 22 ) = oo_.steady_state(13)/oo_.steady_state(15);
oo_.steady_state( 23 ) = oo_.steady_state(12)/oo_.steady_state(14);
oo_.steady_state( 24 ) = oo_.steady_state(18)/oo_.steady_state(20);
steady;
%
% SHOCKS instructions
%
make_ex_;
set_shocks(0,1, 4, oo_.exo_steady_state(4)/1.01);
set_shocks(0,2, 4, oo_.exo_steady_state(4)/1.0201);
set_shocks(0,3, 4, oo_.exo_steady_state(4)/1.030301);
set_shocks(0,4, 4, oo_.exo_steady_state(4)/1.04060401);
set_shocks(0,5, 4, oo_.exo_steady_state(4)/1.0510100501);
set_shocks(0,6, 4, oo_.exo_steady_state(4)/1.061520150601);
set_shocks(0,7, 4, oo_.exo_steady_state(4)/1.07213535210701);
set_shocks(0,8, 4, oo_.exo_steady_state(4)/1.08285670562808);
set_shocks(0,9, 4, oo_.exo_steady_state(4)/1.093685272684361);
set_shocks(0,10, 4, oo_.exo_steady_state(4)/1.104622125411205);
set_shocks(0,1, 6, oo_.exo_steady_state(6)/1.1);
set_shocks(0,2, 6, oo_.exo_steady_state(6)/1.21);
set_shocks(0,3, 6, oo_.exo_steady_state(6)/1.331);
set_shocks(0,4, 6, oo_.exo_steady_state(6)/1.4641);
set_shocks(0,5, 6, oo_.exo_steady_state(6)/1.610510000000001);
set_shocks(0,6, 6, oo_.exo_steady_state(6)/1.771561000000001);
set_shocks(0,7, 6, oo_.exo_steady_state(6)/1.948717100000001);
set_shocks(0,8, 6, oo_.exo_steady_state(6)/2.143588810000002);
set_shocks(0,9, 6, oo_.exo_steady_state(6)/2.357947691000002);
set_shocks(0,10, 6, oo_.exo_steady_state(6)/2.593742460100002);
M_.exo_det_length = 0;
M_.sigma_e_is_diagonal = 1;
options_.periods = 200;
simul();
var_list_=[];
var_list_ = 'c1';
rplot(var_list_);
var_list_=[];
var_list_ = 'kp1';
rplot(var_list_);
save('model_cs_results.mat', 'oo_', 'M_', 'options_');


disp(['Total computing time : ' dynsec2hms(toc) ]);
diary off
