diff --git a/matlab/dynare_estimation_init.m b/matlab/dynare_estimation_init.m index ac4c85bc1..c0d1846a8 100644 --- a/matlab/dynare_estimation_init.m +++ b/matlab/dynare_estimation_init.m @@ -301,7 +301,7 @@ if options_.use_calibration_initialization %set calibration as starting values [xparam1,estim_params_]=do_parameter_initialization(estim_params_,xparam1_calib,xparam1); %get explicitly initialized parameters that have precedence to calibrated values end -if ~isempty(estim_params_) +if ~isempty(estim_params_) && ~strmatch(fieldnames(estim_params_),'full_calibration_detected') if ~isempty(bayestopt_) && any(bayestopt_.pshape > 0) % Plot prior densities. if ~options_.nograph && options_.plot_priors @@ -332,7 +332,7 @@ if ~isempty(estim_params_) end end -if isempty(estim_params_)% If estim_params_ is empty (e.g. when running the smoother on a calibrated model) +if isempty(estim_params_) || strmatch(fieldnames(estim_params_),'full_calibration_detected')% If estim_params_ is empty (e.g. when running the smoother on a calibrated model) if ~options_.smoother error('Estimation: the ''estimated_params'' block is mandatory (unless you are running a smoother)') end diff --git a/matlab/get_all_parameters.m b/matlab/get_all_parameters.m index f030d14fe..f92415770 100644 --- a/matlab/get_all_parameters.m +++ b/matlab/get_all_parameters.m @@ -32,11 +32,19 @@ function xparam1=get_all_parameters(estim_params_,M_) % You should have received a copy of the GNU General Public License % along with Dynare. If not, see . -nvx = estim_params_.nvx; -ncx = estim_params_.ncx; -nvn = estim_params_.nvn; -ncn = estim_params_.ncn; -np = estim_params_.np; +if ~isempty(estim_params_) + nvx = estim_params_.nvx; + ncx = estim_params_.ncx; + nvn = estim_params_.nvn; + ncn = estim_params_.ncn; + np = estim_params_.np; +else + nvx = 0; + ncx = 0; + nvn = 0; + ncn = 0; + np = 0; +end Sigma_e = M_.Sigma_e; Correlation_matrix = M_.Correlation_matrix; H = M_.H;