26jan11 portfolio design presentation
TRANSCRIPT
Portfolio DesignPortfolio Design,Optimization and Stability Analysis
Di th l Wü t d M h d M ht
Optimi ation and Stability Analysis
Diethelm Würtz and Mahendra Mehta
Rmetrics AssociationWebinar, January 26, 2011
Sponsored byp y
Revolution Analytics, Sybase, Finance Online, NeuralTechSoft
Who is Rmetrics ?
The roots of Rmetrics go back to 1997. 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
• We operate an Open Source Educational and Teaching Platform• We provide an R Development Environment for Finance• We provide an R Development Environment for Finance• We offer an R Code Archive and a Public Tools Platform• We started to Build a Public Stability and Risk Data Base
Rmetrics has been originated from the Swiss Federal Institute ofTechnology in Zurich, ETH.
2
gy ,
Rmetrics Timeline1997 Starting with a Collection of SPlus Functions for Finance
1999 Moving to the R Environment
2001 Creating Rmetrics Software Packages
2002 Uploading the Rmetrics Packages to CRAN Server
2003 Introducing R‐sig‐Finance / Private Repository – Martin Mächler
2004 Providing Debian Packages – Dirk Eddelbüttel
2007 Organizing the1st Rmetrics User and Developer Workshop2007 Organizing the1 Rmetrics User and Developer Workshop
2008 Founding the Rmetrics Association / Offering Student Internships
2008 2nd Rmetrics Developer Workshop
2008 Joining R‐forge / Starting the Rmetrics Repository
2009 3rd Rmetrics User and Developer Workshop
2009 Fi t R t i B k “P tf li O ti i ti ith R/R t i ”
3
2009 First Rmetrics eBook “Portfolio Optimization with R/Rmetrics”
2010 Meielisalp Summer School on Computational Finance
Part I
What are the Needs of Portfolio Managers ?
• EDHEC Business School ReportEDHEC Business School Report• Absolute Risk Objectives• Relative Risk ObjectivesC i M t i E ti ti• Covariance Matrix Estimation
• Estimation Risk Problems
4
Absolute Risk Objectives
When implementing portfolio optimization, do you set absolute risk measures?
* *y
*Source: Felix Goltz, Edhec, 2009
*
5*Supported by fPortfolio
Relative Risk Objectives
When implementing portfolio optimization, do you set relative risk measures with respect to a benchmark?
*p
**
6*Supported by fPortfolio
Covariance Matrix Estimation
When implementing portfolio optimization, how do you estimate the covariance matrix?
*
*
**
7*Supported by fPortfolio [unpublished]
Estimation Risk/Problems
How do you deal with estimation risk/problemsof estimating the expected returns ?
*
** **
8*Supported by fPortfolio *Supported by BLCOP *US Patented
Part II
Portfolio Design
• Portfolio ObjectivesPortfolio Objectives• Quantification of Risk Objectives• Rmetrics Solver FactoryR t i P tf li C t i t• Rmetrics Portfolio Constraints
• Rmetrics Performance Analysis• fPortfolio Package
9
Portfolio Objectives
Mi i i k bj tiMinimum risk objectiveMinimize Any Risk + Transaction Costssubject to: Return > a given level
Any other user defined constraintsy
Maximum return objectiveMaximize Return – Transaction Costsbj t t A Ri k i l lsubject to: Any Risk < a given level.
Any other user defined constraints
Maximum risk‐adjusted returnjMaximize Utility = Return – λ*Risk –Transaction Costs
where λ is a risk aversionsubject to: Any user defined constraints
10
Quantification of Risk ObjectivesRisk measures of Stone 1973
[ k = 2, A = Infinity, Y0 = mean (R) ]2Markowitz 1952
S l ti QP 1982 SOCP P i 1994
Pederson and Satchell 1998Rockafeller & Uryasev CVaR 1992
k = 1, A = VaR, Y0 = 0
Solution: QP 1982, SOCP Programming 1994
for some bounded function W ( )
Solution: LP
Semi‐VarianceMADLPM...
Artzner, Delbaen, Eber, Heath 1999
11… this makes a coherent risk measure
Rmetrics Solver Factory
fPortfolio default solver interfacesQP quadprogLP Rglpk NLP Rdonlp2 [ k h l l b l ][Packages: Rsocp, Rsymphony, Rsolnp, Rnlminb2, Rcplex, ...]
Rmetrics2AMPL interface: LP, QP, NLP, MI[LQNL]POpen Source: Coin OR e g ipopt bonminOpen Source: Coin‐OR, e.g. ipopt, bonmin, ... Commercial: cplex, donlp2, gurobi, loqo, minos, snopt, ...Requirement: AMPL Language
Forthcoming R solver interface: ROI packageVienna Group, Stefan Theussl et al.
12Supported by Rmetrics packages [unpublished]
Rmetrics Portfolio Constraints
Performance constraints
Bounds on Assets Transaction Cost Limit ConstraintsLinear Constraints Turnover Constraints Quadratic Constraints Holding ConstraintsNonlinear Constraints Factor ConstraintsInteger ConstraintsRound Lots, Buy‐In, Cardinality, …
New risk constraints
Reserve Ratios for Pension Fund PortfoliosStability Indicators of Financial Markets – Stress Testing Pattern
13Supported by Rmetrics packages [unpublished]
Mean‐Variance Markowitz Portfolio
0.8
1.0
SBISPISIILMIMPI0.
81.
0
0.318 0.249 0.302 0.432 0.6 0.781 0.969 1.17 1.39Target Risk
Wei
ght
Ris
k =
0.24
8532
WeightsWeights along the Variance Locus | Efficient FrontierSample mean and covariance estimates
Efficient FrontierMV Portfolio | mean-Stdev View
SPIALT
0.0
0.2
0.4
0.6
MPIALT
0.0
0.2
0.4
0.6
0.000102 0.0266 0.053 0.0795 0.106 0.132 0.159 0.185 0.212
MV
| sol
veR
quad
prog
| m
inR
EWP Equal Weights PortfolioTGP Tangency Portfolio
Efficient Frontier ‐ Feasible SetSwiss Pension Fund Portfolio
0.15
0.20
n[m
ean]
SPI
MPI
Target Return
0.15
0.20 SBI
SPISIILMIMPIALT
0.15
0.20
0.318 0.249 0.302 0.432 0.6 0.781 0.969 1.17 1.39Target Risk
Wei
ghte
d R
etur
n
| min
Ris
k =
0.24
8532
Weighted Returns
TGP Tangency PortfolioGMV Global Minim Risk
MinimumVarianceLocus
Efficient Frontier
Weighted Returns
Return
0.05
0.10
Targ
et R
etur
n
.053
6
0.0
714
SII
0.00
0.05
0.10
0.00
0.05
0.10
0.000102 0.0266 0.053 0.0795 0.106 0.132 0.159 0.185 0.212Target Return
W
MV
| sol
veR
quad
prog
EWP
TGP
Sharpe Ratio
Sample Mean
0.0 0.5 1.0 1.5 2.0
0.00
0
MV
| sol
veR
quad
prog 0
SBILMI
.40.
60.
81.
0
SBISPISIILMIMPIALT
.40.
60.
81.
0
0.318 0.249 0.302 0.432 0.6 0.781 0.969 1.17 1.39Target Risk
Cov
Ris
k Bu
dget
s
adpr
og |
min
Ris
k =
0.24
9
Cov Risk BudgetsSharpe Ratio
GMV
Covariance Risk Budgets
S l C i i kTarget Risk[Cov]
0.0
0.2
0.0.
00.
20.
0.000102 0.0266 0.053 0.0795 0.106 0.132 0.159 0.185 0.212Target Return
MV
| sol
veR
quaSample Covariance Risk
14
Portfolio FrontierCode Example: Long‐Only Markowitz# LPP Portfolio Example:Data <- as.timeSeries(data(LPP2005REC))[, 1:6]Spec <- portfolioSpec()Constraints <- "LongOnly"
# Portfolio Frontier:
Load Data, set Spec and Constraints
Compute the efficient frontier on 5 # Portfolio Frontier:setNFrontierPoints(Spec) <- 5portfolioFrontier(Data, Spec, Constraints)
Title:MV Portfolio Frontier Estimator: covEstimator
pequidistant points (to reduce the output)
Output:Title
Solver: solveRquadprog
Portfolio Weights:SBI SPI SII LMI MPI ALT
1 1.0000 0.0000 0.0000 0.0000 0 0.00002 0.0193 0.0000 0.1481 0.6665 0 0.16613 0.0000 0.0085 0.2535 0.3386 0 0.3994
The portfolio weights
4 0.0000 0.0210 0.3458 0.0000 0 0.63325 0.0000 0.0000 0.0000 0.0000 0 1.0000
Covariance Risk Budgets:SBI SPI SII LMI MPI ALT
1 1.0000 0.0000 0.0000 0.0000 0 0.00002 0.0064 0.0000 0.1593 0.3359 0 0.4984
The covariance risk budgets
3 0.0000 0.0183 0.1208 -0.0097 0 0.87074 0.0000 0.0286 0.0890 0.0000 0 0.88245 0.0000 0.0000 0.0000 0.0000 0 1.0000
Target Return and Risks:mean mu Cov Sigma CVaR VaR
1 0.0001024718 0.0001024718 0.3177554 0.3177554 0.6949543 0.5485503
The target risk and target return:mean – sample mean
mu – e.g. robust/shrinked meanCov sample covariance 2 0.0541105688 0.0541105688 0.3059123 0.3059123 0.5951772 0.4434369
3 0.1081186658 0.1081186658 0.6146980 0.6146980 1.3293170 0.85487894 0.1621267628 0.1621267628 0.9926528 0.9926528 2.2230719 1.48334985 0.2161348598 0.2161348598 1.4324632 1.4324632 3.3625018 2.2626952
Cov – sample covarianceSigma – e.g. robust/shrinked CovCVaR – Conditional Value-at-Risk
VaR – Value-at-Risk
Constrainted MV PortfoliosCode Example: Add Constraints
# Example:0 339 0 447 0 613 0 793 0 983 1 2
Target Risk
nRis
k =
Weights MVp
Data <- 252*as.timeSeries(data(LPP2005REC))[,1:6]Spec <- portfolioSpec()Constraints <- c("minW[1:6]=0.05",
"maxsumW[c('SBI','LMI']=0.6")
# MV Markowitz Frontier:1
0.0
0.4
0.8 SBI
SPISIILMIMPIALT
0.0
0.4
0.8
0.339 0.447 0.613 0.793 0.983 1.2
0.0486 0.0751 0.102 0.128 0.154 0.181T t R t
Wei
ght
MV
| sol
veR
quad
prog
| m
in64
1
Frontier1 <-portfolioFrontier(Data,Spec,Constraints)
# Robust MV Frontier:setEstimator(Spec) <- "covMcdEstimator"Frontier2 <-
portfolioFrontier(Data Spec Contraints)
Target Return
0.4
0.8
SBISPISIILMIMPIALT
0.4
0.8
0.339 0.449 0.622 0.808 1 1.22Target Risk
Wei
ght
lveR
quad
prog
| m
inR
isk
= 0.
3386
Weights Robust MV
portfolioFrontier(Data,Spec,Contraints)
# QLPM Frontier:setType(Spec) <- "QLPM" setEstimator(Spec) <- "lpmEstimator"Spec@model$param$a <- 1.25Spec@model$param$tau <- "colMeans"
0.0
00.
00
0.0486 0.0751 0.102 0.128 0.154 0.181Target Return
MV
| so
0.345 0.459 0.623 0.817 1.02 1.23Target Risk
ht rog
| min
Ris
k =
0.34
5168
Weights Quadratic LPM a=1.25
p pFrontier3 <-
portfolioFrontier(Data,Spec,Constraints)
# Weights Plot:palette <- seqPalette(7,"OrRd")[-1]weightsPlot(Frontier1, col=palette))
i h l ( i 2 l l ))
0.0
0.4
0.8 SBI
SPISIILMIMPIALT
0.0
0.4
0.8
0.0486 0.0751 0.102 0.128 0.154 0.181Target Return
Wei
gh
QLP
M |
solv
eRqu
adp
weightsPlot(Frontier2, col=palette))weightsPlot(Frontier3, col=palette))
16
Factor Models*
Sharpe’s Single Index Model vs Mean Variance Markowitz
Sharpe's single index model General macroeconomic factor model
Sharpe s Single Index Model vs. Mean Variance Markowitz for a monthly Portfolio of selected US Equities
Barra industry factor model Statistical factor model
Mean Re
turn
PCA statistical factor model Asymptotic PCA statistical factor model
Sample M
*[unpublished]
Factor Covariance Risk
17
Estimation Error and Robustification
Sample estimatorImproves diversification of investments
COVRobust estimatorsMCD, MVE, OGK, …
Other methods:
Shrinkage methodsB S i E iBayes‐Stein EstimatorLedoit‐Wolf Estimator
Random matrix theoryMC Denoisingg
Factor models
18
Packages: MASS, robustbase, corpcor, tawny, ...
Robust PortfoliosCode Example: Alternative Covariance
# Example:Data <- 252*as.timeSeries(data(LPP2005REC))[,1:6]Spec <- portfolioSpec()Constraints <- "LongOnly"
# Standard Sample Estimator:frontierMarkowitz <-
portfolioFrontier(Data, Spec, Constraints)
# Kendall Rank Estimator:setEstimator(Spec) <- "kendallEstimator”( p )kendallEstimator <-
function (x, spec = NULL,...) {mu <- colMeans(x)Sigma <- cov(x, method = "kendall")list(mu = mu, Sigma = Sigma)}
FrontierKendall <-FrontierKendall <portfolioFrontier(Data, Spec, Constraints)
# Weights Plot:palette <- seqPalette(7,"OrRd")[-1] weightsPlot(FrontierMarkowitz col = palette)weightsPlot(FrontierMarkowitz, col = palette)weightsPlot(FrontierKendall, col = palette)
Seite 19
Rockafeller‐Uryasev: Mean‐CVaR
Mean‐CVaR portfolio 1992Mean‐CVaR Portfolio Optimization p
Linear Programming Problemwith Box and Group Constraints Swiss Pension Fund Portfolio
n Re
turn
where
…Sample Mea
where
20
Negative Conditional Value at Risk
Covariance Risk Budget Constraints
Takes a finite risk resource and decides
Compute from the derivativerisk resource, and decides
how best to allocate it.
Normalized risk budgets
C t i th tf li ti i tiConstrain the portfolio optimization
21
Packages: fPortfolio, fAssets
Copulae Tail Risk Budget Constraints
Decreases pair wise tail risk dependence
SBI CH BondsSPI CH StocksSII CH ImmoLMI World BondsMPI World StocksALT World AltInvest
Copula dependence Coefficient:
Tail Dependence Coefficient:Lower
ALT World AltInvest
Portfolio Design:SBI SPI 0 SBI SII 0.055 SBI LMI 0.064 SBI MPI 0 SBI ALT 0 SPI SII 0 SPI LMI 0 SPI MPI 0 352SPI MPI 0.352 SPI ALT 0.273 SII LMI 0.075 SII MPI 0 LMI MPI 0 LMI ALT 0 MPI ALT 0.124
22Packages: fPortfolio, fCopulae
Part III
New Directions
• Portfolio Risk Surfaces & Risk Profile LinesPortfolio Risk Surfaces & Risk Profile Lines• Rastered Motion Risk Surfaces• Portfolio Shape PictogramsSt bilit M• Stability Measures
23
Reward/Risk SurfacesUse concepts to explore and diversify individual risks andfind more attractive investment opportunities and trading strategies
Risk surfaces are plots of any risk measures across the feasible set expressed by
Covariance Risk Budget Diversification:Minimize the variance of the individual Risk!
Image PlotsContour PlotsPerspective Plots
d
Efficient Frontier
Edge or ridge frontiers are lines where the individual risks of each asset or individual are bestSu
ccess o
r Rew
ard
Edge/Risk Profile each asset or individual are best diversified
Notebetter investment strategies can be
g /
better investment strategies can be found on the edge or ridge frontier!Raster Plot – Topo PaletteRisk
24
Investments Along Risk Profiles
A simple efficient frontier strategy
Smoothly rebalance the investments from the tangency portfolio if it exists, otherwise invest in the global minimum risk portfolio.
Alternative risk profile line strategy
Instead investing on the efficient frontier, we now invest in b tt i k di ifi d tf li ith th t b tbetter risk diversified portfolios with the same return but now on the ridge frontier.
Remark: These portfolios have higher total risks, but are better diversified
Package: fPortfolioBacktesting25
Portfolio Backtesting
Achieve lower draw‐downs and shorter recovery times
Investment on Efficient Frontier Investment on Drawdown Risk Profile
Draw
downs
rn
Portfolio
Cumulated
retu
Benchmark
26
Rastered Risk Surfaces
Rastered risk surface plotsMean Variance Markowitz Portfolio SurfaceDiversification of Weights and Kurtosis Values Rastered risk surface plots
make multivariate risk displayspossible
Diversification of Weights and Kurtosis ValuesSwiss Pension Fund Portfolio
X‐Axis RiskY‐Axis ReturnColor var(Weights)Size KurtosisM
ean Re
turn
Size Kurtosis
Visualize changes in timei h M i Ch
Sample M
with Motion Charts
Use Parallel ImplementationSample Covariance Risk pp
27
Rmetrics and Google Motion Charts
• Add dynamic
A new understanding in portfolio analytics ?
• Add dynamic components tomultivariate data charts.
• Track the evolution of the risk surface.
• Observe velocity and acceleration of a portfolio’s characteristic parameters.
Data Spreadsheets are generated by R/Rmetrics
28
Part IVStable Portfolios ‐ what does it mean?
Stability of Rolling Portfolios
• Stability Measures for Financial Time Series • Explaining and Understanding Stability Measures• Phase Space Embedding and Rolling IndicationsPhase Space Embedding and Rolling Indications• Bayesian Detection of Intraday Structural Breaks
29
Stability MeasuresRmetrics has software for different stability measures creating selective views on structural breaks and changes, jumps, outliers, and extreme dynamical dependencies
Value viewStructural Changes Breakpoint Detection
Variability viewVolatility and Extreme Value ClusteringStress Scenario LibraryStress Scenario Library
Multiresolution viewTime/Frequency AnalysisWavelet Analysisy
Stability viewPhase Space EmbeddingRobust Statistics
30
USD/EUR StabilityFor example generate an indicative view on the stability status oftime series values, volatilities, multiresolution behavior and stability
31
Rolling Indications
Log Stock Market Index
Explore instabilities with the phase space embedding approach
Signal ?
low Stability
Sep 7: Federal takeover of Fannie Mae and Freddie Mac Sep 14: Merrill Lynch sold to Bank of America and Lehmann Brothers collapse
high
32
Sep 14: Merrill Lynch sold to Bank of America and Lehmann Brothers collapseSep 15: Lehmann Brothers files for bankruptcy protectionSep 16: Moody’s and S&P downgrade ratings on AIGSep 17: The US FED lends $85 billion to AIG to avoid bankruptcy. Sep 18: Paulson and Bernanke propose a $700 billion emergency bailout
Intraday Price/Index BreaksExplore the Index/Price by a rolling Bayesian ApproachYou can do this for Indices/Prices, Returns, Volatilities or any other dynamic quantity
Training Phase Forecasting Phase
abilitie
s
Index/Price
Prob
a
Forecasting PhaseTraining Phase
S llIndex/Price
Sell
Buy Sell
33
Portfolio Stability ObjectivesNew concepts to optimize and stabilize dynamic systemslike portfolios , peer groups, or trading strategies
ObjectiveObjectiveMaximize Stability
Subject to:Success/Reward ConstraintsLoss/Risk ConstraintsStress Resistance Constraints
34
Part VHow to valuate and compare correlations and dependency structures in portfolios, in peer groups, and in trading strategies ?
Looking for Peer Group InstabilitiesLooking for Peer Group Instabilities
• Factor Shape Modeling • Portfolio Shape Pictograms• Portfolio Shape Pictograms• Dynamical Evolution of Geometrical Shapes• Shape Orientation Cycles• Portfolio Stability ObjectivesPortfolio Stability Objectives
35
Factor Shape ModelingA new geometric factorization approach in portfolio design
Classification of feasible sets of portfolios, peer groups, trading strategies by shape pictograms:
area mass centerorientation excentricity
Geometric factor modellingGeometric factor modellingGenerates new kind of factor interactions and models or allows for additional factor constraints – use shape pictograms
Black‐Litterman investment like viewsIncorporates forecasts and expectations on the economic development which we can use in the pBlack‐Litterman approach – use shape pictograms
36
Dynamical Evolution of ShapesModel and forecast economic behaviour, explore peer groups, or evaluate trading strategies using dynamic shape factors
R lli d/ i k hRolling reward/risk shapes Geometric shape factors
Area
enterR
atio A
Orie
ntation Ce
Date
Eccentricity
37
Date
Shape Orientation CyclesUse the shape orientation cycle indicator or other derived indicators from geometric factor analysis to find structures in your portfolios, peer groups or trading strategies
Peer group analysis: MSCI developed market indexPeer group analysis: MSCI developed market index
Hongkong Sub Prime9/11Black MondayStock Crisis 19871973/1974
on Angle
Orie
ntatio
The orange lines present identifiable patterns
38
Use this approach to look for patterns in automated trading strategies and/or to analyze the behaviour of your models and human traders!
Making Live Easier
h l
U R t i ’ Ad d P tf li E i t
The Tools …
Use Rmetrics’ Advanced Portfolio EnvironmentDevelop with Revolution’s GUIUse its Powerful Time Consuming DebuggingUse Parallel Computing with R/Revolution
39
t iTh k t
Special offer for webinar participants: www.rmetrics.org/ebooks‐bundle
www.rmetrics.orgThanks to:Yohan ChalabiWilliam ChenChristine Dong
Th k Y
[email protected] DongAndrew EllisSebastian Pérez SaaibiDavid Scott Thank YouDavid ScottStefan Theussl
Questions?Questions?
• Slides and Replay from today’s webinar:Slides and Replay from today s webinar:– bit.ly/portfolio‐webinar
• Download R: www.inside‐r.org/download• Visit Rmetrics: www.rmetrics.org
– Download: www.rmetrics.org/software– Ebooks: www.rmetrics.org/ebooks
41