From 329f0d2d54247ea11ddf1b5578f37f379eef0da8 Mon Sep 17 00:00:00 2001
From: Willi Mutschler <willi@mutschler.eu>
Date: Fri, 15 Dec 2023 15:59:17 +0100
Subject: [PATCH] method_of_moments: Remove unused output from IRF Matching for
 GMM/SMM

---
 matlab/+mom/run.m | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/matlab/+mom/run.m b/matlab/+mom/run.m
index 15c9c3bce3..c53d3aece5 100644
--- a/matlab/+mom/run.m
+++ b/matlab/+mom/run.m
@@ -819,6 +819,11 @@ if isoctave && isfield(options_mom_, 'prior_restrictions') && ...
     % See https://savannah.gnu.org/bugs/?43215
     options_mom_.prior_restrictions.routine = [];
 end
+if strcmp(options_mom_.mom.mom_method,'SMM') || strcmp(options_mom_.mom.mom_method,'GMM')
+    if isfield(oo_.mom,'irf_model_varobs') && isempty(oo_.mom.irf_model_varobs)
+        oo_.mom = rmfield(oo_.mom,'irf_model_varobs'); % remove empty field
+    end
+end
 if strcmp(options_mom_.mom.mom_method,'IRF_MATCHING') && ~isempty(options_mom_.mom.irf_matching_file.path) && ~strcmp(options_mom_.mom.irf_matching_file.path,'.')
     rmpath(options_mom_.irf_matching_file.path); % remove path to irf_matching_file
 end
\ No newline at end of file
-- 
GitLab