Multidimensional version, grid search for 1 dim, MC Integration