Portfolio Optimization. Prof. Daniel P. Palomar

Similar documents
Portfolio Optimization with Alternative Risk Measures

Portfolio Management and Optimal Execution via Convex Optimization

PORTFOLIO THEORY. Master in Finance INVESTMENTS. Szabolcs Sebestyén

Statistical Analysis of Data from the Stock Markets. UiO-STK4510 Autumn 2015

IEOR E4602: Quantitative Risk Management

MEASURING PORTFOLIO RISKS USING CONDITIONAL COPULA-AR-GARCH MODEL

CSCI 1951-G Optimization Methods in Finance Part 00: Course Logistics Introduction to Finance Optimization Problems

The University of Chicago, Booth School of Business Business 41202, Spring Quarter 2012, Mr. Ruey S. Tsay. Solutions to Final Exam

Log-Robust Portfolio Management

I. Return Calculations (20 pts, 4 points each)

Course information FN3142 Quantitative finance

Portfolio Risk Management and Linear Factor Models

Mean Variance Analysis and CAPM

EE365: Risk Averse Control

Financial Giffen Goods: Examples and Counterexamples

LECTURE NOTES 10 ARIEL M. VIALE

Mean-Variance Analysis

Asset Allocation Model with Tail Risk Parity

Extend the ideas of Kan and Zhou paper on Optimal Portfolio Construction under parameter uncertainty

The mean-variance portfolio choice framework and its generalizations

The Optimization Process: An example of portfolio optimization

Markowitz portfolio theory

Risk Management and Time Series

The University of Chicago, Booth School of Business Business 41202, Spring Quarter 2009, Mr. Ruey S. Tsay. Solutions to Final Exam

Lecture 6: Non Normal Distributions

An Application of Extreme Value Theory for Measuring Financial Risk in the Uruguayan Pension Fund 1

Chapter 7: Portfolio Theory

Amath 546/Econ 589 Univariate GARCH Models

Robust Portfolio Optimization with Derivative Insurance Guarantees

Quantitative Risk Management

Measuring Financial Risk using Extreme Value Theory: evidence from Pakistan

High-Frequency Data Analysis and Market Microstructure [Tsay (2005), chapter 5]

Practical example of an Economic Scenario Generator

CSCI 1951-G Optimization Methods in Finance Part 07: Portfolio Optimization

Lecture 10: Performance measures

Minimizing Timing Luck with Portfolio Tranching The Difference Between Hired and Fired

Optimal Portfolio Selection Under the Estimation Risk in Mean Return

Multi-period mean variance asset allocation: Is it bad to win the lottery?

The University of Chicago, Booth School of Business Business 41202, Spring Quarter 2011, Mr. Ruey S. Tsay. Solutions to Final Exam.

Lecture 2: Fundamentals of meanvariance

Market Risk Analysis Volume I

Risk Reward Optimisation for Long-Run Investors: an Empirical Analysis

Covariance Matrix Estimation using an Errors-in-Variables Factor Model with Applications to Portfolio Selection and a Deregulated Electricity Market

A Broader View of the Mean-Variance Optimization Framework

Graduate School of Business, University of Chicago Business 41202, Spring Quarter 2007, Mr. Ruey S. Tsay. Solutions to Final Exam

Portfolio Optimization using Conditional Sharpe Ratio

Two Hours. Mathematical formula books and statistical tables are to be provided THE UNIVERSITY OF MANCHESTER. 22 January :00 16:00

In terms of covariance the Markowitz portfolio optimisation problem is:

Asymptotic methods in risk management. Advances in Financial Mathematics

Lecture 1: The Econometrics of Financial Returns

Dynamic Replication of Non-Maturing Assets and Liabilities

Chapter 8. Markowitz Portfolio Theory. 8.1 Expected Returns and Covariance

PORTFOLIO OPTIMIZATION AND SHARPE RATIO BASED ON COPULA APPROACH

Some useful optimization problems in portfolio theory

Multi-Period Trading via Convex Optimization

Modelling financial data with stochastic processes

12. Conditional heteroscedastic models (ARCH) MA6622, Ernesto Mordecki, CityU, HK, 2006.

Lecture IV Portfolio management: Efficient portfolios. Introduction to Finance Mathematics Fall Financial mathematics

Optimal Security Liquidation Algorithms

Idiosyncratic risk, insurance, and aggregate consumption dynamics: a likelihood perspective

u (x) < 0. and if you believe in diminishing return of the wealth, then you would require

Introduction to Computational Finance and Financial Econometrics Descriptive Statistics

Portfolio theory and risk management Homework set 2

Midterm Exam. b. What are the continuously compounded returns for the two stocks?

Journal of Computational and Applied Mathematics. The mean-absolute deviation portfolio selection problem with interval-valued returns

MATH3075/3975 FINANCIAL MATHEMATICS TUTORIAL PROBLEMS

OPTIMAL PORTFOLIO CONTROL WITH TRADING STRATEGIES OF FINITE

Stochastic Programming and Financial Analysis IE447. Midterm Review. Dr. Ted Ralphs

Random Variables and Probability Distributions

Techniques for Calculating the Efficient Frontier

MS-E2114 Investment Science Lecture 5: Mean-variance portfolio theory

The Constant Expected Return Model

On modelling of electricity spot price

Fitting financial time series returns distributions: a mixture normality approach

Risk Control of Mean-Reversion Time in Statistical Arbitrage,

Some Simple Stochastic Models for Analyzing Investment Guarantees p. 1/36

Risk, Coherency and Cooperative Game

Financial Econometrics

Scenario-Based Value-at-Risk Optimization

The Duration Derby: A Comparison of Duration Based Strategies in Asset Liability Management

Mean Variance Portfolio Theory

Quantitative Portfolio Theory & Performance Analysis

Applications of Linear Programming

Business Statistics 41000: Probability 3

Downside Risk: Implications for Financial Management Robert Engle NYU Stern School of Business Carlos III, May 24,2004

Chapter 15: Jump Processes and Incomplete Markets. 1 Jumps as One Explanation of Incomplete Markets

The University of Chicago, Booth School of Business Business 41202, Spring Quarter 2010, Mr. Ruey S. Tsay Solutions to Final Exam

Can you do better than cap-weighted equity benchmarks?

Asset Allocation and Risk Assessment with Gross Exposure Constraints

Portfolio selection with multiple risk measures

Characterization of the Optimum

Pairs Trading. Prof. Daniel P. Palomar. The Hong Kong University of Science and Technology (HKUST)

Absolute Return Volatility. JOHN COTTER* University College Dublin

Financial Economics: Risk Aversion and Investment Decisions, Modern Portfolio Theory

Statistics and Finance

Solving dynamic portfolio choice problems by recursing on optimized portfolio weights or on the value function?

Outline. Simple, Compound, and Reduced Lotteries Independence Axiom Expected Utility Theory Money Lotteries Risk Aversion

ARCH and GARCH models

Dynamic Asset and Liability Management Models for Pension Systems

Example 1 of econometric analysis: the Market Model

Transcription:

Portfolio Optimization Prof. Daniel P. Palomar The Hong Kong University of Science and Technology (HKUST) MAFS6010R- Portfolio Optimization with R MSc in Financial Mathematics Fall 2018-19, HKUST, Hong Kong

Outline 1 Primer on Financial Data 2 Modeling the Returns 3 Portfolio Optimization Preliminaries Markowitz Portfolio Global Minimum Variance Portfolio (GMVP) Maximum Sharpe Ratio Portfolio Markowitz Portfolio with Practical Constraints Linear Returns vs Log-Returns Revisited Drawbacks of Markowitz s formulation

Outline 1 Primer on Financial Data 2 Modeling the Returns 3 Portfolio Optimization Preliminaries Markowitz Portfolio Global Minimum Variance Portfolio (GMVP) Maximum Sharpe Ratio Portfolio Markowitz Portfolio with Practical Constraints Linear Returns vs Log-Returns Revisited Drawbacks of Markowitz s formulation

Asset Log-Prices Let p t be the price of an asset at (discrete) time index t. The fundamental model is based on modeling the log-prices y t log p t as a random walk: y t = µ + y t 1 + ɛ t SP500 index log price 6.6 6.8 7.0 7.2 7.4 7.6 7.8 Jan 03 2007 Jan 02 2008 Jan 02 2009 Jan 04 2010 Jan 03 2011 Jan 03 2012 Jan 02 2013 Jan 02 2014 Jan 02 2015 Jan 04 2016 Jan 03 2017 D. Palomar Portfolio Optimization 4 / 58

Asset Returns For stocks, returns are used for the modeling since they are stationary (as opposed to the previous random walk). Simple return (a.k.a. linear or net return) is R t p t p t 1 p t 1 = p t p t 1 1. Log-return (a.k.a. continuously compounded return) is r t y t y t 1 = log Observe that the log-return is stationary : p t p t 1 = log (1 + R t ). r t = y t y t 1 = µ + ɛ t Note r t = log (1 + R t ) R t when R t is small. 1 1 D. Ruppert, Statistics and Data Analysis for Financial Engineering. Springer, 2010. D. Palomar Portfolio Optimization 5 / 58

Log-Returns vs Simple Returns 0.1 0.08 Simple return: R t Log return: r t =log(1+r t ) 0.06 0.04 0.02 0 0.02 0.04 0.06 0.08 0.1 0.1 0.08 0.06 0.04 0.02 0 0.02 0.04 0.06 0.08 0.1 R t D. Palomar Portfolio Optimization 6 / 58

S&P 500 Index - Log-Returns SP500 index log return 0.10 0.05 0.00 0.05 0.10 Jan 04 2007 Jan 02 2008 Jan 02 2009 Jan 04 2010 Jan 03 2011 Jan 03 2012 Jan 02 2013 Jan 02 2014 Jan 02 2015 Jan 04 2016 Jan 03 2017 D. Palomar Portfolio Optimization 7 / 58

Autocorrelation ACF of S&P 500 log-returns: S&P 500 index ACF of log returns 0.0 0.2 0.4 0.6 0.8 1.0 0 5 10 15 20 25 30 35 Lag D. Palomar Portfolio Optimization 8 / 58

Non-Gaussianity and asymmetry Histograms of S&P 500 log-returns: Histogram of daily log returns Histogram of weekly log returns Histogram of biweekly log returns Density 0 10 20 30 40 50 60 Density 0 5 10 15 20 25 Density 0 5 10 15 0.10 0.05 0.00 0.05 0.10 return 0.2 0.1 0.0 0.1 return 0.3 0.2 0.1 0.0 0.1 0.2 return Histogram of monthly log returns Histogram of bimonthly log returns Histogram of quarterly log returns Density 0 2 4 6 8 10 12 14 Density 0 2 4 6 8 Density 0 2 4 6 8 10 0.3 0.2 0.1 0.0 0.1 0.2 return 0.4 0.2 0.0 0.2 return 0.4 0.2 0.0 0.2 return D. Palomar Portfolio Optimization 9 / 58

Asymmetry Skewness of S&P 500 log-returns vs frequency (dangerous!): Skewness of SP500 log returns skewness 1.5 1.0 0.5 0 10 20 30 40 50 60 frequency [days] D. Palomar Portfolio Optimization 10 / 58

Heavy-tailness QQ plots of S&P 500 log-returns: QQ plot of daily log returns QQ plot of weekly log returns QQ plot of biweekly log returns Sample Quantiles 0.10 0.05 0.00 0.05 0.10 Sample Quantiles 0.2 0.1 0.0 0.1 Sample Quantiles 0.3 0.2 0.1 0.0 0.1 0.2 3 2 1 0 1 2 3 3 2 1 0 1 2 3 3 2 1 0 1 2 3 Theoretical Quantiles Theoretical Quantiles Theoretical Quantiles QQ plot of monthly log returns QQ plot of bimonthly log returns QQ plot of quarterly log returns Sample Quantiles 0.3 0.2 0.1 0.0 0.1 0.2 Sample Quantiles 0.4 0.2 0.0 0.2 Sample Quantiles 0.4 0.2 0.0 0.2 3 2 1 0 1 2 3 3 2 1 0 1 2 3 3 2 1 0 1 2 3 Theoretical Quantiles Theoretical Quantiles Theoretical Quantiles D. Palomar Portfolio Optimization 11 / 58

Heavy-tailness vs frequency Kurtosis of S&P 500 log-returns vs frequency: Kurtosis of SP500 log returns excess kurtosis 7 8 9 10 0 10 20 30 40 50 60 frequency [days] D. Palomar Portfolio Optimization 12 / 58

Volatility clustering S&P 500 log-returns: SP500 index log return 0.10 0.05 0.00 0.05 0.10 Jan 04 2007 Jan 02 2008 Jan 02 2009 Jan 04 2010 Jan 03 2011 Jan 03 2012 Jan 02 2013 Jan 02 2014 Jan 02 2015 Jan 04 2016 Jan 03 2017 D. Palomar Portfolio Optimization 13 / 58

Volatility clustering removed Standardized S&P 500 log-returns: Standardized SP500 index log return 4 2 0 2 Jan 04 2007 Jan 02 2008 Jan 02 2009 Jan 04 2010 Jan 03 2011 Jan 03 2012 Jan 02 2013 Jan 02 2014 Jan 02 2015 Jan 04 2016 Jan 03 2017 D. Palomar Portfolio Optimization 14 / 58

Conditional heavy-tailness and aggregational Gaussianity QQ plots of standardized S&P 500 log-returns: QQ plot of daily standardized log returns QQ plot of weekly standardized log returns QQ plot of biweekly standardized log returns Sample Quantiles 4 2 0 2 Sample Quantiles 4 3 2 1 0 1 2 3 Sample Quantiles 4 2 0 2 3 2 1 0 1 2 3 Theoretical Quantiles 3 2 1 0 1 2 3 Theoretical Quantiles 3 2 1 0 1 2 3 Theoretical Quantiles QQ plot of monthly standardized log returns QQ plot of bimonthly standardized log returns QQ plot of quarterly standardized log returns Sample Quantiles 3 2 1 0 1 2 3 Sample Quantiles 2 0 2 4 Sample Quantiles 2 0 2 4 3 2 1 0 1 2 3 Theoretical Quantiles 3 2 1 0 1 2 3 Theoretical Quantiles 3 2 1 0 1 2 3 Theoretical Quantiles D. Palomar Portfolio Optimization 15 / 58

Frequency of data Low frequency (weekly, monthly): Gaussian distributions seems to fit reality after correcting for volatility clustering (except for the asymmetry), but the nonstationarity is a big issue Medium frequency (daily): definitely heavy tails even after correcting for volatility clustering, as well as asymmetry High frequency (intraday, 30min, 5min, tick-data): below 5min the noise microstructure starts to reveal itself D. Palomar Portfolio Optimization 16 / 58

Outline 1 Primer on Financial Data 2 Modeling the Returns 3 Portfolio Optimization Preliminaries Markowitz Portfolio Global Minimum Variance Portfolio (GMVP) Maximum Sharpe Ratio Portfolio Markowitz Portfolio with Practical Constraints Linear Returns vs Log-Returns Revisited Drawbacks of Markowitz s formulation

Returns of the Universe In practice, we don t just deal with one asset but with a whole universe of N assets. We denote the log-returns of the N assets at time t with the vector r t R N. The time index t can denote any arbitrary period such as days, weeks, months, 5-min intervals, etc. F t 1 denotes the previous historical data. Financial modeling aims at modeling r t conditional on F t 1. r t is a multivariate stochastic process with conditional mean and covariance matrix denoted as 3 µ t E [r t F t 1 ] Σ t Cov [r t F t 1 ] = E [(r t µ t )(r t µ t ) T F t 1 ]. 3 Y. Feng and D. P. Palomar, A Signal Processing Perspective on Financial Engineering. Foundations and Trends R in Signal Processing, Now Publishers Inc., 2016. D. Palomar Portfolio Optimization 18 / 58

I.I.D. model It assumes r t follows an i.i.d. distribution. That is, both the conditional mean and conditional covariance are constant µ t = µ, Σ t = Σ. Very simple model, however, it is one of the most fundamental assumptions for many important works, e.g., the Nobel prize-winning Markowitz portfolio theory 4. 4 H. Markowitz, Portfolio selection, J. Financ., vol. 7, no. 1, pp. 77 91, 1952. D. Palomar Portfolio Optimization 19 / 58

Factor models Factor models are special cases of the i.i.d. model with the covariance matrix being decomposed into two parts: low dimensional factors and marginal noise. The factor model is r t = α + Bf t + w t, where α denotes a constant vector f t R K with K N is a vector of a few factors that are responsible for most of the randomness in the market, B R N K denotes how the low dimensional factors affect the higher dimensional market; w t is a white noise residual vector that has only a marginal effect. The factors can be explicit or implicit. Widely used by practitioners (they buy factors at a high premium). Connections with Principal Component Analysis (PCA) 5. 5 I. Jolliffe, Principal Component Analysis. Springer-Verlag, 2002. D. Palomar Portfolio Optimization 20 / 58

Fitting Process Before we can use a model, we need to estimate the model parameters (for example, in the i.i.d model: µ and Σ) using a training set. Then use cross-validation to select the best fit (assuming we have different possible models each with a different fit). Finally, we can use the best fitted model in the test data (aka out-of-sample data) for performance evaluation. In-Sample Data Out-Of- Sample Data Training Cross- Validation Testing D. Palomar Portfolio Optimization 21 / 58

Sample Estimates Consider the i.i.d. model: r t = µ + w t, where µ R N is the mean and w t R N is an i.i.d. process with zero mean and constant covariance matrix Σ. Sample estimators based on T observations are ˆµ = 1 T T t=1 ˆΣ = 1 T 1 r t T (r t ˆµ)(r t ˆµ) T. t=1 Note that the factor 1/ (T 1) is used instead of 1/T to get an unbiased estimator (asymptotically for T they coincide). D. Palomar Portfolio Optimization 22 / 58

Sample Estimates Consider the i.i.d. model: r t = µ + w t, where µ R N is the mean and w t R N is an i.i.d. process with zero mean and constant covariance matrix Σ. Sample estimators based on T observations are ˆµ = 1 T T t=1 ˆΣ = 1 T 1 r t T (r t ˆµ)(r t ˆµ) T. t=1 Note that the factor 1/ (T 1) is used instead of 1/T to get an unbiased estimator (asymptotically for T they coincide). D. Palomar Portfolio Optimization 22 / 58

Least-Square (LS) Estimator Minimizing the least-square error in the T observed i.i.d. samples, that is, 1 T minimize r t µ 2 µ 2 T. t=1 The optimal solution is the sample mean ˆµ = 1 T T t=1 r t. The sample covariance of the residuals ŵ t = r t ˆµ is the sample covariance matrix: ˆΣ = 1 T 1 T t=1 (r t ˆµ)(r t ˆµ) T. D. Palomar Portfolio Optimization 23 / 58

Least-Square (LS) Estimator Minimizing the least-square error in the T observed i.i.d. samples, that is, 1 T minimize r t µ 2 µ 2 T. t=1 The optimal solution is the sample mean ˆµ = 1 T T t=1 r t. The sample covariance of the residuals ŵ t = r t ˆµ is the sample covariance matrix: ˆΣ = 1 T 1 T t=1 (r t ˆµ)(r t ˆµ) T. D. Palomar Portfolio Optimization 23 / 58

Maximum Likelihood Estimator (MLE) Assume r t are i.i.d. and follow a Gaussian distribution: f (r) = 1 e (r µ)t Σ 1 (r µ) 2. (2π) N Σ where µ R N is a mean vector that gives the location Σ R N N is a positive definite covariance matrix that defines the shape. D. Palomar Portfolio Optimization 24 / 58

MLE Given the T i.i.d. samples r t, t = 1,..., T, the negative log-likelihood function is l(µ, Σ) = log T f (r t ) t=1 = T 2 log Σ + T t=1 (r t µ) T Σ 1 (r t µ) 2 + const. Setting the derivative of l(µ, Σ) w.r.t. µ and Σ 1 to zeros and solving the equations yield: ˆµ = 1 T ˆΣ = 1 T T t=1 r t T (r t ˆµ)(r t ˆµ) T. t=1 D. Palomar Portfolio Optimization 25 / 58

Outline 1 Primer on Financial Data 2 Modeling the Returns 3 Portfolio Optimization Preliminaries Markowitz Portfolio Global Minimum Variance Portfolio (GMVP) Maximum Sharpe Ratio Portfolio Markowitz Portfolio with Practical Constraints Linear Returns vs Log-Returns Revisited Drawbacks of Markowitz s formulation

Outline 1 Primer on Financial Data 2 Modeling the Returns 3 Portfolio Optimization Preliminaries Markowitz Portfolio Global Minimum Variance Portfolio (GMVP) Maximum Sharpe Ratio Portfolio Markowitz Portfolio with Practical Constraints Linear Returns vs Log-Returns Revisited Drawbacks of Markowitz s formulation

Portfolio return Suppose the budget is B dollars. The portfolio w R N denotes the normalized weights of the assets such that 1 T w = 1 (then Bw denotes dollars invested in the assets). For each asset, the initial wealth is Bw i and the end wealth is Bw i (p i,t /p i,t 1 ) = Bw i (R it + 1). Then the portfolio return is N Rt p i=1 = Bw i (R it + 1) B B = N w i R it i=1 N w i r it = w T r t i=1 The portfolio expected return and variance are w T µ and w T Σw, respectively. 6 6 G. Cornuejols and R. Tütüncü, Optimization Methods in Finance. Cambridge University Press, 2006. D. Palomar Portfolio Optimization 28 / 58

Performance Measures Expected return: w T µ Volatility: w T Σw Sharpe Ratio (SR): expected return per unit of risk SR = wt µ r f w T Σw where r f is the risk-free rate (e.g., interest rate on a three-month U.S. Treasury bill). Information Ratio (IR): IR = wt µ w T Σw Drawdown: decline from a historical peak of the cumulative profit X (t): D(T ) = max { 0, max t (0,T ) X (t) X (T ) } VaR (Value at Risk) ES (Expected Shortfall) or CVaR (Conditional Value at Risk) D. Palomar Portfolio Optimization 29 / 58

Practical constraints Capital budget constraint: w T 1 = 1. Long-only constraint: w 0. Market-neutral constraint: w T 1 = 0. Turnover constraint: w w 0 1 u where w 0 is the currently held portfolio. D. Palomar Portfolio Optimization 30 / 58

Practical constraints Holding constraints: l w u where l R N and u R N are lower and upper bounds of the asset positions, respectively. Cardinality constraint: w 0 K. Leverage constraint: w 1 2. D. Palomar Portfolio Optimization 31 / 58

Leverage and Margin Requirement The capital budget constraint w T 1 = 1 means investor can use all the cash from short-selling to buy stocks. In practice, one always trades stocks via a broker with some margin requirements on the positions 7. For example, long positions: one may borrow as much as 50% of the value of the position from the broker; short positions: the cash from short-selling is controlled by the broker as cash collateral and one is also required to have some equity as the initial margin to establish the positions, in general, at least 50% of the short value. Thus, the margin requirement turns to be 0.51 T w + + 0.51 T w 1, or equivalently, w 1 2. 7 B. I. Jacobs, K. N. Levy, and H. M. Markowitz, Portfolio optimization with factors, scenarios, and realistic short positions, Operations Research, vol. 53, no. 4, pp. 586 599, 2005. D. Palomar Portfolio Optimization 32 / 58

Leverage and Margin Requirement The capital budget constraint w T 1 = 1 means investor can use all the cash from short-selling to buy stocks. In practice, one always trades stocks via a broker with some margin requirements on the positions 7. For example, long positions: one may borrow as much as 50% of the value of the position from the broker; short positions: the cash from short-selling is controlled by the broker as cash collateral and one is also required to have some equity as the initial margin to establish the positions, in general, at least 50% of the short value. Thus, the margin requirement turns to be 0.51 T w + + 0.51 T w 1, or equivalently, w 1 2. 7 B. I. Jacobs, K. N. Levy, and H. M. Markowitz, Portfolio optimization with factors, scenarios, and realistic short positions, Operations Research, vol. 53, no. 4, pp. 586 599, 2005. D. Palomar Portfolio Optimization 32 / 58

Leverage and Margin Requirement The capital budget constraint w T 1 = 1 means investor can use all the cash from short-selling to buy stocks. In practice, one always trades stocks via a broker with some margin requirements on the positions 7. For example, long positions: one may borrow as much as 50% of the value of the position from the broker; short positions: the cash from short-selling is controlled by the broker as cash collateral and one is also required to have some equity as the initial margin to establish the positions, in general, at least 50% of the short value. Thus, the margin requirement turns to be 0.51 T w + + 0.51 T w 1, or equivalently, w 1 2. 7 B. I. Jacobs, K. N. Levy, and H. M. Markowitz, Portfolio optimization with factors, scenarios, and realistic short positions, Operations Research, vol. 53, no. 4, pp. 586 599, 2005. D. Palomar Portfolio Optimization 32 / 58

Leverage and Margin Requirement The capital budget constraint w T 1 = 1 means investor can use all the cash from short-selling to buy stocks. In practice, one always trades stocks via a broker with some margin requirements on the positions 7. For example, long positions: one may borrow as much as 50% of the value of the position from the broker; short positions: the cash from short-selling is controlled by the broker as cash collateral and one is also required to have some equity as the initial margin to establish the positions, in general, at least 50% of the short value. Thus, the margin requirement turns to be 0.51 T w + + 0.51 T w 1, or equivalently, w 1 2. 7 B. I. Jacobs, K. N. Levy, and H. M. Markowitz, Portfolio optimization with factors, scenarios, and realistic short positions, Operations Research, vol. 53, no. 4, pp. 586 599, 2005. D. Palomar Portfolio Optimization 32 / 58

Portfolio return with leverage Without leverage, the unnormalized portfolio w satisfies 1 T w = B, but with a leverage of L it is 1 T w = B L. At the time of the investment in the market: the portfolio held is w, the cash (which may be negative if there is leverage) is c = B 1 T w, and the net asset value (NAV) is NAV = c + 1 T w = B. After one period, the prices have changed, so the cash is the same c new = c, but the portfolio held now is w new = w p t /p t 1. So the NAV is NAV new = c new + 1 T w new = B 1 T w + w T (p t /p t 1 ) = B + w T r t. The portfolio return can be computed as R p t = NAV new NAV NAV = B + wt r t B B = wt r t B = wt r t where w denotes the normalized portfolio w = w/b. D. Palomar Portfolio Optimization 33 / 58

Outline 1 Primer on Financial Data 2 Modeling the Returns 3 Portfolio Optimization Preliminaries Markowitz Portfolio Global Minimum Variance Portfolio (GMVP) Maximum Sharpe Ratio Portfolio Markowitz Portfolio with Practical Constraints Linear Returns vs Log-Returns Revisited Drawbacks of Markowitz s formulation

Risk Control In finance, the expected return w T µ is very relevant as it quantifies the average benefit. However, in practice, the average performance is not enough to characterize an investment and one needs to control the probability of going bankrupt. Risk measures control how risky an investment strategy is. The most basic measure of risk is given by the variance 8 : a higher variance means that there are large peaks in the distribution which may cause a big loss. There are more sophisticated risk measures such as downside risk, VaR, ES, etc. 8 H. Markowitz, Portfolio selection, J. Financ., vol. 7, no. 1, pp. 77 91, 1952. D. Palomar Portfolio Optimization 35 / 58

Mean-Variance Tradeoff The mean return w T µ and the variance (risk) w T Σw constitute two important performance measures. Usually, the higher the mean return the higher the variance and vice-versa. Thus, we are faced with two objectives to be optimized: it is a multi-objective optimization problem. They define a fundamental mean-variance tradeoff curve (Pareto curve). The choice of a specific point in this tradeoff curve depends on how agressive or risk-averse the investor is. D. Palomar Portfolio Optimization 36 / 58

Markowitz mean-variance portfolio (1952) The idea of the Markowitz framework 9 is to find a trade-off between the expected return w T µ and the risk of the portfolio measured by the variance w T Σw: maximize w T µ λw T Σw w subject to w T 1 = 1 where w T 1 = 1 is the capital budget constraint and λ is a parameter that controls how risk-averse the investor is. This is a convex QP with only one linear constraint which admits a closed-form solution: w = 1 2λ Σ 1 (µ + ν 1), where ν is the optimal dual variable ν = 2λ 1T Σ 1 µ 1 T Σ 1 1. 9 H. Markowitz, Portfolio selection, J. Financ., vol. 7, no. 1, pp. 77 91, 1952. D. Palomar Portfolio Optimization 37 / 58

Markowitz mean-variance portfolio (1952) The idea of the Markowitz framework 9 is to find a trade-off between the expected return w T µ and the risk of the portfolio measured by the variance w T Σw: maximize w T µ λw T Σw w subject to w T 1 = 1 where w T 1 = 1 is the capital budget constraint and λ is a parameter that controls how risk-averse the investor is. This is a convex QP with only one linear constraint which admits a closed-form solution: w = 1 2λ Σ 1 (µ + ν 1), where ν is the optimal dual variable ν = 2λ 1T Σ 1 µ 1 T Σ 1 1. 9 H. Markowitz, Portfolio selection, J. Financ., vol. 7, no. 1, pp. 77 91, 1952. D. Palomar Portfolio Optimization 37 / 58

Markowitz mean-variance portfolio (1952) There are two alternative obvious reformulations for the Markowitz portfolio optimization. Maximization of mean return: Minimization of risk: maximize w subject to minimize w subject to w T µ w T Σw α 1 T w = 1. w T Σw w T µ β 1 T w = 1. The three formulations give different points on the Pareto optimal curve. They all require choosing one parameter (α, β, and λ). By sweeping over this parameter, one can recover the whole Pareto optimal curve. D. Palomar Portfolio Optimization 38 / 58

Efficient frontier Efficient frontier: the previous three problems result in the same mean-variance trade-off curve (Pareto curve). Expected return Efficient frontier Global minimum variance Feasible portfolios Standard deviation D. Palomar Portfolio Optimization 39 / 58

Outline 1 Primer on Financial Data 2 Modeling the Returns 3 Portfolio Optimization Preliminaries Markowitz Portfolio Global Minimum Variance Portfolio (GMVP) Maximum Sharpe Ratio Portfolio Markowitz Portfolio with Practical Constraints Linear Returns vs Log-Returns Revisited Drawbacks of Markowitz s formulation

Global Minimum Variance Portfolio (GMVP) Recall the risk minimization formulation: minimize w subject to w T Σw w T µ β 1 T w = 1. The global minimum variance portfolio (GMVP) ignores the expected return and focuses on the risk only: minimize w T Σw w subject to 1 T w = 1. It is a simple convex QP with solution 1 w GMVP = 1 T Σ 1 1 Σ 1 1. It is widely used in academic papers for simplicity of evaluation and comparison of different estimators of the covariance matrix Σ (while ignoring the estimation of µ). D. Palomar Portfolio Optimization 41 / 58

GMVP with Leverage Constraints The GMVP is typically considered with no-short constraints w 0: minimize w T Σw w subject to 1 T w = 1 w 0. If short-selling is allowed, one needs to limit the amount of leverage to avoid ridiculous solutions where some elements of w are too large with positive sign and others are too large with negative sign canceling out. A sensible GMVP formulation with leverage is minimize w T Σw w subject to 1 T w = 1 w 1 γ where γ 1 is a parameter that controls the amount of leverage: γ = 1 means no shorting (so equivalent to w 0) γ > 1 allows some shorting as well as leverage in the longs, e.g., γ = 1.5 would allow the portfolio w = (1.25, 0.25). D. Palomar Portfolio Optimization 42 / 58

Outline 1 Primer on Financial Data 2 Modeling the Returns 3 Portfolio Optimization Preliminaries Markowitz Portfolio Global Minimum Variance Portfolio (GMVP) Maximum Sharpe Ratio Portfolio Markowitz Portfolio with Practical Constraints Linear Returns vs Log-Returns Revisited Drawbacks of Markowitz s formulation

Sharpe ratio maximization problem Markowitz mean-variance framework provides portfolios along the Pareto-optimal frontier and the choice depends on the risk-aversion of the investor. But typically one measures an investment with the Sharpe ratio: only one portfolio on the Pareto-optimal frontier achieves the maximum Sharpe ratio. Precisely, Sharpe 10 first proposed the optimization of the following problem: w maximize T w µ r f w T Σw subject to 1 T w = 1 where r f is the return of a risk-free asset. However, this problem is not convex! 10 W. F. Sharpe, Mutual fund performance, The Journal of Business, vol. 39, no. 1, pp. 119 138, 1966. D. Palomar Portfolio Optimization 44 / 58

Sharpe ratio maximization problem Luckily, the problem is quasi-convex. This can be easily seen by rewritting the problem in epigraph form: minimize w,t subject to t w T Σw t w T µ r f 1 T w = 1. If now we fix the variable t to some value (so it is not a variable anymore), the problem is easily recognized as a (convex) SOCP: minimize t w subject to t ( w T ) µ r f Σ 1/2 w 2 1 T w = 1. At this point, one can easily solve the problem with an SOCP solver and then solving for t via bisection algorithm (aka sandwich technique). D. Palomar Portfolio Optimization 45 / 58

Bisection method (aka sandwich technique) The quasi-convex problem we want to solve is minimize t,x subject to t t f 0 (x) x X. Bisection method (given upper- and lower-bounds on t: t ub and t lb ): 1 compute mid-point: t = ( t ub + t lb) /2 2 solve the following feasibility problem: find subject to x t f 0 (x) x X 3 if feasible, then set t ub = t; otherwise set t lb = t 4 If t ub t lb > ɛ go to step 1; otherwise finish. D. Palomar Portfolio Optimization 46 / 58

Reformulation of Sharpe ratio portfolio in convex form Start with the original problem formulation: maximize w w T µ r f w T Σw subject to 1 T w = 1 (w 0) minimize w w T Σw w T (µ r f 1) subject to 1 T w = 1 (w 0) Now, since the objective is scale invariant w.r.t. w, we can choose the proper scaling factor for our convenience. We define w = tw with the scaling factor t = 1/ ( w T ) µ r f > 0, so that te objective becomes w T Σ w, the sum constraint 1 T w = t, and the problem is minimize w T Σ w w, w,t subject to t = 1/w T (µ r f 1) > 0 w = tw 1 T w = t > 0 ( w 0). D. Palomar Portfolio Optimization 47 / 58

Reformulation of Sharpe ratio portfolio in convex form Start with the original problem formulation: maximize w w T µ r f w T Σw subject to 1 T w = 1 (w 0) minimize w w T Σw w T (µ r f 1) subject to 1 T w = 1 (w 0) Now, since the objective is scale invariant w.r.t. w, we can choose the proper scaling factor for our convenience. We define w = tw with the scaling factor t = 1/ ( w T ) µ r f > 0, so that te objective becomes w T Σ w, the sum constraint 1 T w = t, and the problem is minimize w T Σ w w, w,t subject to t = 1/w T (µ r f 1) > 0 w = tw 1 T w = t > 0 ( w 0). D. Palomar Portfolio Optimization 47 / 58

Reformulation of Sharpe ratio portfolio in convex form The constraint t = 1/w T (µ r f 1) can be rewritten in terms of w as 1 = w T (µ r f 1) So the problem becomes minimize w T Σ w w, w,t subject to w T (µ r f 1) = 1 w = tw 1 T w = t > 0 ( w 0). Now, note that the strict inequality t > 0 is equivalent to t 0 because t = 0 can never happen as w would would be zero and the first constraint would not be satisfied. D. Palomar Portfolio Optimization 48 / 58

Reformulation of Sharpe ratio portfolio in convex form Finally, we can now get rid of w and t in the formulation as they can be directly obtained as t = 1 T w and w = w/t: QED! minimize w T Σ w w subject to w T (µ r f 1) = 1 1 T w 0 ( w 0). Recall that the portfolio is then obtained with the correct scaling factor as w = w/(1 T w). D. Palomar Portfolio Optimization 49 / 58

Efficient Frontier Capital market line Expected return Maximum Sharpe ratio Efficient frontier Global minimum variance r f Feasible portfolios Standard deviation D. Palomar Portfolio Optimization 50 / 58

Outline 1 Primer on Financial Data 2 Modeling the Returns 3 Portfolio Optimization Preliminaries Markowitz Portfolio Global Minimum Variance Portfolio (GMVP) Maximum Sharpe Ratio Portfolio Markowitz Portfolio with Practical Constraints Linear Returns vs Log-Returns Revisited Drawbacks of Markowitz s formulation

General Markowitz Portfolio A general Markowitz portfolio with practical constraints could be: maximize w T µ λw T Σw w subject to w T 1 = 1 budget w 1 γ leverage w w 0 1 τ turnover w u max position w 0 K sparsity where: γ 1 controls the amount of shorting and leveraging τ > 0 controls the turnover (to control the transaction costs in the rebalancing) u limits the position in each stock K controls the cardinality of the portfolio (to select a small set of stocks from the universe). Without the sparsity constraint, the problem can be rewritten as a QP. D. Palomar Portfolio Optimization 52 / 58

Outline 1 Primer on Financial Data 2 Modeling the Returns 3 Portfolio Optimization Preliminaries Markowitz Portfolio Global Minimum Variance Portfolio (GMVP) Maximum Sharpe Ratio Portfolio Markowitz Portfolio with Practical Constraints Linear Returns vs Log-Returns Revisited Drawbacks of Markowitz s formulation

Linear Returns vs Log-Returns Revisited Recall that we have modeled the log prices y t = log p t as a random walk and, hence, the log-returns r t = y t y t 1 as an i.i.d. process with mean µ and covariance matrix Σ. However, for portfolio return the appropriate returns to be used are the linear returns R i,t = p i,t /p i,t 1 1 (recall r i,t = log (1 + R i,t )): R p t = w T R t w T r t Thus, when we formulate the portfolio optimization problem, we should use the moments of the linear returns: E [R t F t 1 ] and Cov [R t F t 1 ] instead of the ones for the log-returns µ and Σ. Fortunately, they can be related as follows: R t = exp (r t ) 1 E [R t F t 1 ] = exp (µ + 12 ) diag (Σ) 1 ( Cov [R t F t 1 ] ij = exp µ i + µ j + 1 ) 2 (Σ ii + Σ jj ) (exp (Σ ij ) 1). D. Palomar Portfolio Optimization 54 / 58

Outline 1 Primer on Financial Data 2 Modeling the Returns 3 Portfolio Optimization Preliminaries Markowitz Portfolio Global Minimum Variance Portfolio (GMVP) Maximum Sharpe Ratio Portfolio Markowitz Portfolio with Practical Constraints Linear Returns vs Log-Returns Revisited Drawbacks of Markowitz s formulation

Drawbacks of Markowitz s formulation The Markowitz portfolio has never been embraced by practitioners, among other reasons because 1 variance is not a good risk measurement in practice since it penalizes both the unwanted high losses and the desired low losses: the solution is to use alternative measures for risk, e.g., VaR and CVaR 11 2 it is highly sensitive to parameter estimation errors (i.e., to the covariance matrix Σ and especially to the mean vector µ): solution is robust optimization 12 3 it only considers the risk of the portfolio as a whole and ignores the risk diversification: solution is the risk-parity portfolio. 11 A. McNeil, R. Frey, and P. Embrechts, Quantitative Risk Management: Concepts, Techniques and Tools. Princeton University Press, 2005. 12 F. J. Fabozzi, Robust Portfolio Optimization and Management. Wiley, 2007. D. Palomar Portfolio Optimization 56 / 58

Basic References Y. Feng and D. P. Palomar, A Signal Processing Perspective on Financial Engineering. Foundations and Trends R in Signal Processing, Now Publishers Inc., 2016 D. Ruppert, Statistics and Data Analysis for Financial Engineering. Springer, 2010 G. Cornuejols and R. Tütüncü, Optimization Methods in Finance. Cambridge University Press, 2006 F. J. Fabozzi, Robust Portfolio Optimization and Management. Wiley, 2007 D. Palomar Portfolio Optimization 57 / 58

Thanks For more information visit: https://www.danielppalomar.com