[Pkg-octave-commit] [SCM] dynare branch, master, updated. 10ceb7a615ed34ab07825ae17f39ee2242ee859b

Sébastien Villemot sebastien.villemot at ens.fr
Thu Sep 24 14:31:22 UTC 2009


The following commit has been merged in the master branch:
commit 3dca2aa15510974faba8e93f4271ba60ec73e493
Author: Sébastien Villemot <sebastien.villemot at ens.fr>
Date:   Thu Sep 24 16:01:03 2009 +0200

    New patch for bug in metropolis-hastings diagnostics routine

diff --git a/debian/changelog b/debian/changelog
index 99e599c..b678f6e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,6 +11,8 @@ dynare (4.0.4-4) unstable; urgency=low
     No longer install rcond.m (rcond is now a primitive in Octave 3.2).
   * debian/README.Debian:
     Remove references to mark_as_command (no longer needed in Octave 3.2).
+  * debian/patches/mcmcdiagnostics:
+    New patch for bug in metropolis-hastings diagnostics routine.
 
  -- Sébastien Villemot <sebastien.villemot at ens.fr>  Mon, 14 Sep 2009 14:10:42 +0200
 
diff --git a/debian/patches/mcmcdiagnostics b/debian/patches/mcmcdiagnostics
new file mode 100644
index 0000000..fbfae77
--- /dev/null
+++ b/debian/patches/mcmcdiagnostics
@@ -0,0 +1,25 @@
+Fix bug in McMCDiagnostics.m
+--- a/matlab/McMCDiagnostics.m
++++ b/matlab/McMCDiagnostics.m
+@@ -48,13 +48,16 @@
+ 
+ load([MhDirectoryName '/'  M_.fname '_mh_history.mat'])
+ 
+-mcfiles = [];
+-for blck = 1:nblck
+-  mcfiles = cat(3,mcfiles,dir([MhDirectoryName '/' M_.fname '_mh*_blck' int2str(blck) '.mat']));
++NumberOfMcFilesPerBlock = size(dir([MhDirectoryName ,filesep, M_.fname '_mh*_blck1.mat']),1);
++for blck = 2:nblck
++    tmp = size(dir([MhDirectoryName ,filesep, M_.fname '_mh*_blck' int2str(blck) '.mat']),1);
++    if tmp~=NumberOfMcFilesPerBlock
++        disp(['McMCDiagnostics:: The number of mh files in chain ' int2str(blck) ' is ' int2str(tmp) ' while'])
++        disp(['                  the number of mh files in chain 1 is ' int2str(mcfiles) '!'])
++        error('The number of mh files has to be constant across chains!')
++    end
+ end
+-NumberOfMcFilesPerBlock = size(mcfiles,1);
+ 
+-  
+ PastDraws = sum(record.MhDraws,1);
+ LastFileNumber = PastDraws(2);
+ LastLineNumber = record.MhDraws(end,3);
diff --git a/debian/patches/series b/debian/patches/series
index c9db1b2..411474a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
+mcmcdiagnostics
 testsuite-fs2000
 rows-name-clash
 build-matlab

-- 
dynare



More information about the Pkg-octave-commit mailing list