Skip to content
Snippets Groups Projects
Commit f2045e22 authored by Johannes Pfeifer's avatar Johannes Pfeifer
Browse files

:bug: smoother: do not attempt plotting if OccBin smoother did not return results

Incidentally remove calling store_smoother_results twice
parent 13544b51
Branches
Tags
1 merge request!2322calib_smoother: enable plots
......@@ -34,11 +34,12 @@ function oo_=save_display_classical_smoother_results(xparam1,M_,oo_,options_,bay
gend= dataset_.nobs;
% Set the number of observed variables.
n_varobs = length(options_.varobs);
smoother_error=false;
if options_.occbin.smoother.status && options_.occbin.smoother.inversion_filter
[~, info, ~, ~, ~, ~, ~, ~, ~, ~, oo_.dr, atT, innov, oo_.occbin.smoother.regime_history] = occbin.IVF_posterior(xparam1,dataset_,dataset_info,options_,M_,estim_params_,bayestopt_,prior_bounds(bayestopt_,options_.prior_trunc),oo_.dr, oo_.steady_state,oo_.exo_steady_state,oo_.exo_det_steady_state);
if ismember(info(1),[303,304,306])
fprintf('\nIVF: smoother did not succeed. No results will be written to oo_.\n')
smoother_error=true;
else
updated_variables = atT*nan;
measurement_error=[];
......@@ -54,16 +55,17 @@ else
if options_.occbin.smoother.status
[atT,innov,measurement_error,updated_variables,ys,trend_coeff,aK,~,~,P,PK,decomp,Trend,state_uncertainty,oo_,bayestopt_] = occbin.DSGE_smoother(xparam1,dataset_.nobs,transpose(dataset_.data),dataset_info.missing.aindex,dataset_info.missing.state,M_,oo_,options_,bayestopt_,estim_params_,dataset_,dataset_info);
if oo_.occbin.smoother.error_flag(1)==0
oo_ = store_smoother_results(M_,oo_,options_,bayestopt_,dataset_,dataset_info,atT,innov,measurement_error,updated_variables,ys,trend_coeff,aK,P,PK,decomp,Trend,state_uncertainty);
[oo_, yf] = store_smoother_results(M_,oo_,options_,bayestopt_,dataset_,dataset_info,atT,innov,measurement_error,updated_variables,ys,trend_coeff,aK,P,PK,decomp,Trend,state_uncertainty);
else
smoother_error=true;
fprintf('\nOccbin: smoother did not succeed. No results will be written to oo_.\n')
end
else
[atT,innov,measurement_error,updated_variables,ys,trend_coeff,aK,~,~,P,PK,decomp,Trend,state_uncertainty,oo_,bayestopt_] = DsgeSmoother(xparam1,dataset_.nobs,transpose(dataset_.data),dataset_info.missing.aindex,dataset_info.missing.state,M_,oo_,options_,bayestopt_,estim_params_);
oo_ = store_smoother_results(M_,oo_,options_,bayestopt_,dataset_,dataset_info,atT,innov,measurement_error,updated_variables,ys,trend_coeff,aK,P,PK,decomp,Trend,state_uncertainty);
end
[oo_,yf]=store_smoother_results(M_,oo_,options_,bayestopt_,dataset_,dataset_info,atT,innov,measurement_error,updated_variables,ys,trend_coeff,aK,P,PK,decomp,Trend,state_uncertainty);
end
end
if ~smoother_error
if ~options_.nograph
[nbplt,nr,nc,~,~,nstar] = pltorg(M_.exo_nbr);
if ~exist([M_.dname '/graphs'],'dir')
......@@ -250,3 +252,4 @@ if ~options_.nograph
fclose(fidTeX);
end
end
end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment