Monte Carlo, Markov Chains, Metropolis Hastings.
scipy.stats.binom.pmf(head_counts_0, 10, theta0) # collect theta_accept = theta0 prior_accept = prior0 likelihood_accept = likelihood_0 i = 0 while len(theta_accept) <= 1000: theta = np.random.beta(1,1,1) prior = scipy.stats.beta.pdf(theta, 1, 1) head_counts = sum(np.random.randint(2, size=10))