From cb25cda377965f5339b0cb2b77e58cf070b7e8fe Mon Sep 17 00:00:00 2001
From: Marco Ratto <marco.ratto@ec.europa.eu>
Date: Tue, 26 Jul 2022 18:07:39 +0200
Subject: [PATCH] bug fix for smoother_redux and state uncertainty with OCCBIN

(cherry picked from commit 6d03a654880d767603926e868e89361618db8a30)
---
 matlab/DsgeSmoother.m | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/matlab/DsgeSmoother.m b/matlab/DsgeSmoother.m
index abc46dbe8c..7e5e1e2c87 100644
--- a/matlab/DsgeSmoother.m
+++ b/matlab/DsgeSmoother.m
@@ -478,8 +478,9 @@ else
         end
         
         if ~isempty(state_uncertainty)
+            mm=size(T,1);
             sstate_uncertainty=zeros(M_.endo_nbr,M_.endo_nbr,gend);
-            sstate_uncertainty(oo_.dr.restrict_var_list,oo_.dr.restrict_var_list,:)=state_uncertainty;
+            sstate_uncertainty(oo_.dr.restrict_var_list,oo_.dr.restrict_var_list,:)=state_uncertainty(1:mm,1:mm,:);
             state_uncertainty=sstate_uncertainty;
             clear sstate_uncertainty
         end
-- 
GitLab