MS-SBVAR: rework set_ms_estimation to match different meanings of file_tag
parent
385871957e
commit
742ed02718
|
@ -34,7 +34,7 @@ function [options_, oo_]=ms_compute_mdd(M_, options_, oo_)
|
||||||
disp('MS-SBVAR Marginal Data Density');
|
disp('MS-SBVAR Marginal Data Density');
|
||||||
options_ = set_file_tags(options_);
|
options_ = set_file_tags(options_);
|
||||||
clean_ms_mdd_files(options_.ms.output_file_tag, options_.ms.proposal_type);
|
clean_ms_mdd_files(options_.ms.output_file_tag, options_.ms.proposal_type);
|
||||||
[options_, oo_] = set_ms_estimation_file(options_, oo_);
|
[options_, oo_] = set_ms_estimation_file(options_.ms.file_tag, options_, oo_);
|
||||||
options_ = set_ms_simulation_file(options_);
|
options_ = set_ms_simulation_file(options_);
|
||||||
|
|
||||||
% setup command line options
|
% setup command line options
|
||||||
|
|
|
@ -34,7 +34,7 @@ function [options_, oo_]=ms_compute_probabilities(M_, options_, oo_)
|
||||||
disp('MS-SBVAR Compute Regime Probabilities');
|
disp('MS-SBVAR Compute Regime Probabilities');
|
||||||
options_ = set_file_tags(options_);
|
options_ = set_file_tags(options_);
|
||||||
clean_ms_probabilities_files(options_.ms.output_file_tag);
|
clean_ms_probabilities_files(options_.ms.output_file_tag);
|
||||||
[options_, oo_] = set_ms_estimation_file(options_, oo_);
|
[options_, oo_] = set_ms_estimation_file(options_.ms.file_tag, options_, oo_);
|
||||||
|
|
||||||
% setup command line options
|
% setup command line options
|
||||||
opt = ['-probabilities -seed ' num2str(options_.DynareRandomStreams.seed)];
|
opt = ['-probabilities -seed ' num2str(options_.DynareRandomStreams.seed)];
|
||||||
|
|
|
@ -70,7 +70,7 @@ opt = [opt ' -random_tol_parms ' num2str(options_.ms.random_parameter_convergenc
|
||||||
[err] = ms_sbvar_command_line(opt);
|
[err] = ms_sbvar_command_line(opt);
|
||||||
mexErrCheck('ms_estimation', err);
|
mexErrCheck('ms_estimation', err);
|
||||||
|
|
||||||
[options_, oo_] = set_ms_estimation_file(options_, oo_);
|
[options_, oo_] = set_ms_estimation_file(options_.ms.output_file_tag, options_, oo_);
|
||||||
[err, oo_.ms.A0, oo_.ms.Aplus, oo_.ms.Zeta, oo_.ms.Q] = ...
|
[err, oo_.ms.A0, oo_.ms.Aplus, oo_.ms.Zeta, oo_.ms.Q] = ...
|
||||||
mex_ms_convert_free_parameters({{'file_tag',options_.ms.output_file_tag}}, oo_.ms.maxparams);
|
mex_ms_convert_free_parameters({{'file_tag',options_.ms.output_file_tag}}, oo_.ms.maxparams);
|
||||||
mexErrCheck('mex_ms_convert_free_parameters', err);
|
mexErrCheck('mex_ms_convert_free_parameters', err);
|
||||||
|
|
|
@ -33,7 +33,7 @@ function [options_, oo_]=ms_forecast(M_, options_, oo_)
|
||||||
|
|
||||||
disp('MS-SBVAR Forecasts');
|
disp('MS-SBVAR Forecasts');
|
||||||
options_ = set_file_tags(options_);
|
options_ = set_file_tags(options_);
|
||||||
[options_, oo_] = set_ms_estimation_file(options_, oo_);
|
[options_, oo_] = set_ms_estimation_file(options_.ms.file_tag, options_, oo_);
|
||||||
options_ = set_ms_simulation_file(options_);
|
options_ = set_ms_simulation_file(options_);
|
||||||
clean_files_for_second_type_of_mex(M_, options_, 'forecast')
|
clean_files_for_second_type_of_mex(M_, options_, 'forecast')
|
||||||
forecastdir = [options_.ms.output_file_tag filesep 'Forecast'];
|
forecastdir = [options_.ms.output_file_tag filesep 'Forecast'];
|
||||||
|
|
|
@ -34,7 +34,7 @@ function [options_, oo_]=ms_irf(varlist,M_, options_, oo_)
|
||||||
|
|
||||||
disp('MS-SBVAR Impulse Response Function');
|
disp('MS-SBVAR Impulse Response Function');
|
||||||
options_ = set_file_tags(options_);
|
options_ = set_file_tags(options_);
|
||||||
[options_, oo_] = set_ms_estimation_file(options_, oo_);
|
[options_, oo_] = set_ms_estimation_file(options_.ms.file_tag, options_, oo_);
|
||||||
options_ = set_ms_simulation_file(options_);
|
options_ = set_ms_simulation_file(options_);
|
||||||
clean_files_for_second_type_of_mex(M_, options_, 'irf')
|
clean_files_for_second_type_of_mex(M_, options_, 'irf')
|
||||||
irfdir = [options_.ms.output_file_tag filesep 'IRF'];
|
irfdir = [options_.ms.output_file_tag filesep 'IRF'];
|
||||||
|
|
|
@ -34,7 +34,7 @@ function [options_, oo_]=ms_simulation(M_, options_, oo_)
|
||||||
disp('MS-SBVAR Simulation');
|
disp('MS-SBVAR Simulation');
|
||||||
options_ = set_file_tags(options_);
|
options_ = set_file_tags(options_);
|
||||||
clean_ms_simulation_files(options_.ms.output_file_tag);
|
clean_ms_simulation_files(options_.ms.output_file_tag);
|
||||||
[options_, oo_] = set_ms_estimation_file(options_, oo_);
|
[options_, oo_] = set_ms_estimation_file(options_.ms.file_tag, options_, oo_);
|
||||||
|
|
||||||
% setup command line options
|
% setup command line options
|
||||||
opt = ['-simulate -seed ' num2str(options_.DynareRandomStreams.seed)];
|
opt = ['-simulate -seed ' num2str(options_.DynareRandomStreams.seed)];
|
||||||
|
|
|
@ -33,7 +33,7 @@ function [options_, oo_]=ms_variance_decomposition(M_, options_, oo_)
|
||||||
|
|
||||||
disp('MS-SBVAR Variance Decomposition');
|
disp('MS-SBVAR Variance Decomposition');
|
||||||
options_ = set_file_tags(options_);
|
options_ = set_file_tags(options_);
|
||||||
[options_, oo_] = set_ms_estimation_file(options_, oo_);
|
[options_, oo_] = set_ms_estimation_file(options_.ms.file_tag, options_, oo_);
|
||||||
options_ = set_ms_simulation_file(options_);
|
options_ = set_ms_simulation_file(options_);
|
||||||
clean_files_for_second_type_of_mex(M_, options_, 'variance_decomposition')
|
clean_files_for_second_type_of_mex(M_, options_, 'variance_decomposition')
|
||||||
vddir = [options_.ms.output_file_tag filesep 'Variance_Decomposition'];
|
vddir = [options_.ms.output_file_tag filesep 'Variance_Decomposition'];
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
function [options_, oo_]=set_ms_estimation_file(options_, oo_)
|
function [options_, oo_]=set_ms_estimation_file(file_tag, options_, oo_)
|
||||||
%function set_ms_estimation_file()
|
%function set_ms_estimation_file()
|
||||||
% Set options_.ms.free_param_file based on user input
|
% Set options_.ms.free_param_file based on user input
|
||||||
%
|
%
|
||||||
% INPUTS
|
% INPUTS
|
||||||
|
% file_tag: (string) necessary because of different meanings of
|
||||||
|
% file_tag between ms_estimation and other ms_*
|
||||||
|
% routines
|
||||||
% options_: (struct) options
|
% options_: (struct) options
|
||||||
% oo_: (struct) results
|
% oo_: (struct) results
|
||||||
%
|
%
|
||||||
|
@ -30,7 +33,7 @@ function [options_, oo_]=set_ms_estimation_file(options_, oo_)
|
||||||
% You should have received a copy of the GNU General Public License
|
% You should have received a copy of the GNU General Public License
|
||||||
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
|
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
options_.ms.free_param_file = ['est_free_' options_.ms.file_tag '.out'];
|
options_.ms.free_param_file = ['est_free_' file_tag '.out'];
|
||||||
if ~exist(options_.ms.free_param_file,'file')
|
if ~exist(options_.ms.free_param_file,'file')
|
||||||
error(['ERROR: Could not find free parameter file: ' options_.ms.free_param_file]);
|
error(['ERROR: Could not find free parameter file: ' options_.ms.free_param_file]);
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue