Monte Carlo, Markov Chains, Metropolis Hastings.
this experiment N times until I have 1000 of θ. N≥1000 since I am rejecting θ along the way. # MH import scipy import random import numpy as np # initial theta0 = np.random.beta(1,1,1) prior0 = scipy.stats.beta.pdf(theta0, 1, 1) head_counts_0 = sum(np.random.randint(2, size=10)) likelihood_0 =