The Hull, the Feasible Set, and the Risk Surface A Review of the Portfolio Modelling Infrastructure in R/Rmetrics g / Diethelm Würtz Institute for Theoretical Physics ETH Zurich Institute for Theoretical Physics ETH Zurich Curriculum for Computational Science ETH Zurich Finance Online & Rmetrics Association Zurich UseR! Gaithersburg, July 2010 Joint work with Yohan Chalabi, William Chen, Christine Dong, Andrew Ellis, Sebastian Pérez Saaibi, David Scott, Stefan Theussl www.itp.phys.ethz.ch | www.rmetrics.org | www.finance.ch Overview Part I Rmetrics and Our Visions Part II Portfolio Analysis with R/Rmetrics y / Part III Part III New Directions New Directions 2 Part I Who is Rmetrics and what are our Visions ? Rmetrics is a non profit taking Association under Swiss law working in the public interest in the field of measuring and analyzing risks in finance and related fields • W We operate an Educational and Teaching Platform t Ed ti l d T hi Pl tf • We offer an R Code Archive and a Public Tools Platform • We started to Build a Public Stability and Risk Data Base We started to Build a Public Stability and Risk Data Base about 50 packages and 25 developers on r‐forge 3 Vision No 1: An Open Educational and Teaching Platform An Open Educational and Teaching Platform Rmetrics Open Source Teaching Platform and Community • • • • • • Software Packages Serving as Code Archive Datafeeds for Public Available Data on the Web Datafeeds for Public Available Data on the Web High Quality Documentation R/Rmetrics eBooks Support Student Internships for Training at ETHZ Support Student Internships for Training at ETHZ Rmetrics Meielisalp Summer School Rmetrics Meielisalp User and Developer Workshop Rmetrics Meielisalp User and Developer Workshop 4 Vision No 2: An Open Code Archive An Open Code Archive Why we Maintain an R Code Archive • We need a platform which provides algorithms and software tools to measure and control the risk and software tools to measure and control the risk and unstabilities of financial investments. • We need more graphical tools which allow for better views on the performance risk attributions and views on the performance, risk attributions and stability of financial investments. 5 Vision No 3: An Open Stability and Risk Data Platform An Open Stability and Risk Data Platform Why we Create a Stability and Risk Data Platform • Financial stability and risk data are in the public interest. • We need an independent data base and platform which allows to make investments more transparent which allows to make investments more transparent and reproducible for everybody. • We believe it is time to start with such a project, feel j free to join us. 6 Part II Portfolio Design with R/Rmetrics • What is a Financial Portfolio? What is a Financial Portfolio? • Portfolio Objectives and Constraints • Rmetrics Portfolio Solver Interfaces Examples • Absolute and Relative Risk Objectives Ab l t d R l ti Ri k Obj ti • Covariance Matrix Estimation • Extreme Risk Measures Extreme Risk Measures • Estimation Risk/Problems 7 Example Swiss Pension Funds Swiss Pension Funds Performance of Swiss Pension Funds … based on Global Custody Data of Credit Suisse, as at December 31, 2009 This Index is not an artificially constructed performance index but an index that is based on actual pension fund data. Example Swiss Pension Fund Portfolio DJIA @14000 2Y Rolling Risk‐Return Nasdaq all time high 2000‐03‐10 9‐11 Lehman failed 2008‐09‐15 5Y Rolling Risk Return 5Y Rolling Risk‐Return 8 Example Swiss Pension Funds Benchmark Example Swiss Pension Fund Portfolio http://www.pictet.com/en/home/lpp_indices/lpp2005.html High Risk Medium m Risk Low w Risk The Benchmark is Risk not Stability 9 Fund & Portfolio Objectives j Minimum Risk Objective Minimize subject to subject to: Any Risk + Transaction Costs Return > a given level Return > a given level Any other user defined constraints Maximum Return Objective Maximum Return Objective Maximize subject to: Return – Transaction Costs Any Risk < a given level. Any other user defined constraints Any other user defined constraints Maximum Risk‐Adjusted Return Maximize Maximize subject to: Utility = Return – Utility = Return – λλ*Risk Risk –Transaction Costs –Transaction Costs where λ is a risk aversion Any user defined constraints Rmetrics Solver Interfaces fPortfolio Default Solver Interfaces fPortfolio Default Solver Interfaces QP quadprog LP Rglpk NLP Rdonlp2 NLP Rdonlp2 [Packages: Rsocp, Rsymphony, Rsolnp, Rnlminb2, Rcplex, ...] Rmetrics2AMPL Interface: LP, QP, NLP, MI[LQNL]P R i 2AMPL I f LP QP NLP MI[LQNL]P Open Source: Coin‐OR, e.g. ipopt, bonmin, ... Commercial: cplex, donlp2, gurobi, loqo, minos, snopt, ... Disadvantage: Requires to learn AMPL Forthcoming Solver Interface: ROI Package g g Vienna Group, Stefan Theussl et al. 11 Rmetrics Portfolio Constraints Performance Constraints Performance Constraints Bounds on Assets Linear Constraints Linear Constraints Quadratic Constraints Nonlinear Constraints Integer Constraints Integer Constraints Transaction Cost Limit Constraints Turnover Constraints Turnover Constraints Holding Constraints Factor Constraints Round Lots, Buy‐In, Cardinality, … New Risk Constraints e.g. Reserve Ratios for Pension Fund Portfolios Stability Indicators of Financial Markets – Stress Testing Pattern 12 Rmetrics fPortfolio Examples The Needs of Portfolio Managers The Needs of Portfolio Managers EDHEC Business School Report Felix Goltz, Edhec, 2009 13 Absolute Risk Objectives j When implementing portfolio optimization, do you set absolute risk measures? * * * * *Supported by fPortfolio 14 Relative Risk Objectives j When implementing portfolio optimization, do you set relative risk measures with respect to a benchmark? * * Source: Felix Goltz, Edhec, 2009 *Supported by fPortfolio * 15 Example Q Quantification of Risk Objectives ifi i f Ri k Obj i Risk Measures of Stone 1973 Markowitz 1952 [ k = 22, A = IInfinity, fi it Y0 = mean (R) ] 2 Solution: QP 1982, SOCP Programming 1994 Rockafeller & Uryasev CVaR 1992 Pederson and Satchell 1998 Pederson and k = 1, A = VaR, Y0 = 0 Solution: LP for some bounded function W ( ) Semi‐Variance Semi Variance MAD LPM ... Artzner Delbaen Eber Heath 1999 Artzner, Delbaen, Eber, Heath 1999 … this makes a coherent risk measure 16 Covariance Matrix Estimation When implementing portfolio optimization, h d how do you estimate the covariance matrix? i h i i ? * * * *Supported by fPortfolio [unpublished] * 17 Example Mean Variance Markowitz Portfolio Mean‐Variance Markowitz Portfolio 0.302 0.432 0.6 0.781 0.969 1.17 1.39 SBI SPI SII LMI MPI ALT 0.2 0 0.0 EWP Equal Weights Portfolio TGP Tangency Portfolio GMV Global Minim Risk ALT 0.000102 SPI 0.0266 0.053 0.0795 0.106 0.132 0.159 0.185 0.212 Target Return Weighted Return 0.15 0.20 Minimum Variance Locus Target Risk 0.302 0.432 0.6 0.781 0.969 1.17 1.39 SBI SPI SII LMI MPI ALT Efficient Frontier 0.10 EWP TGP 0.000102 1.0 1.5 Sample Covariance Risk Target Risk[Cov] 2.0 0.106 0.132 0.159 0.185 0.212 Target Return Covariance Risk Budgets Cov Risk Budgets 0 318 0.318 0 249 0.249 Target Risk 0 302 0.302 0 432 0.432 06 0.6 0 781 0.781 0 969 0.969 1 17 1.17 1 39 1.39 Cov Risk Budgets 0.6 0.8 1.0 SBI 0.0795 SBI SPI SII LMI MPI ALT 0.4 LMI 0.053 0.2 GMV 0.0266 0.0 MV | solveRquadprog Sharpe Ratio 0.0536 0.05 SII 0.5 0.00 0.0714 0.0 05 0.10 0 0.249 0.000102 0.0266 0.053 0.0795 0.106 0.132 0.159 0.185 MV | solveR Rquadprog | minRisk = 0.249 0.15 MPI 0.00 Sample e Mean Return Targe et Return[mean] 0.318 MV | solvveRquadprog | minRisk = 0.248 8532 Weighted Returns Weighted Returns 0.0 MV | so olveRquadprog | minRisk = 0.2 248532 Target Risk 0.249 Weigh ht 0.8 1.0 1 0.318 0.4 Efficient Frontier ‐ Feasible Set Efficient Frontier Swiss Pension Fund Poretfolio MV Portfolio | mean-Stdev View 0.20 Weights along the Variance Locus | Efficient Frontier Weights 0.6 Sample Mean and Covariance Estimates 0.212 Target Return 18 Example Factor Models Factor Models Sharpe’s Single Index Model vs. Mean Variance Markowitz for a monthly Portfolio of selected US Equities Sharpe's single index model General macroeconomic factor model Saample Mean Retu urn Barra industry factor model Statistical factor model PCA statistical factor model Asymptotic PCA statistical factor model y p Factor Covariance Risk 19 Example Estimation Error and Robustification Estimation Error and Robustification Improves Diversification of Investments SSample Estimator l i COV Robust Estimators MCD MVE OGK MCD, MVE, OGK, … Other Methods: Shrinkage Methods Bayes‐Stein Estimator Ledoit‐Wolf Ledoit Wolf Estimator Estimator Random Matrix Theory MC Denoising Factor Models Factor Models Packages: MASS robustbase corpcor tawny Packages: MASS, robustbase, corpcor, tawny, ... 20 Extreme Risk Measures When implementing portfolio optimization, how do you calculate extreme risk? * * * * *Supported by fPortfolio 21 Example R k f ll U Rockafeller‐Uryasev: Mean‐CVaR M CV R Samp ple Mean Return Mean‐CVaR Portfolio Optimization with Box and Group Constraints Swiss Pension Fund Portfolio Mean‐CVaR Portfolio 1992 Linear Programmig Problem … where Negative Conditional Value at Risk g 22 Estimation Risk/Problems / How do you deal with estimation risk/problems of estimating the expected returns ? f h d ? * * * * *Supported by fPortfolio *Supported by BLCOP *US Patented 23 Example Covariance Risk Budget Constraints Covariance Risk Budget Constraints Takes a finite Takes a finite risk resource, and decides how best to allocate it. Compute from the derivative p Normalized risk budgets Constrain the portfolio optimization Packages: fPortfolio, fAssets 24 Example Copulae Tail Risk Budget Constraints Tail Risk Budget Constraints Decreases pair wise tail risk dependence SBI CH Bonds SPI CH Stocks SII CH Immo LMI World Bonds MPI World Stocks ALT World AltInvest Tail Dependence Coefficient: Lower SBI SBI SBI SBI SBI SPI SPI SPI SPI SII SII LMI LMI MPI SPI SII LMI MPI ALT SII LMI MPI ALT LMI MPI MPI ALT ALT Copula dependence Coefficient: Portfolio Design: 0 0.055 0.064 0 0 0 0 0.352 0.273 0.075 0 0 0 0.124 Packages: fPortfolio, fCopulae 25 Part III New Directions • • • • Portfolio Risk Surfaces & Risk Profile Lines Rastered Motion Risk Surfaces Portfolio Shape Pictograms Stability Measures Risk Surfaces & Risk Profile Lines Mean Variance Markowitz Portfolio with Covariance Risk Budget Constraints Swiss Pension Fund Portfolio Risk Profiles Sample Mean Reeturn An edge or ridge is a line on the An edge or ridge is a line on the surface where the risk measure is best diversified. Covariance Risk Budget Profile On this risk profile (black thick line) the portfolios with the best line) the portfolios with the best diversified covariance risk budgets can be found. Sample Covariance Risk Example Investments along Risk Profiles Investments along Risk Profiles A simple Efficient Frontier Strategy Smoothly rebalance the investments from the tangency portfolio Smoothly rebalance the investments from the tangency portfolio if it exists, otherwise invest in the global minimum risk portfolio. Alternative Risk Profile Line Strategy Alternative Risk Profile Line Strategy Instead investing on the efficient frontier, we now invest in better risk diversified portfolios with the same return but now on p the ridge frontier. Remark: These portfolios have higher total risks, but are better diversified Package: fPortfolioBacktesting 28 Example Portfolio Backtesting Portfolio Backtesting Achieve lower drawdowns and shorter recovery times Draawdowns Investment on Efficient Frontier Cumulated return Portfolio Benchmark Investment on Drawdown Risk Profile Rastered Motion Risk Surfaces M Mean Variance Markowitz Portfolio Surface V i M k it P tf li S f Diversification of Weights and Kurtosis Values Swiss Pension Fund Portfolio Rastered Risk Surface Plots make multivariate risk displays possible Sample Mean Return X‐Axis YA i Y‐Axis Color Size Risk R Return var(Weights) Kurtosis Visualize changes in time with Motion Charts with Motion Charts Sample Covariance Risk Example Rmetrics and Google Motion Charts Rmetrics and Google Motion Charts A new understanding in portfolio analytics ? US Patented ? • Add dynamic components to multivariate data charts. • Track the evolution T k h l i of the risk surface. • Observe velocity Observe velocity and acceleration of a portfolio’s characteristic characteristic parameters. Data Spreadsheets are generated by R/Rmetrics Portfolio Shape Pictograms p g Rastered Feasible Set and Shape Picogram Mean Variance Markowitz Portfolio Swiss Pension Fund Portfolio Classification of feasible sets by shape pictograms Factor Modelling Generates new kind of factor models or allows for additional factor constraints Return Factors: Area Center Orientation Eccentricity Orientation Eccentricity Risk Investment Views Enables forecasts of economic developments, which we can use in the Black‐Litterman approach 32 Example: Peer Group Analysis Evolution of Portfolio Shapes Peer Group Analysis ‐ Evolution of Portfolio Shapes Idea Model and forecast economic behaviour Model and forecast economic behaviour using portfolio shape factors Shape Factors Eccentricity Orientatio on Center Ratio o Area Rolling Portfolio Shapes Date 33 Example: Shape Orientation Cycle MSCI EU Stock Index Universe Shape Orientation Cycle – MSCI EU Stock Index Universe The orientation factor is a good indicator of economic turmoil Peer Group Analysis: MSCI Developed Market Index Hongkong Stock Crisis 1987 Black Monday 9/11 Sub Prime Orieentation An ngle 1973/1974 The orange lines present identifiable patterns 34 Example: Orientation Eccentricity Breakout MSCI EU Indices Orientation‐Eccentricity Breakout – MSCI EU Indices Orientation Factor Eccentricity Factor 35 Stability Measures y Value View Structural Changes Breakpoint Detection Volatility View Volatility and Extreme Value Clustering Stress Scenario Library Multiresolution View l l Time/Frequency Analysis Wavelet Analysis Stability View Phase Space Embedding R b S i i Robust Statistics 36 Example Stability Measures USD EUR FX Rate Stability Measures – USD EUR FX Rate 37 Example Stability Measures Greece Gvt Stability Measures – Greece Gvt Bonds 38 Example Stability Measures – British Petroleum 39 Our Proposal Stability as New Peer Group & Portfolio Objectives f Objective Maximize Stability Subject to: j Return Constraints Risk Constraints Stress Resistance Constraints Stress Resistance Constraints 40 Joint work with: Yohan Chalabi William Chen Christine Dong A d Andrew Ellis Elli Sebastian Pérez Saaibi David Scott Stefan Theussl www.rmetrics.org www.ethz.ch [email protected] h h h Thank You Thank You
© Copyright 2025 Paperzz