%
% 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 = 'FO_OE_ss';
%
% Some global variables initialization
%
global_initialization;
diary off;
diary('FO_OE_ss.log');
M_.exo_names = 'ua';
M_.exo_names_tex = 'ua';
M_.exo_names_long = 'ua';
M_.exo_names = char(M_.exo_names, 'um');
M_.exo_names_tex = char(M_.exo_names_tex, 'um');
M_.exo_names_long = char(M_.exo_names_long, 'um');
M_.endo_names = 'pr';
M_.endo_names_tex = 'pr';
M_.endo_names_long = 'pr';
M_.endo_names = char(M_.endo_names, 'ri');
M_.endo_names_tex = char(M_.endo_names_tex, 'ri');
M_.endo_names_long = char(M_.endo_names_long, 'ri');
M_.endo_names = char(M_.endo_names, 'rl');
M_.endo_names_tex = char(M_.endo_names_tex, 'rl');
M_.endo_names_long = char(M_.endo_names_long, 'rl');
M_.endo_names = char(M_.endo_names, 'rd');
M_.endo_names_tex = char(M_.endo_names_tex, 'rd');
M_.endo_names_long = char(M_.endo_names_long, 'rd');
M_.endo_names = char(M_.endo_names, 'd');
M_.endo_names_tex = char(M_.endo_names_tex, 'd');
M_.endo_names_long = char(M_.endo_names_long, 'd');
M_.endo_names = char(M_.endo_names, 'dstar');
M_.endo_names_tex = char(M_.endo_names_tex, 'dstar');
M_.endo_names_long = char(M_.endo_names_long, 'dstar');
M_.endo_names = char(M_.endo_names, 'pai');
M_.endo_names_tex = char(M_.endo_names_tex, 'pai');
M_.endo_names_long = char(M_.endo_names_long, 'pai');
M_.endo_names = char(M_.endo_names, 'paistar');
M_.endo_names_tex = char(M_.endo_names_tex, 'paistar');
M_.endo_names_long = char(M_.endo_names_long, 'paistar');
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, 'nstar');
M_.endo_names_tex = char(M_.endo_names_tex, 'nstar');
M_.endo_names_long = char(M_.endo_names_long, 'nstar');
M_.endo_names = char(M_.endo_names, 'ne');
M_.endo_names_tex = char(M_.endo_names_tex, 'ne');
M_.endo_names_long = char(M_.endo_names_long, 'ne');
M_.endo_names = char(M_.endo_names, 'nestar');
M_.endo_names_tex = char(M_.endo_names_tex, 'nestar');
M_.endo_names_long = char(M_.endo_names_long, 'nestar');
M_.endo_names = char(M_.endo_names, 'dt');
M_.endo_names_tex = char(M_.endo_names_tex, 'dt');
M_.endo_names_long = char(M_.endo_names_long, 'dt');
M_.endo_names = char(M_.endo_names, 'nt');
M_.endo_names_tex = char(M_.endo_names_tex, 'nt');
M_.endo_names_long = char(M_.endo_names_long, 'nt');
M_.endo_names = char(M_.endo_names, 'net');
M_.endo_names_tex = char(M_.endo_names_tex, 'net');
M_.endo_names_long = char(M_.endo_names_long, 'net');
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, '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, 'lnpr');
M_.endo_names_tex = char(M_.endo_names_tex, 'lnpr');
M_.endo_names_long = char(M_.endo_names_long, 'lnpr');
M_.endo_names = char(M_.endo_names, 'lnri');
M_.endo_names_tex = char(M_.endo_names_tex, 'lnri');
M_.endo_names_long = char(M_.endo_names_long, 'lnri');
M_.endo_names = char(M_.endo_names, 'lnrl');
M_.endo_names_tex = char(M_.endo_names_tex, 'lnrl');
M_.endo_names_long = char(M_.endo_names_long, 'lnrl');
M_.endo_names = char(M_.endo_names, 'lnrd');
M_.endo_names_tex = char(M_.endo_names_tex, 'lnrd');
M_.endo_names_long = char(M_.endo_names_long, 'lnrd');
M_.endo_names = char(M_.endo_names, 'lnd');
M_.endo_names_tex = char(M_.endo_names_tex, 'lnd');
M_.endo_names_long = char(M_.endo_names_long, 'lnd');
M_.endo_names = char(M_.endo_names, 'lnnn');
M_.endo_names_tex = char(M_.endo_names_tex, 'lnnn');
M_.endo_names_long = char(M_.endo_names_long, 'lnnn');
M_.endo_names = char(M_.endo_names, 'lnne');
M_.endo_names_tex = char(M_.endo_names_tex, 'lnne');
M_.endo_names_long = char(M_.endo_names_long, 'lnne');
M_.endo_names = char(M_.endo_names, 'lndstar');
M_.endo_names_tex = char(M_.endo_names_tex, 'lndstar');
M_.endo_names_long = char(M_.endo_names_long, 'lndstar');
M_.endo_names = char(M_.endo_names, 'lnnstar');
M_.endo_names_tex = char(M_.endo_names_tex, 'lnnstar');
M_.endo_names_long = char(M_.endo_names_long, 'lnnstar');
M_.endo_names = char(M_.endo_names, 'lnnestar');
M_.endo_names_tex = char(M_.endo_names_tex, 'lnnestar');
M_.endo_names_long = char(M_.endo_names_long, 'lnnestar');
M_.endo_names = char(M_.endo_names, 'lndt');
M_.endo_names_tex = char(M_.endo_names_tex, 'lndt');
M_.endo_names_long = char(M_.endo_names_long, 'lndt');
M_.endo_names = char(M_.endo_names, 'lnnt');
M_.endo_names_tex = char(M_.endo_names_tex, 'lnnt');
M_.endo_names_long = char(M_.endo_names_long, 'lnnt');
M_.endo_names = char(M_.endo_names, 'lnnet');
M_.endo_names_tex = char(M_.endo_names_tex, 'lnnet');
M_.endo_names_long = char(M_.endo_names_long, 'lnnet');
M_.param_names = 'alfa';
M_.param_names_tex = 'alfa';
M_.param_names_long = 'alfa';
M_.param_names = char(M_.param_names, 'beta');
M_.param_names_tex = char(M_.param_names_tex, 'beta');
M_.param_names_long = char(M_.param_names_long, 'beta');
M_.param_names = char(M_.param_names, 'phi');
M_.param_names_tex = char(M_.param_names_tex, 'phi');
M_.param_names_long = char(M_.param_names_long, 'phi');
M_.param_names = char(M_.param_names, 'gama');
M_.param_names_tex = char(M_.param_names_tex, 'gama');
M_.param_names_long = char(M_.param_names_long, 'gama');
M_.param_names = char(M_.param_names, 'csi');
M_.param_names_tex = char(M_.param_names_tex, 'csi');
M_.param_names_long = char(M_.param_names_long, 'csi');
M_.param_names = char(M_.param_names, 'pho');
M_.param_names_tex = char(M_.param_names_tex, 'pho');
M_.param_names_long = char(M_.param_names_long, 'pho');
M_.param_names = char(M_.param_names, 'kai');
M_.param_names_tex = char(M_.param_names_tex, 'kai');
M_.param_names_long = char(M_.param_names_long, 'kai');
M_.param_names = char(M_.param_names, 'mu');
M_.param_names_tex = char(M_.param_names_tex, 'mu');
M_.param_names_long = char(M_.param_names_long, 'mu');
M_.param_names = char(M_.param_names, 'roa');
M_.param_names_tex = char(M_.param_names_tex, 'roa');
M_.param_names_long = char(M_.param_names_long, 'roa');
M_.param_names = char(M_.param_names, 'rhom');
M_.param_names_tex = char(M_.param_names_tex, 'rhom');
M_.param_names_long = char(M_.param_names_long, 'rhom');
M_.exo_det_nbr = 0;
M_.exo_nbr = 2;
M_.endo_nbr = 30;
M_.param_nbr = 10;
M_.orig_endo_nbr = 30;
M_.aux_vars = [];
M_.Sigma_e = zeros(2, 2);
M_.Correlation_matrix = eye(2, 2);
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('FO_OE_ss_static');
erase_compiled_function('FO_OE_ss_dynamic');
M_.lead_lag_incidence = [
 0 3 0;
 0 4 0;
 0 5 0;
 0 6 0;
 0 7 0;
 0 8 0;
 0 9 0;
 0 10 0;
 0 11 33;
 0 12 34;
 0 13 0;
 0 14 0;
 0 15 0;
 0 16 0;
 0 17 0;
 1 18 0;
 2 19 0;
 0 20 0;
 0 21 0;
 0 22 0;
 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;]';
M_.nstatic = 26;
M_.nfwrd   = 2;
M_.npred   = 2;
M_.nboth   = 0;
M_.nsfwrd   = 2;
M_.nspred   = 2;
M_.ndynamic   = 4;
M_.equations_tags = {
};
M_.static_and_dynamic_models_differ = 0;
M_.exo_names_orig_ord = [1:2];
M_.maximum_lag = 1;
M_.maximum_lead = 1;
M_.maximum_endo_lag = 1;
M_.maximum_endo_lead = 1;
oo_.steady_state = zeros(30, 1);
M_.maximum_exo_lag = 0;
M_.maximum_exo_lead = 0;
oo_.exo_steady_state = zeros(2, 1);
M_.params = NaN(10, 1);
M_.NNZDerivatives = zeros(3, 1);
M_.NNZDerivatives(1) = 80;
M_.NNZDerivatives(2) = -1;
M_.NNZDerivatives(3) = -1;
M_.params( 1 ) = 0.7;
alfa = M_.params( 1 );
M_.params( 3 ) = 2;
phi = M_.params( 3 );
M_.params( 4 ) = 3;
gama = M_.params( 4 );
M_.params( 5 ) = 0.2;
csi = M_.params( 5 );
M_.params( 4 ) = 3;
gama = M_.params( 4 );
M_.params( 5 ) = 0.2;
csi = M_.params( 5 );
M_.params( 9 ) = 0.95;
roa = M_.params( 9 );
M_.params( 10 ) = 0.9;
rhom = M_.params( 10 );
M_.params( 6 ) = 0.1;
pho = M_.params( 6 );
M_.params( 8 ) = 0.5;
mu = M_.params( 8 );
M_.params( 2 ) = 0.95;
beta = M_.params( 2 );
M_.params( 7 ) = 2.1;
kai = M_.params( 7 );
steady;
oo_.dr.eigval = check(M_,options_,oo_);
%
% SHOCKS instructions
%
make_ex_;
M_.exo_det_length = 0;
M_.Sigma_e(1, 1) = (0.01)^2;
options_.irf = 30;
options_.nograph = 1;
options_.order = 1;
var_list_=[];
info = stoch_simul(var_list_);
close all;
save('FO_OE_ss_results.mat', 'oo_', 'M_', 'options_');
if exist('estim_params_', 'var') == 1
  save('FO_OE_ss_results.mat', 'estim_params_', '-append');
end
if exist('bayestopt_', 'var') == 1
  save('FO_OE_ss_results.mat', 'bayestopt_', '-append');
end
if exist('dataset_', 'var') == 1
  save('FO_OE_ss_results.mat', 'dataset_', '-append');
end
if exist('estimation_info', 'var') == 1
  save('FO_OE_ss_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
