Commit d2127722 authored by Houtan Bastani's avatar Houtan Bastani
Browse files

MS-SBVAR: change state to regime to coincide with name previous name change

parent 402363ba
......@@ -81,21 +81,21 @@ mexErrCheck('ms_forecast',err);
% Plot Forecasts
if options_.ms.regimes
n_chains = length(options_.ms.ms_chain);
n_states=1;
n_regimes=1;
for i_chain=1:n_chains
n_states = n_states*length(options_.ms.ms_chain(i_chain).regime);
n_regimes = n_regimes*length(options_.ms.ms_chain(i_chain).regime);
end
for state_i=1:n_states
for regime_i=1:n_regimes
forecast_data = load([forecastdir filesep 'forecasts_percentiles_regime_' ...
num2str(state_i-1) '_' options_.ms.output_file_tag ...
num2str(regime_i-1) '_' options_.ms.output_file_tag ...
'.out'], '-ascii');
forecast_data = reshape_ascii_forecast_data(M_.endo_nbr, ...
percentiles_size, options_.ms.horizon, forecast_data);
save([forecastdir filesep 'forecast_state_' num2str(state_i-1)], ...
save([forecastdir filesep 'forecast_regime_' num2str(regime_i-1)], ...
'forecast_data');
plot_ms_forecast(M_, options_, forecast_data, ...
['Forecast, Regimes' num2str(state_i)], ...
['Forecast, Regimes' num2str(regime_i)], ...
options_.graph_save_formats, options_.TeX);
end
else
......@@ -103,7 +103,7 @@ else
forecast_data = load([forecastdir filesep 'forecasts_percentiles_regime_' ...
num2str(options_.ms.regime-1) '_' options_.ms.output_file_tag ...
'.out'], '-ascii');
forecast_title = ['Forecast, State ' num2str(options_.ms.regime)];
forecast_title = ['Forecast, Regime ' num2str(options_.ms.regime)];
save_filename = ['forecast_regime_' num2str(options_.ms.regime-1)];
else
forecast_data = load([forecastdir filesep 'forecasts_percentiles_' ...
......
......@@ -83,27 +83,27 @@ mexErrCheck('ms_irf',err);
% Plot IRFs
if options_.ms.regimes
n_chains = length(options_.ms.ms_chain);
n_states=1;
n_regimes=1;
for i_chain=1:n_chains
n_states = n_states*length(options_.ms.ms_chain(i_chain).regime);
n_regimes = n_regimes*length(options_.ms.ms_chain(i_chain).regime);
end
for state_i=1:n_states
for regime_i=1:n_regimes
irf_data = load([irfdir filesep 'ir_percentiles_regime_' ...
num2str(state_i-1) '_' options_.ms.output_file_tag ...
num2str(regime_i-1) '_' options_.ms.output_file_tag ...
'.out'], '-ascii');
irf_data = reshape_ascii_irf_data(M_.endo_nbr, percentiles_size, ...
options_.ms.horizon, irf_data);
save([irfdir filesep 'irf_state_' num2str(state_i-1)], 'irf_data');
save([irfdir filesep 'irf_regime_' num2str(regime_i-1)], 'irf_data');
plot_ms_irf(M_, options_, irf_data, ...
['Impulse Responses, State ' num2str(state_i)], varlist);
['Impulse Responses, Regime ' num2str(regime_i)], varlist);
end
else
if options_.ms.regime
irf_data = load([irfdir filesep 'ir_percentiles_regime_' ...
num2str(options_.ms.regime-1) '_' options_.ms.output_file_tag ...
'.out'], '-ascii');
irf_title = ['Impulse Response, State ' num2str(options_.ms.regime)];
irf_title = ['Impulse Response, Regime ' num2str(options_.ms.regime)];
save_filename = ['irf_regime_' num2str(options_.ms.regime-1)];
elseif options_.ms.filtered_probabilities
irf_data = load([irfdir filesep 'ir_percentiles_filtered_' ...
......
......@@ -96,24 +96,24 @@ end
% Create plots
if options_.ms.regimes
n_chains = length(options_.ms.ms_chain);
n_states=1;
n_regimes=1;
for i_chain=1:n_chains
n_states = n_states*length(options_.ms.ms_chain(i_chain).regime);
n_regimes = n_regimes*length(options_.ms.ms_chain(i_chain).regime);
end
for state_i=1:n_states
vd_data = load([outfile num2str(state_i-1) '_' ...
for regime_i=1:n_regimes
vd_data = load([outfile num2str(regime_i-1) '_' ...
options_.ms.output_file_tag '.out'], '-ascii');
vd_data = reshape_ascii_variance_decomposition_data( ...
M_.endo_nbr, percentiles_size, options_.ms.horizon, vd_data);
save([vddir filesep 'variance_decomposition_state_' num2str(state_i-1)], 'vd_data');
save([vddir filesep 'variance_decomposition_regime_' num2str(regime_i-1)], 'vd_data');
plot_ms_variance_decomposition(M_, options_, vd_data, ...
['Variance Decomposition, State ...' num2str(state_i)], ...
['Variance Decomposition, Regime ' num2str(regime_i)], ...
options_.graph_save_formats, options_.TeX);
end
else
if options_.ms.regime
vd_title = ['Variance Decomposition, State ' num2str(options_.ms.regime)];
vd_title = ['Variance Decomposition, Regime ' num2str(options_.ms.regime)];
save_filename = ['variance_decomposition_regime_' num2str(options_.ms.regime-1)];
else
save_filename = 'variance_decomposition';
......
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