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

tic;
global M_ oo_ options_ ys0_ ex0_ estimation_info
options_ = [];
M_.fname = 'cgg';
%
% Some global variables initialization
%
global_initialization;
diary off;
M_.exo_names = 'eps_g';
M_.exo_names_tex = 'eps\_g';
M_.exo_names_long = 'eps_g';
M_.endo_names = 'g';
M_.endo_names_tex = 'g';
M_.endo_names_long = 'g';
M_.endo_names = char(M_.endo_names, 'r');
M_.endo_names_tex = char(M_.endo_names_tex, 'r');
M_.endo_names_long = char(M_.endo_names_long, 'r');
M_.endo_names = char(M_.endo_names, 'rnot');
M_.endo_names_tex = char(M_.endo_names_tex, 'rnot');
M_.endo_names_long = char(M_.endo_names_long, 'rnot');
M_.endo_names = char(M_.endo_names, 'p');
M_.endo_names_tex = char(M_.endo_names_tex, 'p');
M_.endo_names_long = char(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_.param_names = 'LAMBDA';
M_.param_names_tex = 'LAMBDA';
M_.param_names_long = 'LAMBDA';
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, 'FIP');
M_.param_names_tex = char(M_.param_names_tex, 'FIP');
M_.param_names_long = char(M_.param_names_long, 'FIP');
M_.param_names = char(M_.param_names, 'SIGMAG');
M_.param_names_tex = char(M_.param_names_tex, 'SIGMAG');
M_.param_names_long = char(M_.param_names_long, 'SIGMAG');
M_.param_names = char(M_.param_names, 'FIY');
M_.param_names_tex = char(M_.param_names_tex, 'FIY');
M_.param_names_long = char(M_.param_names_long, 'FIY');
M_.param_names = char(M_.param_names, 'FIR');
M_.param_names_tex = char(M_.param_names_tex, 'FIR');
M_.param_names_long = char(M_.param_names_long, 'FIR');
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, 'RHOG');
M_.param_names_tex = char(M_.param_names_tex, 'RHOG');
M_.param_names_long = char(M_.param_names_long, 'RHOG');
M_.exo_det_nbr = 0;
M_.exo_nbr = 1;
M_.endo_nbr = 5;
M_.param_nbr = 8;
M_.orig_endo_nbr = 5;
M_.aux_vars = [];
M_.Sigma_e = zeros(1, 1);
M_.Correlation_matrix = eye(1, 1);
M_.H = 0;
M_.Correlation_matrix_ME = 1;
options_.linear = 1;
options_.block=0;
options_.bytecode=0;
options_.use_dll=0;
erase_compiled_function('cgg_static');
erase_compiled_function('cgg_dynamic');
M_.lead_lag_incidence = [
 1 3 0;
 0 4 0;
 2 5 0;
 0 6 8;
 0 7 9;]';
M_.nstatic = 1;
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:1];
M_.maximum_lag = 1;
M_.maximum_lead = 1;
M_.maximum_endo_lag = 1;
M_.maximum_endo_lead = 1;
oo_.steady_state = zeros(5, 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) = 17;
M_.NNZDerivatives(2) = -1;
M_.NNZDerivatives(3) = -1;
M_.params( 1 ) = 0.04;
LAMBDA = M_.params( 1 );
M_.params( 2 ) = 0.9925;
BETA = M_.params( 2 );
M_.params( 3 ) = 4;
FIP = M_.params( 3 );
M_.params( 5 ) = 4;
FIY = M_.params( 5 );
M_.params( 6 ) = 0.8;
FIR = M_.params( 6 );
M_.params( 7 ) = 1;
PHI = M_.params( 7 );
M_.params( 4 ) = 0.06;
SIGMAG = M_.params( 4 );
M_.params( 8 ) = 0.5;
RHOG = M_.params( 8 );
%
% INITVAL instructions
%
options_.initval_file = 0;
oo_.steady_state( 5 ) = 0;
oo_.steady_state( 1 ) = 0;
oo_.steady_state( 2 ) = 0;
oo_.steady_state( 4 ) = 0;
oo_.steady_state( 3 ) = 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;
%
% SHOCKS instructions
%
make_ex_;
M_.exo_det_length = 0;
M_.Sigma_e(1, 1) = (M_.params(4))^2;
M_.sigma_e_is_diagonal = 1;
options_.irf = 0;
options_.nocorr = 1;
options_.nomoments = 1;
options_.order = 1;
var_list_=[];
info = stoch_simul(var_list_);
save('cgg_results.mat', 'oo_', 'M_', 'options_');
if exist('estim_params_', 'var') == 1
  save('cgg_results.mat', 'estim_params_', '-append');
end
if exist('bayestopt_', 'var') == 1
  save('cgg_results.mat', 'bayestopt_', '-append');
end
if exist('dataset_', 'var') == 1
  save('cgg_results.mat', 'dataset_', '-append');
end
if exist('estimation_info', 'var') == 1
  save('cgg_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
