From 20db232f3d733f45910a57f3855265f4694b5f1f Mon Sep 17 00:00:00 2001 From: Nick Foti <nfoti01@gmail.com> Date: Sun, 5 Mar 2017 18:43:47 -0800 Subject: [PATCH] ensure nu is int when sampling inverse wishart --- pybasicbayes/util/stats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pybasicbayes/util/stats.py b/pybasicbayes/util/stats.py index 20f19a3..7b70457 100644 --- a/pybasicbayes/util/stats.py +++ b/pybasicbayes/util/stats.py @@ -221,7 +221,7 @@ def sample_invwishart(S,nu): chol = np.linalg.cholesky(S) if (nu <= 81+n) and (nu == np.round(nu)): - x = np.random.randn(nu,n) + x = np.random.randn(int(nu),n) else: x = np.diag(np.sqrt(np.atleast_1d(stats.chi2.rvs(nu-np.arange(n))))) x[np.triu_indices_from(x,1)] = np.random.randn(n*(n-1)//2) -- GitLab