diff --git a/matlab/DsgeSmoother.m b/matlab/DsgeSmoother.m
index b2f5d1571c2e4a67b1385405b5c22e55887f823a..68b32fec64f6b37bec29ca853380dfca6bae35b5 100644
--- a/matlab/DsgeSmoother.m
+++ b/matlab/DsgeSmoother.m
@@ -39,10 +39,14 @@ function [alphahat,etahat,epsilonhat,ahat,SteadyState,trend_coeff,aK,T,R] = Dsge
   %------------------------------------------------------------------------------
   [T,R,SteadyState] = dynare_resolve;
   bayestopt_.mf = bayestopt_.mf2;
-  if options_.loglinear == 1
-    constant = log(SteadyState(bayestopt_.mfys));
+  if options_.noconstant
+      constant = zeros(nobs,1);
   else
-    constant = SteadyState(bayestopt_.mfys);
+      if options_.loglinear == 1
+          constant = log(SteadyState(bayestopt_.mfys));
+      else
+          constant = SteadyState(bayestopt_.mfys);
+      end
   end
   trend_coeff = zeros(nobs,1);
   if bayestopt_.with_trend == 1
diff --git a/matlab/dynare_estimation.m b/matlab/dynare_estimation.m
index c7b6fffade27d82403b77d4f8e358762f5a378dc..aa320de31986f8390c56206e0fb8b99f16bc29ed 100644
--- a/matlab/dynare_estimation.m
+++ b/matlab/dynare_estimation.m
@@ -1021,15 +1021,18 @@ if ~((any(bayestopt_.pshape > 0) & options_.mh_replic) | (any(bayestopt_.pshape
   %%
   %%	Smooth observational errors...
   %%
-  yf = zeros(gend,n_varobs);
-  if options_.prefilter == 1
-    yf = atT(bayestopt_.mf,:)+repmat(transpose(bayestopt_.mean_varobs),1,gend);
-  elseif options_.loglinear == 1
-    yf = atT(bayestopt_.mf,:)+repmat(log(ys(bayestopt_.mfys)),1,gend)+...
-         trend_coeff*[1:gend];
+  if options_.noconstant
+      yf = zeros(n_varobs,gend);
   else
-    yf = atT(bayestopt_.mf,:)+repmat(ys(bayestopt_.mfys),1,gend)+...
-         trend_coeff*[1:gend];
+      if options_.prefilter == 1
+          yf = atT(bayestopt_.mf,:)+repmat(transpose(bayestopt_.mean_varobs),1,gend);
+      elseif options_.loglinear == 1
+          yf = atT(bayestopt_.mf,:)+repmat(log(ys(bayestopt_.mfys)),1,gend)+...
+               trend_coeff*[1:gend];
+      else
+          yf = atT(bayestopt_.mf,:)+repmat(ys(bayestopt_.mfys),1,gend)+...
+               trend_coeff*[1:gend];
+      end
   end
   if nvn
     number_of_plots_to_draw = 0;