diff --git a/doc/dynare.texi b/doc/dynare.texi
index a921de8b88c1db727baf791342b28b651df07e38..81adc9e76e2905e733d470046ce27b14ad971ef3 100644
--- a/doc/dynare.texi
+++ b/doc/dynare.texi
@@ -4437,6 +4437,10 @@ over @code{alt_model}.
 This command computes and displays shock decomposition according to
 the model for a given sample.
 
+Note that this command must come after either @code{estimation} (in case
+of an estimated model) or @code{stoch_simul} (in case of a calibrated
+model).
+
 @optionshead
 
 @table @code
@@ -4444,16 +4448,21 @@ the model for a given sample.
 @item parameter_set = @var{PARAMETER_SET}
 Specify the parameter set to use for running the smoother. The
 @var{PARAMETER_SET} can take one of the following five values:
-@code{prior_mode}, @code{prior_mean}, @code{posterior_mode},
-@code{posterior_mean}, @code{posterior_median}. Default value:
-@code{posterior_mean} if Metropolis has been run, else
-@code{posterior_mode}.
+@code{calibration}, @code{prior_mode}, @code{prior_mean},
+@code{posterior_mode}, @code{posterior_mean},
+@code{posterior_median}. Default value: @code{posterior_mean} if
+Metropolis has been run, else @code{posterior_mode}.
 
 @item shocks = (@var{VARIABLE_NAME} [@var{VARIABLE_NAME} @dots{}]  [ ; @var{VARIABLE_NAME} [@var{VARIABLE_NAME} @dots{}] @dots{}] )
 @dots{}
 
 @item labels = ( @var{VARIABLE_NAME} [@var{VARIABLE_NAME} @dots{}] )
 @dots{}
+
+@item datafile = @var{FILENAME}
+@xref{datafile}. Useful when computing the shock decomposition on a
+calibrated model.
+
 @end table
 
 @end deffn
@@ -5514,7 +5523,7 @@ If equal to @code{2}, triggers gsa Monte-Carlo sample (@i{i.e.} loads a sample c
 @item gsa_sample_file = @var{FILENAME}
 Uses the provided path to a specific user defined sample file. Default: @code{0}
 
-@item parameter_set = @code{prior_mode} | @code{prior_mean} | @code{posterior_mode} | @code{posterior_mean} | @code{posterior_median}
+@item parameter_set = @code{calibration} | @code{prior_mode} | @code{prior_mean} | @code{posterior_mode} | @code{posterior_mean} | @code{posterior_median}
 Specify the parameter set to use. Default: @code{prior_mean}
 
 @item lik_init = @var{INTEGER}
diff --git a/matlab/evaluate_smoother.m b/matlab/evaluate_smoother.m
index 3b345a5090bc419a81208842624f792538080994..5344cf8349a8dcdc65898628f2ae74fbfb4dc7e0 100644
--- a/matlab/evaluate_smoother.m
+++ b/matlab/evaluate_smoother.m
@@ -63,6 +63,9 @@ if ischar(parameters)
       case 'prior_mean'
         parameters = bayestopt_.p1;
       case 'calibration'
+        if isempty(oo_.dr)
+            error('You must run ''stoch_simul'' first.');
+        end
         parameters = [];
       otherwise
         disp('evaluate_smoother:: If the input argument is a string, then it has to be equal to:')