Monte Carlo, Markov Chains, Metropolis Hastings.
else: u = np.random.beta(1,1,1) if ratio >= u: theta_accept = np.append(theta_accept, theta) prior_accept = np.append(prior_accept, prior) likelihood_accept = np.append(likelihood_accept, likelihood) else: print('ratio is: ', ratio) print('u is: ', u) # drop the first theta, prior, likelihood