The demand for money in a stochastic environment