Commit 8ac06f93 authored by Houtan Bastani's avatar Houtan Bastani
Browse files

MS-SBVAR: reinitialize options before calls to mssbvar functions

parent 0f001abb
......@@ -80,5 +80,4 @@ if exist(mdd_filename,'file')
oo_.ms.mueller_log_mdd = muller_mdd;
oo_.ms.bridged_log_mdd = bridge_mdd;
end
options_ = initialize_ms_sbvar_options(M_, options_);
end
......@@ -61,5 +61,4 @@ if ischar(prob_out_file)
computed_probabilities = load(prob_out_file);
plot_ms_probabilities(computed_probabilities,options_);
end
options_ = initialize_ms_sbvar_options(M_, options_);
end
......@@ -70,5 +70,4 @@ mexErrCheck('ms_estimation', err);
[err, oo_.ms.A0, oo_.ms.Aplus, oo_.ms.Zeta, oo_.ms.Q] = ...
mex_ms_convert_free_parameters(options_.ms.estimation_file_tag, oo_.ms.maxparams);
mexErrCheck('mex_ms_convert_free_parameters', err);
options_ = initialize_ms_sbvar_options(M_, options_);
end
......@@ -66,5 +66,4 @@ if exist(options_.ms.mh_file,'file') > 0
mexErrCheck('mex_ms_forecast bayesian regimes ', err);
save([forecastdir filesep 'bayesian_forecast.mat'], 'forecast', 'regime_forecast');
end
options_ = initialize_ms_sbvar_options(M_, options_);
end
......@@ -75,5 +75,4 @@ if exist(options_.ms.mh_file,'file') > 0
end
save([irfdir filesep 'bayesian_irf.mat'], 'irf', 'regime_irfs');
end
options_ = initialize_ms_sbvar_options(M_, options_);
end
......@@ -48,6 +48,4 @@ opt = [opt ' -mh ' num2str(options_.ms.adaptive_mh_draws)];
% simulation
[err] = ms_sbvar_command_line(opt);
mexErrCheck('ms_simulation',err);
options_ = initialize_ms_sbvar_options(M_, options_);
end
......@@ -66,5 +66,4 @@ if exist(options_.ms.mh_file,'file') > 0
mexErrCheck('mex_ms_variance_decomposition bayesian regimes ', err);
save([vddir filesep 'bayesian_vd.mat'], 'vd', 'regime_vd');
end
options_ = initialize_ms_sbvar_options(M_, options_);
end
......@@ -942,6 +942,7 @@ MSSBVAREstimationStatement::checkPass(ModFileStructure &mod_file_struct)
void
MSSBVAREstimationStatement::writeOutput(ostream &output, const string &basename) const
{
output << "options_ = initialize_ms_sbvar_options(M_, options_);" << endl;
options_list.writeOutput(output);
output << "[options_, oo_] = ms_estimation(M_, options_, oo_);" << endl;
}
......@@ -960,6 +961,7 @@ MSSBVARSimulationStatement::checkPass(ModFileStructure &mod_file_struct)
void
MSSBVARSimulationStatement::writeOutput(ostream &output, const string &basename) const
{
output << "options_ = initialize_ms_sbvar_options(M_, options_);" << endl;
options_list.writeOutput(output);
output << "[options_, oo_] = ms_simulation(M_, options_, oo_);" << endl;
}
......@@ -978,6 +980,7 @@ MSSBVARComputeMDDStatement::checkPass(ModFileStructure &mod_file_struct)
void
MSSBVARComputeMDDStatement::writeOutput(ostream &output, const string &basename) const
{
output << "options_ = initialize_ms_sbvar_options(M_, options_);" << endl;
options_list.writeOutput(output);
output << "[options_, oo_] = ms_compute_mdd(M_, options_, oo_);" << endl;
}
......@@ -996,6 +999,7 @@ MSSBVARComputeProbabilitiesStatement::checkPass(ModFileStructure &mod_file_struc
void
MSSBVARComputeProbabilitiesStatement::writeOutput(ostream &output, const string &basename) const
{
output << "options_ = initialize_ms_sbvar_options(M_, options_);" << endl;
options_list.writeOutput(output);
output << "[options_, oo_] = ms_compute_probabilities(M_, options_, oo_);" << endl;
}
......@@ -1016,6 +1020,7 @@ MSSBVARIrfStatement::checkPass(ModFileStructure &mod_file_struct)
void
MSSBVARIrfStatement::writeOutput(ostream &output, const string &basename) const
{
output << "options_ = initialize_ms_sbvar_options(M_, options_);" << endl;
symbol_list.writeOutput("var_list_", output);
options_list.writeOutput(output);
output << "[options_, oo_] = ms_irf(var_list_,M_, options_, oo_);" << endl;
......@@ -1035,6 +1040,7 @@ MSSBVARForecastStatement::checkPass(ModFileStructure &mod_file_struct)
void
MSSBVARForecastStatement::writeOutput(ostream &output, const string &basename) const
{
output << "options_ = initialize_ms_sbvar_options(M_, options_);" << endl;
options_list.writeOutput(output);
output << "[options_, oo_] = ms_forecast(M_, options_, oo_);" << endl;
}
......@@ -1053,6 +1059,7 @@ MSSBVARVarianceDecompositionStatement::checkPass(ModFileStructure &mod_file_stru
void
MSSBVARVarianceDecompositionStatement::writeOutput(ostream &output, const string &basename) const
{
output << "options_ = initialize_ms_sbvar_options(M_, options_);" << endl;
options_list.writeOutput(output);
output << "[options_, oo_] = ms_variance_decomposition(M_, options_, oo_);" << endl;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment