Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BCM/ParameterEstimation/Binomial.ipynb #104

Open
yongduek opened this issue Aug 13, 2020 · 0 comments
Open

BCM/ParameterEstimation/Binomial.ipynb #104

yongduek opened this issue Aug 13, 2020 · 0 comments

Comments

@yongduek
Copy link

This is just a small thing about the last cell of BCM/ParameterEstimation/Binomial.ipynb added as a part of Note from Junpeng Lao.

The length of divergent below was 4000 when I printed its size, which corresponded to 1000 samples of 4 traces. So I guess divperc should have been 357/4000 = 9.125% instead of 35.7%.

# display the total number and percentage of divergences
divergent = trace6_["diverging"]
print("Number of divergences: %d" % divergent.nonzero()[0].size)
divperc = divergent.nonzero()[0].size * 100 / len(trace6_)
print("Percentage of divergent samples: %.2f" % divperc)

# scatter plot between theta and N
# for the identifcation of the problematic neighborhoods in parameter space
theta_tr = trace6_["theta"]
totaln_tr = trace6_["TotalN"]
plt.figure(figsize=(6, 6))
plt.scatter(totaln_tr[divergent == 0], theta_tr[divergent == 0], color="r", alpha=0.05)
plt.scatter(totaln_tr[divergent == 1], theta_tr[divergent == 1], color="g", alpha=0.5);

Many thanks for sharing the pymc3 codes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant