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

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 = 'edsingle';
M_.dynare_version = '2017-01-22';
oo_.dynare_version = '2017-01-22';
options_.dynare_version = '2017-01-22';
%
% Some global variables initialization
%
global_initialization;
diary off;
diary('edsingle.log');
M_.exo_names = 'eps_mu';
M_.exo_names_tex = 'eps\_mu';
M_.exo_names_long = 'eps_mu';
M_.endo_names = 'p';
M_.endo_names_tex = 'p';
M_.endo_names_long = '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, 'y_f');
M_.endo_names_tex = char(M_.endo_names_tex, 'y\_f');
M_.endo_names_long = char(M_.endo_names_long, 'y_f');
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, 'pp_f');
M_.endo_names_tex = char(M_.endo_names_tex, 'pp\_f');
M_.endo_names_long = char(M_.endo_names_long, 'pp_f');
M_.endo_names = char(M_.endo_names, 's');
M_.endo_names_tex = char(M_.endo_names_tex, 's');
M_.endo_names_long = char(M_.endo_names_long, 's');
M_.endo_names = char(M_.endo_names, 'ss');
M_.endo_names_tex = char(M_.endo_names_tex, 'ss');
M_.endo_names_long = char(M_.endo_names_long, 'ss');
M_.endo_names = char(M_.endo_names, 'mu');
M_.endo_names_tex = char(M_.endo_names_tex, 'mu');
M_.endo_names_long = char(M_.endo_names_long, 'mu');
M_.endo_partitions = struct();
M_.param_names = 'sigma';
M_.param_names_tex = 'sigma';
M_.param_names_long = 'sigma';
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, 'n');
M_.param_names_tex = char(M_.param_names_tex, 'n');
M_.param_names_long = char(M_.param_names_long, 'n');
M_.param_names = char(M_.param_names, 'sigmas');
M_.param_names_tex = char(M_.param_names_tex, 'sigmas');
M_.param_names_long = char(M_.param_names_long, 'sigmas');
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, 'bbeta');
M_.param_names_tex = char(M_.param_names_tex, 'bbeta');
M_.param_names_long = char(M_.param_names_long, 'bbeta');
M_.param_names = char(M_.param_names, 'theta');
M_.param_names_tex = char(M_.param_names_tex, 'theta');
M_.param_names_long = char(M_.param_names_long, 'theta');
M_.param_names = char(M_.param_names, 'theta_f');
M_.param_names_tex = char(M_.param_names_tex, 'theta\_f');
M_.param_names_long = char(M_.param_names_long, 'theta_f');
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, 'rho_mu');
M_.param_names_tex = char(M_.param_names_tex, 'rho\_mu');
M_.param_names_long = char(M_.param_names_long, 'rho_mu');
M_.param_names = char(M_.param_names, 'rho_mu_f');
M_.param_names_tex = char(M_.param_names_tex, 'rho\_mu\_f');
M_.param_names_long = char(M_.param_names_long, 'rho_mu_f');
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, 'kappa_f');
M_.param_names_tex = char(M_.param_names_tex, 'kappa\_f');
M_.param_names_long = char(M_.param_names_long, 'kappa_f');
M_.param_names = char(M_.param_names, 'ggamma');
M_.param_names_tex = char(M_.param_names_tex, 'ggamma');
M_.param_names_long = char(M_.param_names_long, 'ggamma');
M_.param_names = char(M_.param_names, 'lambda');
M_.param_names_tex = char(M_.param_names_tex, 'lambda');
M_.param_names_long = char(M_.param_names_long, 'lambda');
M_.param_names = char(M_.param_names, 'lambda_f');
M_.param_names_tex = char(M_.param_names_tex, 'lambda\_f');
M_.param_names_long = char(M_.param_names_long, 'lambda_f');
M_.param_names = char(M_.param_names, 'yb');
M_.param_names_tex = char(M_.param_names_tex, 'yb');
M_.param_names_long = char(M_.param_names_long, 'yb');
M_.param_names = char(M_.param_names, 'yb_f');
M_.param_names_tex = char(M_.param_names_tex, 'yb\_f');
M_.param_names_long = char(M_.param_names_long, 'yb_f');
M_.param_names = char(M_.param_names, 'sb');
M_.param_names_tex = char(M_.param_names_tex, 'sb');
M_.param_names_long = char(M_.param_names_long, 'sb');
M_.param_partitions = struct();
M_.exo_det_nbr = 0;
M_.exo_nbr = 1;
M_.endo_nbr = 8;
M_.param_nbr = 19;
M_.orig_endo_nbr = 8;
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;
M_.det_shocks = [];
options_.block=0;
options_.bytecode=0;
options_.use_dll=0;
M_.hessian_eq_zero = 1;
erase_compiled_function('edsingle_static');
erase_compiled_function('edsingle_dynamic');
M_.orig_eq_nbr = 8;
M_.eq_nbr = 8;
M_.ramsey_eq_nbr = 0;
M_.lead_lag_incidence = [
 0 2 0;
 0 3 0;
 0 4 0;
 0 5 10;
 0 6 11;
 0 7 0;
 0 8 0;
 1 9 0;]';
M_.nstatic = 5;
M_.nfwrd   = 2;
M_.npred   = 1;
M_.nboth   = 0;
M_.nsfwrd   = 2;
M_.nspred   = 1;
M_.ndynamic   = 3;
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(8, 1);
M_.maximum_exo_lag = 0;
M_.maximum_exo_lead = 0;
oo_.exo_steady_state = zeros(1, 1);
M_.params = NaN(19, 1);
M_.NNZDerivatives = [24; 0; -1];
M_.params( 7 ) = 0.75;
theta = M_.params( 7 );
M_.params( 1 ) = 1;
sigma = M_.params( 1 );
M_.params( 2 ) = 0.67;
zeta = M_.params( 2 );
M_.params( 3 ) = 0.5;
n = M_.params( 3 );
M_.params( 5 ) = 7.66;
epsilon = M_.params( 5 );
M_.params( 6 ) = 0.99;
bbeta = M_.params( 6 );
M_.params( 8 ) = 0.75;
theta_f = M_.params( 8 );
M_.params( 9 ) = 2;
eta = M_.params( 9 );
M_.params( 15 ) = 0.75;
lambda = M_.params( 15 );
M_.params( 16 ) = 0.75;
lambda_f = M_.params( 16 );
M_.params( 10 ) = 0.9;
rho_mu = M_.params( 10 );
M_.params( 11 ) = 0.9;
rho_mu_f = M_.params( 11 );
M_.params( 12 ) = (1-M_.params(7)*M_.params(6))*(1-M_.params(7))/(M_.params(7)*(1+M_.params(5)*M_.params(2)));
kappa = M_.params( 12 );
M_.params( 13 ) = (1-M_.params(6)*M_.params(8))*(1-M_.params(8))/((1+M_.params(5)*M_.params(2))*M_.params(8));
kappa_f = M_.params( 13 );
M_.params( 14 ) = (M_.params(15)+M_.params(16))*(2-M_.params(15)-M_.params(16))*M_.params(1)*M_.params(9)+(1-M_.params(15)-M_.params(16))^2;
ggamma = M_.params( 14 );
M_.params( 4 ) = (2-M_.params(15)-M_.params(16))*(M_.params(1)*M_.params(9)-1)/M_.params(1)*M_.params(14);
sigmas = M_.params( 4 );
M_.params( 17 ) = 0;
yb = M_.params( 17 );
M_.params( 18 ) = 0;
yb_f = M_.params( 18 );
M_.params( 19 ) = M_.params(1)*(M_.params(17)-M_.params(18));
sb = M_.params( 19 );
%
% INITVAL instructions
%
options_.initval_file = 0;
oo_.steady_state( 8 ) = 0;
oo_.steady_state( 2 ) = M_.params(17);
oo_.steady_state( 3 ) = M_.params(18);
oo_.steady_state( 5 ) = 0;
oo_.steady_state( 4 ) = 0;
oo_.steady_state( 6 ) = M_.params(19);
oo_.steady_state( 7 ) = 0;
oo_.steady_state( 1 ) = 0;
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
%
M_.exo_det_length = 0;
M_.Sigma_e(1, 1) = 0.1;
options_.irf = 53;
options_.nodisplay = 1;
options_.order = 2;
var_list_ = char();
info = stoch_simul(var_list_);
j=ss_eps_mu;
o=p_eps_mu;
save('edsingle_results.mat', 'oo_', 'M_', 'options_');
if exist('estim_params_', 'var') == 1
  save('edsingle_results.mat', 'estim_params_', '-append');
end
if exist('bayestopt_', 'var') == 1
  save('edsingle_results.mat', 'bayestopt_', '-append');
end
if exist('dataset_', 'var') == 1
  save('edsingle_results.mat', 'dataset_', '-append');
end
if exist('estimation_info', 'var') == 1
  save('edsingle_results.mat', 'estimation_info', '-append');
end
if exist('dataset_info', 'var') == 1
  save('edsingle_results.mat', 'dataset_info', '-append');
end
if exist('oo_recursive_', 'var') == 1
  save('edsingle_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
