Skip to content

Commit

Permalink
Fixed the number of samples in the np.random.random call to match tha…
Browse files Browse the repository at this point in the history
…t in the np.random.choice call in posterior_moments function.
  • Loading branch information
blakeaw committed Apr 7, 2020
1 parent 2bcd8c4 commit 2cf2cfb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gleipnir/nsbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def posterior_moments(self):
marginal, edges, centers = post[parm]
width = edges[1] - edges[0]
# resample from the distribution
samples = np.random.choice(centers, size=1000000, p=marginal/(marginal.sum())) + (width*(np.random.random(10000)-0.5))
samples = np.random.choice(centers, size=1000000, p=marginal/(marginal.sum())) + (width*(np.random.random(1000000)-0.5))
mean = np.mean(samples)
var = np.var(samples)
skew = scipy.stats.skew(samples)
Expand Down

0 comments on commit 2cf2cfb

Please sign in to comment.