Two Moons
Mathematical Set-Up
Given
Coding
def TM_simulator(theta):
"""Two Moons simulator for ABC."""
t0, t1 = theta[0], theta[1]
a = uniform(low=-np.pi/2, high=np.pi/2)
r = normal(loc=0.1, scale=0.01)
p = np.array([r * np.cos(a) + 0.25, r * np.sin(a)])
return p + np.array([-np.abs(t0 + t1), (-t0 + t1)]) / sqrt(2)