Breaking Down Risk Parity Portfolios: A Practical Open Source Implementation
In this talk I will explain the behind the scenes of the now very popular risk parity portfolio, its convex and non-convex formulations, and I will present open source implementations of state-of-the-art algorithms with practical examples.
by passion/experience guest researcher at NIST so ware developer for Google summer of code with OpenAstronomy so ware engineer intern NASA since Sept. : phd student at HKUST National Institute of Standards and Technology, Washington DC, US National Aeronautics and Space Administration, Ames Research Center, Silicon Valley, US The Hong Kong University of Science and Technology
money into N assets? assume the log-returns r are i.i.d. Gaussian, then for a portfolio w: expected return: E w r = w µ variance: V w r = w Σw Nobel Memorial Prize in Economic Sciences
money into N assets? assume the log-returns r are i.i.d. Gaussian, then for a portfolio w: expected return: E w r = w µ variance: V w r = w Σw Dr. Harry Markowitz ( ): maximize w w µ − λw Σw subject to w 0, 1 w = 1 Nobel Memorial Prize in Economic Sciences
money into N assets? assume the log-returns r are i.i.d. Gaussian, then for a portfolio w: expected return: E w r = w µ variance: V w r = w Σw Dr. Harry Markowitz ( ): maximize w w µ − λw Σw subject to w 0, 1 w = 1 criticisms: . sensitivity to estimation errors in µ and Σ . does not consider risk diversification Nobel Memorial Prize in Economic Sciences
capital first risk parity fund ( ): Bridgewater’s All Weather Bridgewater publishes "Engineering Targeted Returns and Risks" ( ) -onwards: risk parity gains broad adoption
capital first risk parity fund ( ): Bridgewater’s All Weather Bridgewater publishes "Engineering Targeted Returns and Risks" ( ) -onwards: risk parity gains broad adoption basic idea: design a portfolio such that the risk is equally distributed among the asset classes (stocks, bonds, real state, etc.)
allocation AAPL AMD ADI ABBV AEZS A APD AA CF AAPL AMD ADI ABBV AEZS A APD AA CF 0.0 0.1 0.2 0.3 0.4 0.0 0.1 0.2 0.3 stocks risk parity Markowitz Portfolio capital and risk distribution
bi , i = 1, 2, . . . , N feasibility problem: find w 0 w subject to wi (Σw) i w Σw = bi , i = 1, 2, . . . , N doesn’t look trivial approximation: Σ is diagonal wi ∝ √ bi √ Σii i.e. inverse volatility portfolio
variables x = w √ w Σw , then w = x 1 x problem becomes: Σx = b x minimize x 0 f(x) = 1 2 x Σx − b log(x) optimality condition: ∇f(x) = Σx − b x = 0 then done? it’s not a QP, LP, etc.
CCD to solve risk parity k ← 0, initial x(0) while not converged do for i = 1 to N do xk+1 i ← arg min xi f xk+1 1 , . . . , xk i , . . . , xk N end end closed-form update: xi = − x−i Σ:,i + x−i Σ:,i 2 + 4Σiibi 2Σii , where x−i = [x1, . . . , xi−1, 0, xi+1, . . . , xN ]
1 w = 1 in practice we would like to include l w u, w µ Bruder & Roncalli ( ): minimize w N i=1 wi (Σw)i w Σw − bi 2 subject to 1 w = 1, w ∈ W how to "solve" the non-convex formulation?
1 w = 1 in practice we would like to include l w u, w µ Bruder & Roncalli ( ): minimize w N i=1 wi (Σw)i w Σw − bi 2 subject to 1 w = 1, w ∈ W how to "solve" the non-convex formulation? general purpose solvers: slow
N i=1 [gi (w)]2 + λF(w) subject to 1 w = 1, w ∈ W "convexify" the objective function: fast basic idea: find a "nice" approximation to the non-convex term, solve it, repeat (Scutari et al. )
N i=1 [gi (w)]2 + λF(w) subject to 1 w = 1, w ∈ W "convexify" the objective function: fast basic idea: find a "nice" approximation to the non-convex term, solve it, repeat (Scutari et al. ) "nice" approximation for gi (w): first order Taylor expansion (Feng & Palomar )
matrices in seconds, which has helped streamline portfolio allocation testing" Jonathan Dane, CFA. Director of Portfolio Strategy & Market Research, The Coury Firm. "riskParityPortfolio provides a state-of-the-art implementation of rpps, otherwise only available at the top quantitative hedge funds" Tharsis Souza, PhD. Director of Strategic Innovation, Axioma Inc. Founder, OpenQuants.com. Disclaimer: views, thoughts, and opinions expressed in the text belong solely to the author, and not necessarily to the author’s employer, organization, committee or other group or individual.
allocation to risk allocation . risk parity portfolios have been praised for their robustness in di erent market "weathers" . non-convex? no problem! . GitHub repositories to stay tuned: dppalomar/riskParityPortfolio dppalomar/riskparity.py dppalomar/portfolioBacktest
Finance. ( ): – , . Y. Feng and D. Palomar, "SCRIP: Successive convex optimization methods for risk parity portfolios design," IEEE Trans. Signal Process., vol. , no. , pp. – , . Scutari et al. "Decomposition by partial linearization: Parallel optimization of multi-agent systems". IEEE Trans. Signal Processing, ( ), – , . B. Bruder and T. Roncalli, "Managing risk exposures using the risk budgeting approach". University Library of Münich, Germany, Tech. Rep., . F. Spinu, "An algorithm for computing risk parity weights". SSRN, . T. Griveau-Billion, "A fast algorithm for computing high-dimensional risk parity portfolios". https://www.thierry-roncalli.com/ download/CCD-Risk-Parity.pdf, . T. Souza, "DIY Ray Dalio ETF: How to build your own Hedge Fund strategy with risk parity portfolios". https://www.openquants.com