Monte Carlo Method, Random Number Generator, Importance Sampling, Reversetransformsampling, Rejection Sampling.
#return 0.5*((1+sgn(x))(1-np.exp(-abs(x)))) def P_laplace_inv(u): k = 1-2*abs(u-0.5) return -1*sgn(u-0.5)*np.log(k) # random number generator def reverse_generator(X): res = [] for u in X: res.append(P_laplace_inv(u)) return res n_sample = 50 s = np.random.uniform(0,1,n_sample) theta =