Sparse Spectral Surrogate Models For Deterministic And Stochastic Computer Simulations