You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running the PMMH algorithm with verbose non-zero and a prior for a non-scalar parameter, there's a bug in the print_progress method in the MCMC class:
def print_progress(self, n):
params = self.chain.theta.dtype.fields.keys()
msg = 'Iteration %i' % n
if hasattr(self, 'nacc') and n > 0:
msg += ', acc. rate=%.3f' % (self.nacc / n)
for p in params:
msg += ', %s=%.3f' % (p, self.chain.theta[p][n])
print(msg)
In the case of a prior for a non-scalar parameter, self.chain.theta[p][n] is an array and one has to use another kind of string formatting.
NB: It's not much of a problem. If verbose=0 or one can factor the multidimensional parameter into scalar parameters, everything works fine.
The text was updated successfully, but these errors were encountered:
OK, I replaced %.3f by %s, which should work whether self.chaintheta[p][n] is a scalar or or an array. (We loose the formatting, but I guess that's ok.)
Thx.
When running the PMMH algorithm with
verbose
non-zero and a prior for a non-scalar parameter, there's a bug in theprint_progress
method in theMCMC
class:In the case of a prior for a non-scalar parameter,
self.chain.theta[p][n]
is an array and one has to use another kind of string formatting.NB: It's not much of a problem. If
verbose=0
or one can factor the multidimensional parameter into scalar parameters, everything works fine.The text was updated successfully, but these errors were encountered: