Skip to content

Instantly share code, notes, and snippets.

@MarcoGorelli
Last active August 30, 2020 10:58
Show Gist options
  • Save MarcoGorelli/78f79288d49992b4fa7019699b257670 to your computer and use it in GitHub Desktop.
Save MarcoGorelli/78f79288d49992b4fa7019699b257670 to your computer and use it in GitHub Desktop.
coin_tossing
import arviz as az
import pymc3 as pm
N = 1000
N_HEADS = 292
with pm.Model() as model:
theta = pm.Beta("θ", alpha=1.0, beta=1.0)
y = pm.Binomial("y", n=N, p=theta, observed=N_HEADS)
trace = pm.sample(return_inferencedata=True)
az.plot_posterior(trace.posterior)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment