From 21336ab0c658ed5ba025f19bdf0a72b0f701d3ac Mon Sep 17 00:00:00 2001 From: "Paul T. Baker" Date: Wed, 18 Aug 2021 15:19:14 -0400 Subject: [PATCH 1/2] fix index error in chain arrays --- PTMCMCSampler/PTMCMCSampler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PTMCMCSampler/PTMCMCSampler.py b/PTMCMCSampler/PTMCMCSampler.py index a59c46c..ce6b09c 100755 --- a/PTMCMCSampler/PTMCMCSampler.py +++ b/PTMCMCSampler/PTMCMCSampler.py @@ -179,7 +179,7 @@ def initialize( self.neff = neff self.tstart = 0 - N = int(maxIter / thin) + N = int(np.ceil(maxIter / thin)) self._lnprob = np.zeros(N) self._lnlike = np.zeros(N) From b5f6c9e46b4062608160d8620e99181a07b24835 Mon Sep 17 00:00:00 2001 From: "Paul T. Baker" Date: Wed, 18 Aug 2021 15:50:47 -0400 Subject: [PATCH 2/2] update _writeToFile docstring --- PTMCMCSampler/PTMCMCSampler.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PTMCMCSampler/PTMCMCSampler.py b/PTMCMCSampler/PTMCMCSampler.py index ce6b09c..4dbb6a7 100755 --- a/PTMCMCSampler/PTMCMCSampler.py +++ b/PTMCMCSampler/PTMCMCSampler.py @@ -710,9 +710,9 @@ def temperatureLadder(self, Tmin, Tmax=None, tstep=None): def _writeToFile(self, iter): """ - Function to write chain file. File has 3+ndim columns, - the first is log-posterior (unweighted), log-likelihood, - and acceptance probability, followed by parameter values. + Function to write chain file. File has ndim+4 columns, + appended to the parameter values are log-posterior (unnormalized), + log-likelihood, acceptance rate, and PT acceptance rate. @param iter: Iteration of sampler