From de90c5d2462340b0a233dc3d71a44bf4bc4a2edb Mon Sep 17 00:00:00 2001
From: Johannes Pfeifer <jpfeifer@gmx.de>
Date: Fri, 10 Dec 2021 14:13:19 +0100
Subject: [PATCH] Provide warning if moments_varendo is not set but
 conditional_variance_decomposition

---
 matlab/initial_estimation_checks.m | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/matlab/initial_estimation_checks.m b/matlab/initial_estimation_checks.m
index 2df6dd3ebd..b684fa1db1 100644
--- a/matlab/initial_estimation_checks.m
+++ b/matlab/initial_estimation_checks.m
@@ -310,6 +310,10 @@ if DynareOptions.mh_tune_jscale.status && (DynareOptions.mh_tune_jscale.maxiter<
     warning('You specified mh_tune_jscale, but the maximum number of iterations is smaller than the step size. No update will take place.')
 end
 
+if ~isempty(DynareOptions.conditional_variance_decomposition) && ~DynareOptions.moments_varendo
+    disp('The conditional_variance_decomposition-option will be ignored. You need to set moments_varendo');
+end
+
 function evaluate_expression(expression,M_,oo_)
 % function evaluate_expression(expression,M_,oo_)
 %evaluates expressions relying on M_ and oo_ having their original names
-- 
GitLab