2007-06-06 14:45:37 +02:00
|
|
|
function global_initialization()
|
2008-08-01 14:40:33 +02:00
|
|
|
%function global_initialization()
|
2008-01-16 16:35:02 +01:00
|
|
|
% initializes global variables and options for DYNARE
|
|
|
|
%
|
|
|
|
% INPUTS
|
|
|
|
% none
|
|
|
|
%
|
|
|
|
% OUTPUTS
|
|
|
|
% none
|
|
|
|
%
|
|
|
|
% SPECIAL REQUIREMENTS
|
|
|
|
% none
|
2008-08-01 14:40:33 +02:00
|
|
|
|
2017-10-10 10:05:59 +02:00
|
|
|
% Copyright (C) 2003-2018 Dynare Team
|
2008-08-01 14:40:33 +02:00
|
|
|
%
|
|
|
|
% This file is part of Dynare.
|
|
|
|
%
|
|
|
|
% Dynare is free software: you can redistribute it and/or modify
|
|
|
|
% it under the terms of the GNU General Public License as published by
|
|
|
|
% the Free Software Foundation, either version 3 of the License, or
|
|
|
|
% (at your option) any later version.
|
|
|
|
%
|
|
|
|
% Dynare is distributed in the hope that it will be useful,
|
|
|
|
% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
% GNU General Public License for more details.
|
|
|
|
%
|
|
|
|
% You should have received a copy of the GNU General Public License
|
|
|
|
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2015-04-04 19:22:49 +02:00
|
|
|
global oo_ M_ options_ estim_params_ bayestopt_ estimation_info ex0_ ys0_ dataset_ dataset_info
|
2011-01-13 11:36:48 +01:00
|
|
|
estim_params_ = [];
|
2011-10-31 18:25:15 +01:00
|
|
|
bayestopt_ = [];
|
2015-04-04 19:22:49 +02:00
|
|
|
dataset_=[];
|
|
|
|
dataset_info=[];
|
2015-05-07 15:59:46 +02:00
|
|
|
|
2018-05-25 17:14:26 +02:00
|
|
|
M_.dname = M_.fname;
|
2012-04-20 17:08:02 +02:00
|
|
|
M_.bvar = [];
|
2011-12-16 11:40:36 +01:00
|
|
|
|
2012-04-02 17:01:19 +02:00
|
|
|
estimation_info.empty_prior = struct(...
|
2012-04-02 17:54:05 +02:00
|
|
|
'domain', [], 'interval', [], 'mean', [], ...
|
|
|
|
'median', [], 'mode', [], 'shape', [], ...
|
|
|
|
'shift', [], 'stdev', [], 'truncate', [], 'variance', []);
|
2012-04-02 17:01:19 +02:00
|
|
|
estimation_info.empty_options = struct(...
|
2012-04-02 17:54:05 +02:00
|
|
|
'bounds',[], 'init', [], 'jscale', []);
|
|
|
|
estimation_info.subsamples.range = struct('date1', [], 'date2', []);
|
2012-04-02 17:03:43 +02:00
|
|
|
estimation_info.parameter.prior = estimation_info.empty_prior;
|
|
|
|
estimation_info.parameter.subsample_prior = estimation_info.empty_prior;
|
|
|
|
estimation_info.parameter.options = estimation_info.empty_options;
|
|
|
|
estimation_info.parameter.subsample_options = estimation_info.empty_options;
|
2012-04-02 17:01:19 +02:00
|
|
|
estimation_info.structural_innovation.prior = estimation_info.empty_prior;
|
|
|
|
estimation_info.structural_innovation.subsample_prior = estimation_info.empty_prior;
|
|
|
|
estimation_info.structural_innovation.options = estimation_info.empty_options;
|
|
|
|
estimation_info.structural_innovation.subsample_options = estimation_info.empty_options;
|
|
|
|
estimation_info.structural_innovation_corr.prior = estimation_info.empty_prior;
|
|
|
|
estimation_info.structural_innovation_corr.subsample_prior = estimation_info.empty_prior;
|
|
|
|
estimation_info.structural_innovation_corr.options = estimation_info.empty_options;
|
|
|
|
estimation_info.structural_innovation_corr.subsample_options = estimation_info.empty_options;
|
|
|
|
estimation_info.measurement_error.prior = estimation_info.empty_prior;
|
|
|
|
estimation_info.measurement_error.subsample_prior = estimation_info.empty_prior;
|
|
|
|
estimation_info.measurement_error.options = estimation_info.empty_options;
|
|
|
|
estimation_info.measurement_error.subsample_options = estimation_info.empty_options;
|
|
|
|
estimation_info.measurement_error_corr.prior = estimation_info.empty_prior;
|
|
|
|
estimation_info.measurement_error_corr.subsample_prior = estimation_info.empty_prior;
|
|
|
|
estimation_info.measurement_error_corr.options = estimation_info.empty_options;
|
|
|
|
estimation_info.measurement_error_corr.subsample_options = estimation_info.empty_options;
|
2012-03-28 16:19:10 +02:00
|
|
|
estimation_info.subsamples_index = {};
|
|
|
|
estimation_info.subsamples.range_index = {};
|
2012-03-29 15:21:32 +02:00
|
|
|
estimation_info.parameter_prior_index = {};
|
2012-03-29 16:45:46 +02:00
|
|
|
estimation_info.parameter_options_index = {};
|
2012-04-02 17:03:43 +02:00
|
|
|
estimation_info.parameter.range_index = {};
|
2012-03-29 15:21:32 +02:00
|
|
|
estimation_info.measurement_error_prior_index = {};
|
|
|
|
estimation_info.measurement_error_options_index = {};
|
|
|
|
estimation_info.measurement_error.range_index = {};
|
2012-03-29 16:45:46 +02:00
|
|
|
estimation_info.structural_innovation_prior_index = {};
|
2012-03-29 15:21:32 +02:00
|
|
|
estimation_info.structural_innovation_options_index = {};
|
|
|
|
estimation_info.structural_innovation.range_index = {};
|
2012-03-29 16:45:46 +02:00
|
|
|
estimation_info.measurement_error_corr_prior_index = {};
|
2012-03-29 15:21:32 +02:00
|
|
|
estimation_info.measurement_error_corr_options_index = {};
|
|
|
|
estimation_info.measurement_error_corr.range_index = {};
|
2012-03-29 16:45:46 +02:00
|
|
|
estimation_info.structural_innovation_corr_prior_index = {};
|
2012-03-29 15:21:32 +02:00
|
|
|
estimation_info.structural_innovation_corr_options_index = {};
|
|
|
|
estimation_info.structural_innovation_corr.range_index = {};
|
2015-03-03 15:08:33 +01:00
|
|
|
estimation_info.joint_parameter_prior_index = {};
|
2015-03-09 17:58:06 +01:00
|
|
|
estimation_info.joint_parameter = {'index','domain','interval','mean','median','mode','shape','shift','stdev','truncate','variance'};
|
2014-07-21 12:45:49 +02:00
|
|
|
|
2009-12-16 18:17:34 +01:00
|
|
|
oo_.exo_simul = [];
|
|
|
|
oo_.endo_simul = [];
|
2012-03-17 20:34:58 +01:00
|
|
|
ys0_ = [];
|
|
|
|
ex0_ = [];
|
2009-12-16 18:17:34 +01:00
|
|
|
oo_.dr = [];
|
|
|
|
oo_.exo_steady_state = [];
|
|
|
|
oo_.exo_det_steady_state = [];
|
|
|
|
oo_.exo_det_simul = [];
|
2008-03-24 09:56:48 +01:00
|
|
|
|
2009-12-16 18:17:34 +01:00
|
|
|
M_.params = [];
|
2011-12-28 11:11:06 +01:00
|
|
|
M_.endo_histval = [];
|
2015-07-29 15:41:17 +02:00
|
|
|
M_.exo_histval = [];
|
|
|
|
M_.exo_det_histval = [];
|
2012-06-06 18:24:03 +02:00
|
|
|
M_.Correlation_matrix = [];
|
2013-03-19 21:12:49 +01:00
|
|
|
M_.Correlation_matrix_ME = [];
|
2015-07-30 14:40:03 +02:00
|
|
|
M_.parameter_used_with_lead_lag = false;
|
2009-08-25 11:43:01 +02:00
|
|
|
|
2016-02-23 14:32:48 +01:00
|
|
|
M_.xref1.param = {};
|
2015-12-18 15:17:32 +01:00
|
|
|
M_.xref1.endo = {};
|
|
|
|
M_.xref1.exo = {};
|
|
|
|
M_.xref1.exo_det = {};
|
|
|
|
|
2016-02-23 14:32:48 +01:00
|
|
|
M_.xref2.param = {};
|
2015-12-18 17:13:50 +01:00
|
|
|
M_.xref2.endo = {};
|
|
|
|
M_.xref2.exo = {};
|
|
|
|
M_.xref2.exo_det = {};
|
|
|
|
|
2016-05-20 19:58:35 +02:00
|
|
|
M_.osr.param_names={};
|
|
|
|
M_.osr.param_indices=[];
|
|
|
|
M_.osr.param_bounds=[];
|
|
|
|
M_.osr.variable_weights=[];
|
|
|
|
M_.osr.variable_indices =[];
|
|
|
|
|
2020-02-12 12:59:34 +01:00
|
|
|
M_.instr_id=[];
|
2018-05-28 14:32:11 +02:00
|
|
|
% Set default options_ in function below; this change was made for the GUI
|
2018-05-25 17:14:26 +02:00
|
|
|
options_ = default_option_values(M_);
|
2017-09-09 08:42:08 +02:00
|
|
|
|
2010-02-08 08:40:36 +01:00
|
|
|
% initialize persistent variables in priordens()
|
|
|
|
priordens([],[],[],[],[],[],1);
|
2012-07-19 17:08:42 +02:00
|
|
|
% initialize persistent variables in dyn_first_order_solver()
|
|
|
|
dyn_first_order_solver();
|
2010-11-26 17:16:12 +01:00
|
|
|
|
|
|
|
% Set dynare random generator and seed.
|
2010-12-08 12:03:53 +01:00
|
|
|
set_dynare_seed('default');
|
|
|
|
|
2014-07-08 13:53:03 +02:00
|
|
|
|
2011-05-30 15:47:34 +02:00
|
|
|
% Create directories
|
2018-11-13 17:58:42 +01:00
|
|
|
[~,~]=mkdir(M_.fname);
|
|
|
|
[~,~]=mkdir([M_.fname filesep 'Output']);
|
2012-05-09 15:39:58 +02:00
|
|
|
|
|
|
|
% Load user configuration file.
|
2012-06-06 16:07:59 +02:00
|
|
|
if isfield(options_, 'global_init_file')
|
|
|
|
run(options_.global_init_file);
|
|
|
|
end
|