In this paper the Laplace approximation is used to perform classical and Bayesian analyses of univariate and multivariate stochastic volatility (SV) models. We show that implementation of the Laplace approximation is greatly simplified by the use of a numerical technique known as automatic differentiation (AD). Several algorithms are proposed and compared with some existing methods using both simulated data and actual data in terms of computational, statistical and simulation efficiency. It is found that the new methods match the statistical efficiency of the existing classical methods and substantially reduce the simulation inefficiency in some existing Bayesian Markov chain Monte Carlo (MCMC) algorithms. Also proposed are simple methods for obtaining the filtered, smoothed and forecasted latent variable. The new methods are implemented using the software AD Model Builder, which with its latent variable module (ADMB-RE) facilitates the formulation and fitting of SV models. To illustrate the flexibility of the new algorithms, several univariate and multivariate SV models are fitted using exchange rate data.