Monte Carlo, Markov Chains, Metropolis Hastings.
likelihood = scipy.stats.binom.pmf(head_counts, 10, theta) ratio = (prior*likelihood) / (prior_accept[i] * likelihood_accept[i]) if ratio >=1: theta_accept = np.append(theta_accept, theta) prior_accept = np.append(prior_accept, prior) likelihood_accept = np.append(likelihood_accept, likelihood)