In this chapter, we will introduce Bayesian approaches to machine learning, and how their different perspectives on uncertainty add value when developing and evaluating algorithmic trading strategies.
Bayesian statistics allow us to quantify the uncertainty about future events and refine our estimates in a principled way as new information arrives. This dynamic approach adapts well to the evolving nature of financial markets. It is particularly useful when there is less relevant data and we require methods that systematically integrate prior knowledge or assumptions.
We will see that Bayesian approaches to machine learning allow for richer insights into the uncertainty around statistical metrics, parameter estimates, and predictions. The applications range from more granular risk management to dynamic updates of predictive models that incorporate changes in the market environment. The Black-Litterman approach to asset allocation (see Chapter 5, Strategy Evaluation, can be interpreted as a Bayesian model. It computes the expected return as an average of the market equilibrium and the investor's views, weighted by each asset's volatility, cross-asset correlations, and the confidence in each forecast.
More specifically, in this chapter, we will cover the following topics:
- How Bayesian statistics apply to machine learning
- How to use probabilistic programming with PyMC3
- How to define and train machine learning models
- How to run state-of-the-art sampling methods to conduct approximate inference
- How to apply Bayesian machine learning to compute dynamic Sharpe ratios, build Bayesian classifiers, and estimate stochastic volatility