From 205b455ad74cfda6955e31de1feb53e58cbbded9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Scylla=29?=
 <stephane.adjemian@univ-lemans.fr>
Date: Thu, 6 Sep 2012 14:13:29 +0200
Subject: [PATCH] Added the possibility, for each given size of the sample, to
 restart an arbitrary number of times the estimation when estimating a model
 with a recursive approach.

Deactivated by default (options_.recursive_estimation_restart is defined to be zero in global_initialization.m).
---
 matlab/dynare_estimation.m     | 9 ++++++++-
 matlab/global_initialization.m | 1 +
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/matlab/dynare_estimation.m b/matlab/dynare_estimation.m
index 6fe7a68ec8..2f37857fbb 100644
--- a/matlab/dynare_estimation.m
+++ b/matlab/dynare_estimation.m
@@ -64,7 +64,14 @@ if nnobs > 1
         options_.nobs = nobs(i);
         M_.dname = [dname '_' int2str(nobs(i))];
         dynare_estimation_1(var_list,M_.dname);
-        options_.mode_file = [M_.fname '_mode'];
+        if isequal(i,1)
+            options_.mode_file = [M_.fname '_mode'];
+        end
+        if options_.recursive_estimation_restart
+            for j=1:options_.recursive_estimation_restart
+                dynare_estimation_1(var_list,M_.dname);
+            end
+        end
         oo_recursive_{nobs(i)} = oo_;
     end
 else
diff --git a/matlab/global_initialization.m b/matlab/global_initialization.m
index d65930642c..93857f2251 100644
--- a/matlab/global_initialization.m
+++ b/matlab/global_initialization.m
@@ -345,6 +345,7 @@ options_.mh_mode = 1;
 options_.mh_nblck = 2;
 options_.mh_recover = 0;
 options_.mh_replic = 20000;
+options_.recursive_estimation_restart = 0;
 options_.mode_check = 0;
 options_.mode_check_nolik = 0;
 options_.mode_compute = 4;
-- 
GitLab