0001 function [options_, oo_]=ms_estimation(M_, options_, oo_)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034 disp('MS-SBVAR Estimation');
0035 options_ = set_file_tags(options_);
0036
0037
0038 if options_.ms.create_init
0039 clean_ms_init_files(options_.ms.file_tag);
0040 ms_sbvar_setup(options_);
0041 clean_ms_estimation_files(options_.ms.file_tag);
0042 clean_ms_estimation_files(options_.ms.output_file_tag);
0043 else
0044 if ~strcmp(options_.ms.file_tag, options_.ms.output_file_tag)
0045 clean_ms_estimation_files(options_.ms.output_file_tag);
0046 end
0047 end
0048
0049
0050 opt = ['-estimate -seed ' num2str(options_.DynareRandomStreams.seed)];
0051 opt = [opt ' -ft ' options_.ms.file_tag];
0052 opt = [opt ' -fto ' options_.ms.output_file_tag];
0053 opt = [opt ' -cb ' num2str(options_.ms.convergence_starting_value)];
0054 opt = [opt ' -ce ' num2str(options_.ms.convergence_ending_value)];
0055 opt = [opt ' -ci ' num2str(options_.ms.convergence_increment_value)];
0056 opt = [opt ' -ib ' num2str(options_.ms.max_iterations_starting_value)];
0057 opt = [opt ' -ii ' num2str(options_.ms.max_iterations_increment_value)];
0058 opt = [opt ' -mb ' num2str(options_.ms.max_block_iterations)];
0059 opt = [opt ' -repeat_max ' num2str(options_.ms.max_repeated_optimization_runs)];
0060 opt = [opt ' -repeat_tol_obj ' num2str(options_.ms.function_convergence_criterion)];
0061 opt = [opt ' -repeat_tol_parms ' num2str(options_.ms.parameter_convergence_criterion)];
0062 opt = [opt ' -random ' num2str(options_.ms.number_of_large_perturbations)];
0063 opt = [opt ' -random_small ' num2str(options_.ms.number_of_small_perturbations)];
0064 opt = [opt ' -random_small_ndraws ' num2str(options_.ms.number_of_posterior_draws_after_perturbation)];
0065 opt = [opt ' -random_max ' num2str(options_.ms.max_number_of_stages)];
0066 opt = [opt ' -random_tol_obj ' num2str(options_.ms.random_function_convergence_criterion)];
0067 opt = [opt ' -random_tol_parms ' num2str(options_.ms.random_parameter_convergence_criterion)];
0068
0069
0070 [err] = ms_sbvar_command_line(opt);
0071 mexErrCheck('ms_estimation', err);
0072
0073 [options_, oo_] = set_ms_estimation_file(options_.ms.output_file_tag, options_, oo_);
0074 end