steps figure the stochastic optimization algorithm produces sequence lt that tends to an approximate estimate of the optimal importance sampling parameter nextwe estimate lusing stochastic counterpart approach as the objective function (lis of the form ( (with taking the role of and the role of )we obtain the sample average (xi ( (xi (ln = gl (xi where ~iid fb once the ~iid fb have been simulatedb (lis deterministic function of lwhich can be optimized by any means we take the most basic approach and simply evaluate the function for and select the minimizing on this grid the code is given below and figure shows (las function of the minimum value found was for minimizer which is in accordance with the value obtained via stochastic approximation the sensitivity of this estimate can be assessed from the graphfor wide range of values (say from to stays rather flat so any of these values could be used in an importance sampling procedure to estimate howeververy small values (less than and large values (greater than should be avoided our original choice of was therefore justified and we could not have done much better stochcounterpart py from stochapprox import lams np linspace ( res =[res np array (resfor in range (lams size)lam lams[inp random seed ( lambda lam*np exp(-np sqrt( ** ** )*lam)/np sqrt ( ** ** /( pi