Bayesian Portfolio Allocation
Thomas Wiecki, PhD
@twiecki
Disclaimer
This presentation is for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation for any security; nor does it constitute an offer to provide investment advisory or other services by Quantopian, Inc. ("Quantopian"). Nothing contained herein constitutes investment advice or offers any opinion with respect to the suitability of any security, and any views expressed herein should not be taken as advice to buy, sell, or hold any security or as an endorsement of any security or company. In preparing the information contained herein, Quantopian, Inc. has not taken into account the investment needs, objectives, and financial circumstances of any particular investor. Any views expressed and data illustrated herein were prepared based upon information, believed to be reliable, available to Quantopian, Inc. at the time of publication. Quantopian makes no guarantees as to their accuracy or completeness. All information is subject to change and may quickly become unreliable for various reasons, including changes in market conditions or economic circumstances.
3
Markowitz mean-variance optimization
Bayesian statistics allows to build models flexibly
vs
Bayesian statistics allows specification of prior information
+
Not single most likely solution, but all probable solutions
Instead of point-estimates (scalar values) of e.g. the mean or variance, we use probability distributions that quantify uncertainty.
Point estimates
Probability distributions
Given 16 strategies, how to weight them?
Where we are
Data
Bayesian Modeling: Coin flipping
Parameters
Prior p(θ)
Likelihood p(x | θ)
Model construction:
How parameters relate to data
Inference: Bayes Formula
most likely parameters given data
Data x
(Heads / Tails)
Parameters
Posterior p(θ | x)
p(heads)
Observe:
HTTHTTT
belief
Probabilistic Programming
Parameters
Prior p(θ)
Likelihood p(x | θ)
Model construction:
How parameters relate to data
Inference: Bayes Formula
most likely parameters given data
Data x
(Heads / Tails)
Parameters
Posterior p(θ | x)
p(heads)
Observe:
HTTHTTT
belief
code
automatic
(MCMC)
Modeling financial returns
T-Distribution
Inference: Bayes Formula
probability of parameters given data
Latent causes
(Parameters)
Distribution
of Data
Observed Data
Where we are
Data
Model
The model in
Parameters / Priors
Inference
Model specification
Where we are
Data
Model
Posterior
Posterior probability that strategy is profitable (SR > 0)
Where we are
Data
Model
Posterior
Predictions
Bayesian Decision Making
Bayesian Decision Making
Data
Model
Posterior
Predictions
Optimizer
Loss function
Decision
Predictions
Bayesian Decision Making
Data
Model
Posterior
Predictions
Optimizer
Loss function
Decision
Loss function for Mean-Variance
Example
def loss_function(ω): # weight vector, e.g. [1/16, 1/16, …]
loss = 0
for r in sampled_returns:
# compute portfolio returns
port_rets = sum(r * ω)
loss += -exp(-port_rets)
return loss
Bayesian Decision Making
Data
Model
Posterior
Predictions
Optimizer
Loss function
Decision
Optimization → Output
The full model
Benefits
Further reading
@twiecki
Bayesian Decision Making blog post: https://twiecki.io/blog/2019/01/14/supply_chain/
Disclaimer
This presentation is for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation for any security; nor does it constitute an offer to provide investment advisory or other services by Quantopian, Inc. ("Quantopian"). Nothing contained herein constitutes investment advice or offers any opinion with respect to the suitability of any security, and any views expressed herein should not be taken as advice to buy, sell, or hold any security or as an endorsement of any security or company. In preparing the information contained herein, Quantopian, Inc. has not taken into account the investment needs, objectives, and financial circumstances of any particular investor. Any views expressed and data illustrated herein were prepared based upon information, believed to be reliable, available to Quantopian, Inc. at the time of publication. Quantopian makes no guarantees as to their accuracy or completeness. All information is subject to change and may quickly become unreliable for various reasons, including changes in market conditions or economic circumstances.