Stochastic Volatility Model with PyMC

Explore the concept of time-varying volatility in asset prices, modeled using a stochastic process. The example demonstrates the computation of this volatility based on the daily returns of the S&P 500 using PyMC.


Thomas Wiecki



Asset prices have time-varying volatility (variance of day over day returns). In some periods, returns are highly variable, while in others very stable. Stochastic volatility models model this with a latent volatility variable, modeled as a stochastic process. In this example, we compute the time-varying volatility based on daily returns of the S&P 500.

For the full example, see:
Stochastic Volatility Model with PyMC

Work with PyMC Labs

If you are interested in seeing what we at PyMC Labs can do for you, then please email We work with companies at a variety of scales and with varying levels of existing modeling capacity. We also run corporate workshop training events and can provide sessions ranging from introduction to Bayes to more advanced topics.