cenoisy py from snoisy import snoisy import numpy as np rho nel int( *rho)eps np ones(ni pstart ps np zeros (( , )ps [ pstart pdist np zeros (( , )while np max(np minimum ( , - )epsi + (np random uniform (size =( , )pastype (intx_tmp np array (xcopy=truesx snoisy x_tmp ids np argsort (sx ,axis = elite [ids [ nel ,: np mean(elite ,axis = ps[ip print (pfurther reading the article [ explores why the monte carlo method is so important in today' quantitative investigations the handbook of monte carlo methods [ provides comprehensive overview of monte carlo simulation that explores the latest topicstechniquesand realworld applications popular books on simulation and the monte carlo method include [ ][ ]and [ classic reference on random variable generation is [ easy introductions to stochastic simulation are given in [ ][ ]and [ more advanced theory can be found in [ markov chain monte carlo is detailed in [ and [ the research monograph on the cross-entropy method is [ and tutorial is provided in [ range of optimization applications of the ce method is given in [ theoretical results on adaptive tuning schemes for simulated annealing may be foundfor examplein [ there are several established ways for gradient estimation these include the finite difference methodinfinitesimal perturbation analysisthe score function methodand the method of weak derivativesseefor example[ exercises we can modify the box-muller method in example to draw and uniformly on the unit disc{(xyr }in the following wayindependently draw radius and an angle th ( )and return cos(th) sin(ththe question is how to draw (ashow that the cdf of is given by fr (rr for (with fr ( and