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

if isoctave || matlab_ver_less_than('8.6')
    clear all
else
    clearvars -global
    clear_persistent_variables(fileparts(which('dynare')), false)
end
tic0 = tic;
% Define global variables.
global M_ options_ oo_ estim_params_ bayestopt_ dataset_ dataset_info estimation_info ys0_ ex0_
options_ = [];
M_.fname = 'Comparethem';
M_.dynare_version = '4.6.1';
oo_.dynare_version = '4.6.1';
options_.dynare_version = '4.6.1';
%
% Some global variables initialization
%
global_initialization;
diary off;
diary('Comparethem.log');
M_.exo_names = {};
M_.exo_names_tex = {};
M_.exo_names_long = {};
M_.param_names = {};
M_.param_names_tex = {};
M_.param_names_long = {};
M_.exo_det_nbr = 0;
M_.exo_nbr = 0;
M_.endo_nbr = 0;
M_.param_nbr = 0;
M_.orig_endo_nbr = 0;
M_.aux_vars = [];
M_.Sigma_e = zeros(0, 0);
M_.Correlation_matrix = eye(0, 0);
M_.H = 0;
M_.Correlation_matrix_ME = 1;
M_.sigma_e_is_diagonal = true;
M_.det_shocks = [];
options_.linear = false;
options_.block = false;
options_.bytecode = false;
options_.use_dll = false;
options_.linear_decomposition = false;
M_.orig_eq_nbr = 0;
M_.eq_nbr = 0;
M_.ramsey_eq_nbr = 0;
M_.set_auxiliary_variables = exist(['./+' M_.fname '/set_auxiliary_variables.m'], 'file') == 2;
M_.epilogue_names = {};
M_.epilogue_var_list_ = {};
ModelNames_ = {};
ModelPriors_ = [];
ModelNames_ = { ModelNames_{:} '../NK/NK_financial'};
ModelPriors_ = [ ModelPriors_ ; 1];
ModelNames_ = { ModelNames_{:} '../GK/GK_financial'};
ModelPriors_ = [ ModelPriors_ ; 1];
ModelNames_ = { ModelNames_{:} '../BGG/BGG_financial'};
ModelPriors_ = [ ModelPriors_ ; 1];
oo_ = model_comparison(ModelNames_,ModelPriors_,oo_,options_,M_.fname);
save('Comparethem_results.mat', 'oo_', 'M_', 'options_');
if exist('estim_params_', 'var') == 1
  save('Comparethem_results.mat', 'estim_params_', '-append');
end
if exist('bayestopt_', 'var') == 1
  save('Comparethem_results.mat', 'bayestopt_', '-append');
end
if exist('dataset_', 'var') == 1
  save('Comparethem_results.mat', 'dataset_', '-append');
end
if exist('estimation_info', 'var') == 1
  save('Comparethem_results.mat', 'estimation_info', '-append');
end
if exist('dataset_info', 'var') == 1
  save('Comparethem_results.mat', 'dataset_info', '-append');
end
if exist('oo_recursive_', 'var') == 1
  save('Comparethem_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
