From 5d56a4f2b0d8fa1afe154d1baf1f2656f8fa50fd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?=
 <stephane.adjemian@univ-lemans.fr>
Date: Fri, 28 Jun 2013 11:14:24 +0200
Subject: [PATCH] Make calib_smoother command call evaluate_smoother matlab
 routine.

---
 matlab/evaluate_smoother.m     | 17 ++++++++---------
 preprocessor/ComputingTasks.cc |  7 +++----
 2 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/matlab/evaluate_smoother.m b/matlab/evaluate_smoother.m
index fa154df36b..3c2c84ed61 100644
--- a/matlab/evaluate_smoother.m
+++ b/matlab/evaluate_smoother.m
@@ -86,9 +86,9 @@ if ischar(parameters)
     end
 end
 
-pshape_original   = bayestopt_.pshape;
-bayestopt_.pshape = Inf(size(bayestopt_.pshape));
-clear('priordens')
+%pshape_original   = bayestopt_.pshape;
+%bayestopt_.pshape = Inf(size(bayestopt_.pshape));
+%clear('priordens')
 
 [atT,innov,measurement_error,updated_variables,ys,trend_coeff,aK,T,R,P,PK,decomp] = ...
     DsgeSmoother(parameters,dataset_.info.ntobs,dataset_.data,dataset_.missing.aindex,dataset_.missing.state);
@@ -111,18 +111,17 @@ if options_.nk ~= 0
             decomp(options_.filter_step_ahead,i_endo,:,:);
     end
 end
-dr = oo_.dr;
-order_var = oo_.dr.order_var;
 for i=bayestopt_.smoother_saved_var_list'
     i1 = order_var(bayestopt_.smoother_var_list(i));
     eval(['oo.SmoothedVariables.' deblank(M_.endo_names(i1,:)) ' = atT(i,:)'';']);
-    eval(['oo.FilteredVariables.' deblank(M_.endo_names(i1,:)) ' = squeeze(aK(1,i,:));']);
+    if options_.nk>0
+        eval(['oo.FilteredVariables.' deblank(M_.endo_names(i1,:)) ' = squeeze(aK(1,i,:));']);
+    end
     eval(['oo.UpdatedVariables.' deblank(M_.endo_names(i1,:)) ' = updated_variables(i,:)'';']);
 end
 for i=1:M_.exo_nbr
     eval(['oo.SmoothedShocks.' deblank(M_.exo_names(i,:)) ' = innov(i,:)'';']);
 end
 
-oo.dr = oo_.dr;
-
-bayestopt_.pshape = pshape_original;
\ No newline at end of file
+%oo.dr = oo_.dr;
+%bayestopt_.pshape = pshape_original;
\ No newline at end of file
diff --git a/preprocessor/ComputingTasks.cc b/preprocessor/ComputingTasks.cc
index 101d139bc4..74e98e703f 100644
--- a/preprocessor/ComputingTasks.cc
+++ b/preprocessor/ComputingTasks.cc
@@ -2412,10 +2412,9 @@ CalibSmootherStatement::writeOutput(ostream &output, const string &basename) con
 {
   options_list.writeOutput(output);
   symbol_list.writeOutput("var_list_", output);
-  output << "options_.mode_compute = 0;" << endl
-         << "options_.smoother = 1;" << endl
-         << "options_.order = 1;" << endl
-         << "dynare_estimation(var_list_);" << endl;
+  output << "options_.smoother = 1;" << endl;
+  output << "options_.order = 1;" << endl;
+  output << "evaluate_smoother('calibration',var_list_);" << endl;
 }
 
 ExtendedPathStatement::ExtendedPathStatement(const OptionsList &options_list_arg)
-- 
GitLab