diff --git a/matlab/+occbin/IVF_posterior.m b/matlab/+occbin/IVF_posterior.m index 5959d8ba136927d00de80d30ca48939553e8c6ea..2783e2b1c492e80aea94bc6c63da10958ba988df 100644 --- a/matlab/+occbin/IVF_posterior.m +++ b/matlab/+occbin/IVF_posterior.m @@ -106,7 +106,14 @@ filtered_errs_init = zeros(sample_length,sum(err_index)); if info(1) fval = Inf; exit_flag = 0; + atT=NaN(size(stateval(:,DynareResults.dr.order_var)')); + innov=NaN(Model.exo_nbr,sample_length); return +else + atT = stateval(:,DynareResults.dr.order_var)'; + innov = zeros(Model.exo_nbr,sample_length); + innov(diag(Model.Sigma_e)~=0,:)=filtered_errs'; + updated_variables = atT*nan; end nobs=size(filtered_errs,1); @@ -185,10 +192,7 @@ end % remember that the likelihood has already been multiplied by -1 % hence, posterior is -1 times the log of the prior fval = like+prior; -atT = stateval(:,DynareResults.dr.order_var)'; -innov = zeros(Model.exo_nbr,sample_length); -innov(diag(Model.Sigma_e)~=0,:)=filtered_errs'; -updated_variables = atT*nan; + BayesInfo.mf = BayesInfo.smoother_var_list(BayesInfo.smoother_mf);