Numerical Methods for Stochastic Computations: A Spectral Method Approach