diff --git a/matlab/compute_moments_varendo.m b/matlab/compute_moments_varendo.m
index e03a25cb3e949dd82b5819a5dbde889ccaf2cbc3..fba59b6fb36616011e3c6300abcbac48000af20c 100644
--- a/matlab/compute_moments_varendo.m
+++ b/matlab/compute_moments_varendo.m
@@ -37,6 +37,22 @@ function oo_ = compute_moments_varendo(type, options_, M_, oo_, var_list_)
 
 fprintf('Estimation::compute_moments_varendo: I''m computing endogenous moments (this may take a while)... \n');
 
+if options_.order==1
+    if options_.one_sided_hp_filter
+        fprintf('Estimation::compute_moments_varendo: theoretical moments incompatible with one-sided HP filter. Skipping computations.\n')
+        return
+    end
+else
+    if ~options_.pruning
+        fprintf('Estimation::compute_moments_varendo: theoretical moments at order>1 require pruning. Skipping computations.\n')
+        return
+    else
+        if options_.one_sided_hp_filter || options_.hp_filter || options_.bandpass.indicator
+            fprintf(['Estimation::compute_moments_varendo: theoretical pruned moments incompatible with filtering. Skipping computations\n'])
+        end        
+    end
+end
+
 if strcmpi(type,'posterior')
     posterior = 1;
     if nargin==4