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

clear all
tic;
global M_ oo_ options_ ys0_ ex0_ estimation_info
options_ = [];
M_.fname = 'basic_model';
%
% Some global variables initialization
%
global_initialization;
diary off;
diary('basic_model.log');
M_.exo_names = 'ea';
M_.exo_names_tex = 'ea';
M_.exo_names_long = 'ea';
M_.endo_names = 'y';
M_.endo_names_tex = 'y';
M_.endo_names_long = 'y';
M_.endo_names = char(M_.endo_names, 'cbeta');
M_.endo_names_tex = char(M_.endo_names_tex, 'cbeta');
M_.endo_names_long = char(M_.endo_names_long, 'cbeta');
M_.endo_names = char(M_.endo_names, 'c');
M_.endo_names_tex = char(M_.endo_names_tex, 'c');
M_.endo_names_long = char(M_.endo_names_long, 'c');
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, '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, '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, 'theta');
M_.endo_names_tex = char(M_.endo_names_tex, 'theta');
M_.endo_names_long = char(M_.endo_names_long, 'theta');
M_.endo_names = char(M_.endo_names, 'q');
M_.endo_names_tex = char(M_.endo_names_tex, 'q');
M_.endo_names_long = char(M_.endo_names_long, 'q');
M_.endo_names = char(M_.endo_names, 'n');
M_.endo_names_tex = char(M_.endo_names_tex, 'n');
M_.endo_names_long = char(M_.endo_names_long, 'n');
M_.endo_names = char(M_.endo_names, 'u');
M_.endo_names_tex = char(M_.endo_names_tex, 'u');
M_.endo_names_long = char(M_.endo_names_long, 'u');
M_.endo_names = char(M_.endo_names, 'v');
M_.endo_names_tex = char(M_.endo_names_tex, 'v');
M_.endo_names_long = char(M_.endo_names_long, 'v');
M_.param_names = 'ceta';
M_.param_names_tex = 'ceta';
M_.param_names_long = 'ceta';
M_.param_names = char(M_.param_names, 'cgamma');
M_.param_names_tex = char(M_.param_names_tex, 'cgamma');
M_.param_names_long = char(M_.param_names_long, 'cgamma');
M_.param_names = char(M_.param_names, 'crho');
M_.param_names_tex = char(M_.param_names_tex, 'crho');
M_.param_names_long = char(M_.param_names_long, 'crho');
M_.param_names = char(M_.param_names, 'csigma');
M_.param_names_tex = char(M_.param_names_tex, 'csigma');
M_.param_names_long = char(M_.param_names_long, 'csigma');
M_.param_names = char(M_.param_names, 'r');
M_.param_names_tex = char(M_.param_names_tex, 'r');
M_.param_names_long = char(M_.param_names_long, 'r');
M_.param_names = char(M_.param_names, 'h');
M_.param_names_tex = char(M_.param_names_tex, 'h');
M_.param_names_long = char(M_.param_names_long, 'h');
M_.param_names = char(M_.param_names, 's');
M_.param_names_tex = char(M_.param_names_tex, 's');
M_.param_names_long = char(M_.param_names_long, 's');
M_.param_names = char(M_.param_names, 'z');
M_.param_names_tex = char(M_.param_names_tex, 'z');
M_.param_names_long = char(M_.param_names_long, 'z');
M_.exo_det_nbr = 0;
M_.exo_nbr = 1;
M_.endo_nbr = 11;
M_.param_nbr = 8;
M_.orig_endo_nbr = 11;
M_.aux_vars = [];
M_.Sigma_e = zeros(1, 1);
M_.Correlation_matrix = eye(1, 1);
M_.H = 0;
M_.Correlation_matrix_ME = 1;
M_.sigma_e_is_diagonal = 1;
options_.block=0;
options_.bytecode=0;
options_.use_dll=0;
erase_compiled_function('basic_model_static');
erase_compiled_function('basic_model_dynamic');
M_.lead_lag_incidence = [
 0 4 15;
 0 5 0;
 0 6 16;
 1 7 0;
 0 8 17;
 2 9 0;
 0 10 0;
 0 11 18;
 3 12 0;
 0 13 0;
 0 14 0;]';
M_.nstatic = 4;
M_.nfwrd   = 4;
M_.npred   = 3;
M_.nboth   = 0;
M_.nsfwrd   = 4;
M_.nspred   = 3;
M_.ndynamic   = 7;
M_.equations_tags = {
};
M_.static_and_dynamic_models_differ = 0;
M_.exo_names_orig_ord = [1:1];
M_.maximum_lag = 1;
M_.maximum_lead = 1;
M_.maximum_endo_lag = 1;
M_.maximum_endo_lead = 1;
oo_.steady_state = zeros(11, 1);
M_.maximum_exo_lag = 0;
M_.maximum_exo_lead = 0;
oo_.exo_steady_state = zeros(1, 1);
M_.params = NaN(8, 1);
M_.NNZDerivatives = zeros(3, 1);
M_.NNZDerivatives(1) = 37;
M_.NNZDerivatives(2) = -1;
M_.NNZDerivatives(3) = -1;
M_.params( 1 ) = 0.5000;
ceta = M_.params( 1 );
M_.params( 2 ) = 0.7200;
cgamma = M_.params( 2 );
M_.params( 3 ) = 0.9000;
crho = M_.params( 3 );
M_.params( 4 ) = 2.0000;
csigma = M_.params( 4 );
M_.params( 5 ) = 0.1000;
r = M_.params( 5 );
M_.params( 6 ) = 0.1324;
h = M_.params( 6 );
M_.params( 7 ) = 0.1000;
s = M_.params( 7 );
M_.params( 8 ) = 0.7088;
z = M_.params( 8 );
%
% INITVAL instructions
%
options_.initval_file = 0;
oo_.steady_state( 1 ) = 0.7505;
oo_.steady_state( 2 ) = 0.9900;
oo_.steady_state( 3 ) = 1.0000;
oo_.steady_state( 4 ) = 1.0000;
oo_.steady_state( 5 ) = 1.0808;
oo_.steady_state( 6 ) = 0.0811;
oo_.steady_state( 7 ) = 0.4286;
oo_.steady_state( 8 ) = 0.7000;
oo_.steady_state( 9 ) = 0.7500;
oo_.steady_state( 10 ) = 0.2703;
oo_.steady_state( 11 ) = 0.1158;
if M_.exo_nbr > 0;
	oo_.exo_simul = [ones(M_.maximum_lag,1)*oo_.exo_steady_state'];
end;
if M_.exo_det_nbr > 0;
	oo_.exo_det_simul = [ones(M_.maximum_lag,1)*oo_.exo_det_steady_state'];
end;
steady;
oo_.dr.eigval = check(M_,options_,oo_);
%
% SHOCKS instructions
%
make_ex_;
M_.exo_det_length = 0;
M_.Sigma_e(1, 1) = (0.0049)^2;
options_.irf = 40;
options_.order = 1;
var_list_=[];
info = stoch_simul(var_list_);
save('basic_model_results.mat', 'oo_', 'M_', 'options_');
if exist('estim_params_', 'var') == 1
  save('basic_model_results.mat', 'estim_params_', '-append');
end
if exist('bayestopt_', 'var') == 1
  save('basic_model_results.mat', 'bayestopt_', '-append');
end
if exist('dataset_', 'var') == 1
  save('basic_model_results.mat', 'dataset_', '-append');
end
if exist('estimation_info', 'var') == 1
  save('basic_model_results.mat', 'estimation_info', '-append');
end


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