A stochastic method of linearization