From 80f6799c38293bdb7d72ac67be071ce3926dd2ee Mon Sep 17 00:00:00 2001
From: Johannes Pfeifer <jpfeifer@gmx.de>
Date: Wed, 23 Nov 2022 16:44:18 +0100
Subject: [PATCH] IVF: only store smoother results if requested

---
 matlab/+occbin/IVF_posterior.m | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/matlab/+occbin/IVF_posterior.m b/matlab/+occbin/IVF_posterior.m
index 2783e2b1c4..db4d51ec06 100644
--- a/matlab/+occbin/IVF_posterior.m
+++ b/matlab/+occbin/IVF_posterior.m
@@ -113,7 +113,6 @@ 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);
 
@@ -191,12 +190,4 @@ end
 
 % remember that the likelihood has already been multiplied by -1
 % hence, posterior is -1 times the log of the prior
-fval = like+prior;
-
-BayesInfo.mf = BayesInfo.smoother_var_list(BayesInfo.smoother_mf);
-
-
-initDynareOptions=DynareOptions;
-DynareOptions.nk=[]; %unset options_.nk and reset it later
-[DynareResults]=store_smoother_results(Model,DynareResults,DynareOptions,BayesInfo,dataset_,obs_info,atT,innov,[],updated_variables,DynareResults.dr.ys,zeros(length(DynareOptions.varobs_id),1));
-DynareOptions=initDynareOptions;
+fval = like+prior;
\ No newline at end of file
-- 
GitLab