Skip to content

BCM/ParameterEstimation/Binomial.ipynb #104

Open
@yongduek

Description

@yongduek

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions