Python, Monte Carlo, Monte Carlo Simulation, Importance Sampling, Machine Learning.
plt.legend() # calculate value sampling from a different distribution value_list = [] # need larger steps for i in range(n): # sample from different distribution x_i = np.random.normal(mu_appro, sigma_appro) value = f_x(x_i) * (p_x.pdf(x_i) / q_x.pdf(x_i)) value_list.append(value) print("average {}