Method of stochastic simulations