From 8d84138897671dbbe329e0308e74ab445ea0e286 Mon Sep 17 00:00:00 2001 From: "Matthew R. Becker" Date: Thu, 29 Sep 2016 17:10:33 -0500 Subject: [PATCH] BUG clip effective sample size at maximum number of samples --- pymc3/diagnostics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pymc3/diagnostics.py b/pymc3/diagnostics.py index dfdaa3a8b9..838b29bcd0 100644 --- a/pymc3/diagnostics.py +++ b/pymc3/diagnostics.py @@ -259,7 +259,7 @@ def calc_n_eff(x): t += 1 - return int(m * n / (1. + 2 * rho[1:t].sum())) + return min(m * n, int(m * n / (1. + 2 * rho[1:t].sum()))) n_eff = {} for var in mtrace.varnames: