diff --git a/matlab/check_list_of_variables.m b/matlab/check_list_of_variables.m
index 6705ced009a40799bd2185b2d443c40fbe6bb59a..5377d0b28a59f8a1eb627527795d221c3a077f10 100644
--- a/matlab/check_list_of_variables.m
+++ b/matlab/check_list_of_variables.m
@@ -14,7 +14,7 @@ function varlist = check_list_of_variables(options_, M_, varlist)
 %        
 % SPECIAL REQUIREMENTS
 
-% Copyright (C) 2003-2008 Dynare Team
+% Copyright (C) 2003-2009 Dynare Team
 %
 % This file is part of Dynare.
 %
@@ -31,6 +31,28 @@ function varlist = check_list_of_variables(options_, M_, varlist)
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
 
+    if options_.bvar_dsge && options_.bayesian_irf
+       if ~isempty(varlist)
+           for i=1:size(varlist,1)
+               idx = strmatch(deblank(varlist(i,:)),options_.varobs,'exact');
+               if isempty(idx)
+                   disp([varlist(i,:) ' is not an observed variable!']);
+                   message = 1;
+               end
+           end
+           if size(varlist,1)~=size(options_.varobs)
+               message = 1;
+           end
+           if message
+               disp(' ')
+               disp('Posterior IRFs will be computed for all observed variables.')
+               disp(' ')
+           end
+       end
+        varlist = options_.varobs;
+        return
+    end
+    
     if isempty(varlist)
         disp(' ')
         disp(['You did not declare endogenous variables after the estimation command.'])
diff --git a/matlab/dynare_estimation.m b/matlab/dynare_estimation.m
index a5b0eee35bb23f676c9fda8784ae5df6b3d1a392..a4bff9e3ebee87e9691c8f997d3a4f0b82c07d64 100644
--- a/matlab/dynare_estimation.m
+++ b/matlab/dynare_estimation.m
@@ -30,6 +30,11 @@ function dynare_estimation(var_list,varargin)
 
 global options_ oo_ M_ oo_recursive_
 
+%% Decide if a DSGE or DSGE-VAR has to be estimated.
+if ~isempty(strmatch('dsge_prior_weight',M_.param_names))
+    options_.bvar_dsge = 1;
+end
+
 var_list = check_list_of_variables(options_, M_, var_list);
 options_.varlist = var_list;
 
diff --git a/matlab/dynare_estimation_1.m b/matlab/dynare_estimation_1.m
index abad83e70a8460838bf7fc1ce84a7b4b16b9929e..184ab183ad76e8f85de0a096724699e5006420ec 100644
--- a/matlab/dynare_estimation_1.m
+++ b/matlab/dynare_estimation_1.m
@@ -44,11 +44,6 @@ for i = 1:size(M_.endo_names,1)
   end
 end
 
-%% Decide if a DSGE or DSGE-VAR has to be estimated.
-if ~isempty(strmatch('dsge_prior_weight',M_.param_names))
-    options_.bvar_dsge = 1;
-end
-
 %% Set the order of approximation to one (if needed).
 if options_.order > 1
     options_.order = 1;