Course objective. Modélisation Financière et Applications UE 111. Application series #2 Diversification and Efficient Frontier

Similar documents
CASE STUDY. nineteen. Option Pricing. case study OVERVIEW. Application Overview and Model Development. Re-solve Options

Mean-Variance Portfolio Choice in Excel

In terms of covariance the Markowitz portfolio optimisation problem is:

Lecture 2: Fundamentals of meanvariance

Lecture 3: Factor models in modern portfolio choice

MARKOWITS EFFICIENT PORTFOLIO (HUANG LITZENBERGER APPROACH)

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

NATIONAL UNIVERSITY OF SINGAPORE Department of Finance

Techniques for Calculating the Efficient Frontier

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

MLC at Boise State Polynomials Activity 3 Week #5

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

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

Financial Analysis The Price of Risk. Skema Business School. Portfolio Management 1.

A general approach to calculating VaR without volatilities and correlations

Acritical aspect of any capital budgeting decision. Using Excel to Perform Monte Carlo Simulations TECHNOLOGY

Linear Programming: Sensitivity Analysis and Interpretation of Solution

Business Mathematics (BK/IBA) Quantitative Research Methods I (EBE) Computer tutorial 4

NATIONAL UNIVERSITY OF SINGAPORE Department of Finance FIN3130: Financial Modeling Semester 1, 2018/2019

SDMR Finance (2) Olivier Brandouy. University of Paris 1, Panthéon-Sorbonne, IAE (Sorbonne Graduate Business School)

ELEMENTS OF MATRIX MATHEMATICS

EE266 Homework 5 Solutions

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

2016 EXAMINATIONS ACCOUNTING TECHNICIAN PROGRAMME PAPER TC 3: BUSINESS MATHEMATICS & STATISTICS

Confidence Intervals for the Difference Between Two Means with Tolerance Probability

Advanced Financial Economics Homework 2 Due on April 14th before class

The Process of Modeling

The mean-variance portfolio choice framework and its generalizations

Symmetric Game. In animal behaviour a typical realization involves two parents balancing their individual investment in the common

Conover Test of Variances (Simulation)

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

Chapter 7: Portfolio Theory

DECISION SUPPORT Risk handout. Simulating Spreadsheet models

Jacob: The illustrative worksheet shows the values of the simulation parameters in the upper left section (Cells D5:F10). Is this for documentation?

Iteration. The Cake Eating Problem. Discount Factors

Quantitative Risk Management

Descriptive Statistics

Economics 424/Applied Mathematics 540. Final Exam Solutions

Chapter 6 Analyzing Accumulated Change: Integrals in Action

Mean Variance Analysis and CAPM

The Optimization Process: An example of portfolio optimization

Solutions to questions in Chapter 8 except those in PS4. The minimum-variance portfolio is found by applying the formula:

Random Variables and Applications OPRE 6301

Lesson Plan for Simulation with Spreadsheets (8/31/11 & 9/7/11)

The homework is due on Wednesday, September 7. Each questions is worth 0.8 points. No partial credits.

36106 Managerial Decision Modeling Sensitivity Analysis

Optimal Dam Management

LAB 2 INSTRUCTIONS PROBABILITY DISTRIBUTIONS IN EXCEL

Examples: Random Variables. Discrete and Continuous Random Variables. Probability Distributions

Capital Asset Pricing Model

Parameter Estimation Techniques, Optimization Frequency, and Equity Portfolio Return Enhancement*

1 Estimating Credit Scores with Logit LINKING SCORES, DEFAULT PROBABILITIES AND OBSERVED DEFAULT BEHAVIOR

Group-Sequential Tests for Two Proportions

Overview. Definitions. Definitions. Graphs. Chapter 4 Probability Distributions. probability distributions

Note on Using Excel to Compute Optimal Risky Portfolios. Candie Chang, Hong Kong University of Science and Technology

Obsolescence Risk and the Systematic Destruction of Wealth

Get Tangency Portfolio by SAS/IML

MBA 7020 Sample Final Exam

ORF 307: Lecture 19. Linear Programming: Chapter 13, Section 2 Pricing American Options. Robert Vanderbei. May 1, 2018

Chapter 2 Portfolio Management and the Capital Asset Pricing Model

Numerical Descriptions of Data

Data that can be any numerical value are called continuous. These are usually things that are measured, such as height, length, time, speed, etc.

Mark-recapture models for closed populations

Lecture 3: Review of Probability, MATLAB, Histograms

Random Variables and Probability Distributions

Name Date Student id #:

Copyright 2011 Pearson Education, Inc. Publishing as Addison-Wesley.

Exercise 14 Interest Rates in Binomial Grids

On the Effectiveness of a NSGA-II Local Search Approach Customized for Portfolio Optimization

(High Dividend) Maximum Upside Volatility Indices. Financial Index Engineering for Structured Products

OPTIMAL RISKY PORTFOLIOS- ASSET ALLOCATIONS. BKM Ch 7

36106 Managerial Decision Modeling Monte Carlo Simulation in Excel: Part IV

Decision Trees Using TreePlan

IEOR E4703: Monte-Carlo Simulation

Chapter 5 Portfolio. O. Afonso, P. B. Vasconcelos. Computational Economics: a concise introduction

Excel Proficiency Exercises

XLSTAT TIP SHEET FOR BUSINESS STATISTICS CENGAGE LEARNING

Financial Market Analysis (FMAx) Module 6

Modelling the Sharpe ratio for investment strategies

Outline for today. Stat155 Game Theory Lecture 13: General-Sum Games. General-sum games. General-sum games. Dominated pure strategies

Counting Basics. Venn diagrams

Chapter 4 Probability Distributions

Prentice Hall Connected Mathematics 2, 7th Grade Units 2009 Correlated to: Minnesota K-12 Academic Standards in Mathematics, 9/2008 (Grade 7)

Portfolio Construction Research by

WEB APPENDIX 8A 7.1 ( 8.9)

A Broader View of the Mean-Variance Optimization Framework

BF212 Mathematical Methods for Finance

PAULI MURTO, ANDREY ZHUKOV

Session 3: Computational Game Theory

DUALITY AND SENSITIVITY ANALYSIS

PORTFOLIO OPTIMIZATION AND EXPECTED SHORTFALL MINIMIZATION FROM HISTORICAL DATA

Journal of College Teaching & Learning February 2007 Volume 4, Number 2 ABSTRACT

Call Admission Control for Preemptive and Partially Blocking Service Integration Schemes in ATM Networks

APPENDIX TO LECTURE NOTES ON ASSET PRICING AND PORTFOLIO MANAGEMENT. Professor B. Espen Eckbo

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

MTH302- Business Mathematics

Statistical Methods in Practice STAT/MATH 3379

CHAPTER 6: PORTFOLIO SELECTION

ROM Simulation with Exact Means, Covariances, and Multivariate Skewness

Modern Portfolio Theory

Transcription:

Course objective Modélisation Financière et Applications UE 111 Application series #2 Diversification and Efficient Frontier Juan Raposo and Fabrice Riva Université Paris Dauphine The previous session dealt with individual stock returns This session deals with the properties of stock portfolios through three different applications 1 The effect of naïve diversification for the variance of portfolio returns 2 The computation of the feasible set of portfolios 3 The computation of minimum variance portolios and the construction of the efficient frontier 2015/16 Snapshot of the Returns worksheet Objective How does risk (measured as the variance of returns) evolve when the number of stocks in a portfolio increases? We will start with a universe of 38 stocks belonging to the CAC 40 index We will construct portfolios of increasing size, from 1 to 15 stocks For each portfolio of size i, we will build 20 different portfolios by randomly selecting (with replacement) i stocks among the initial sample of 38 stocks

Snapshot of the Diversification worksheet The problem will be solved using two different methods: 1 : We will first compute the return time series of the various built portfolios and compute their variance from the variance of their time series returns 2 : We will directly compute the variance of portfolio returns using matrix algebra Step 1: Random selection of stocks in portfolio x The return on portfolio x on date t is computed as: where: R x,t = n x i R i,t (1) i=1 R x,t is the portfolio (discrete) return on date t R i,t is asset i s (discrete) return on date t x i is the weight on asset i in portfolio x, where x i = Amount invested in asset i Amount invested in portfolio x Naïve diversification means that i, x i = 1/n (2) This involves selecting randomly n stocks among the 38 available stocks This amounts to drawing n integer numbers in the interval [1; 38] The drawing will be performed using the RandBetween(<min>, <max>) worksheetfunction, which generates a uniformly distributed integer random number in the interval [< min >; < max >] The n selected stocks (their number) will be stored in a 1-dimension array variable PF stocks containing n rows and whose declaration will thus be made using Redim PF stocks(n) Stock selection 1. Function Stock Selection(n) 2. ReDim PF stocks(n) 3. For i = 1 to n 4. PF stocks(i) = WorksheetFunction.RandBetween(1, 38) 5. Next i 6. Stock Selection = PF Stocks 7. End Function

Step 2: Time series of portfolio returns Step 3: Storing and displaying results We first need to determine (once only same number of returns for every stock) the number of sample returns Nb returns = Range(Cells(2, 1), Cells(2, 1).End(xlDown)).Cells.Count We will use the variable Current date as the counter variable in a For...Next loop to go through all sample dates For a given value of that variable, we will compute portfolio returns by adding the individual returns of the stocks pertaining to portfolio x. The sum of the individual returns will then be divided by n (naïve diversification) and stored in array variable PF x Retrieving the individual returns will be obtained using a second loop that goes through all elements of PF stocks For stock number Stock the value of its return for a given value of the Current date variable is obtained using Cells(Current date, PF stocks(stock)).offset(1, 1).Value Once the array variable PF x is filled, the variance of portfolio returns is obtained by applying the Var worksheetfunction to that variable Steps 1 and 2 will iterated 15 20 times At each iteration, the value of the variance will be stored in the (15, 20) Results array variable The content of this variable will then be reported in the Diversification worksheet starting from cell B2 Evolution of portfolio variance with size The variance σ 2 x of portfolio returns can be computed directly using matrix algebra where: σ 2 x = x Vx (3) x = (x 1, x 2,..., x n) is the column vector of portfolio weights V is the (n, n) variance-covariance matrix of returns, with σ 1,1 σ 1,2 σ 1,i σ 1,n σ 2,1 σ 2,2 σ 2,i σ 2,n V =.............. σ i,1 σ i,2 σ i,i σ i,n.............. σ n,1 σ n,2 σ n,i σ n,n (4)

Example: variance computation using matrix algebra with 2 stocks ( ) ( ) ( ) σx 2 σ1,1 σ = (x 1 x 2 ) 1,2 x1 x1 σ = (x σ 2,1 σ 2,2 x 1 x 2 ) 1,1 + x 2 σ 1,2 2 x 1 σ 2,1 + x 2 σ 2,2 = x 2 1 σ 1,1 + x 1 x 2 σ 1,2 + x 2 x 1 σ 2,1 + x 2 2 σ 2,2 = x 2 1 σ2 1 + x 2 2 σ2 2 + 2x 1x 2 σ 1,2 Matrix operations in Excel: Interactive/worksheet mode Product: =PRODUITMAT MMULT(<Mat1>;<Mat2>) Transpose: =TRANSPOSE(<Mat>) Inverse: =INVERSEMAT MINVERSE(<Mat>) Determinant: =DETERMAT MDETERM(<Mat>) Scalar product: =SOMMEPROD SUMPRODUCT(<Vec1>;<Vec2>) WARNING: Matrix operations must be validated by pressing simultaneously CTRL + SHIFT + ENTER Matrix operations in Excel: VBA functions Notes: Product: WorksheetFunction.MMult(<Mat1>;<Mat2>) Transpose: WorksheetFunction.Transpose(<Mat>) Inverse: WorksheetFunction.MInverse(<Mat>) Determinant: WorksheetFunction.MDeterm(<Mat>) Scalar product: WorksheetFunction.SumProd(<Vec1>;<Vec2>) Option Base 1 is the sole possible option for matrix operations to work It is safer to declare a row [column] vector as a (n, 1) [respectively (1, n)] matrix rather than a 1-dimension array (in which case it is a row vector) Step 1: Variance-Covariance matrix Since the sample contains 38 stocks, the VCV matrix is a (38, 38) matrix Dim VCV(38, 38) as Double The covariance between the returns on two stocks is computed thanks to the Covar worksheetfunction. Its syntax is the following WorksheetFunction.Covar(<Vector 1>, <Vector 2>) Cell(i, j) in the VCV matrix is computed by applying the Covar worksheetfunction and using as its first argument the range that contains stock i returns and as its second argument the range that contains stock j returns Reference to the range that contains stock i returns can be achieved as follows: Define object variable Range start of type Range which corresponds to the range that contains the sample dates Set Range start = Range(Cells(2, 1), Cells(2, 1).End(xlDown)) Then Range start.offset(0, i) will correspond to the range that contains stock i returns Note that the VCV matrix is symmetric and that we only need to compute the lower triangle and report the results in the upper triangle

Step 2: Building the portfolio weights Step 3: Portfolio variance computation Suppose we randomly selected stocks 12 and 28 to build a 2-stock portfolio. The vector of weights will contain the values 1 and 1 on rows 12 and 28 and 0 2 2 everywhere else Warning: Suppose we select twice a given stock in a 3-stock portfolio. Then this stock must be given a weight of 2 to ensure that the portfolio is feasible 3 We will use the following approach: We declare a 38 rows and 1 column array variable x Each of the 38 elements of x is initially set to 0 using a For...Next loop We randomly select n stocks (where n is the portfolio size) by drawing n random numbers in the interval [1; 38] using worksheetfunction RandBetween Assigning the number drawn to variable Position, the corresponding element in variable x is adjusted using the instruction x(position, 1) = x(position, 1) + 1 / n Once the VCV matrix and the vector of weights are available, the variance is computed as x Vx. Its VBA translation is WorksheetFunction.MMult(WorksheetFunction. Transpose(x), WorksheetFunction.MMult(VCV, x)) This VBA instruction works fine but it returns a (1, 1) matrix, not a scalar. Converting this matrix into a scalar number involves the unpleasant use of the Index worksheetfunction This can be avoided by using the SumProduct worksheetfunction as follows WorksheetFunction.SumProduct(x, WorksheetFunction.MMult(VCV, x)) The previous application allowed us to analyze the evolution of portfolio risk as we increase the number of stocks it contains Yet, how do expected or average returns evolve when risk increases? Are some portfolios better than others? Can we make the risk of a portfolio arbitrarily small? Our objective in this application will be to compute the set (more modestly a part of the set) of feasible portfolios A portfolio is said to be feasible if its weights sum to 1 (100%) Some stocks may be given negative weights, which corresponds to short sales The various portfolios we compute will be plotted in an expected (average) return / variance (or standard deviation) diagram

Average return 0.3% 0.2% 0.2% 0.1% 0.1% 0.0% -0.1% -0.1% -0.2% Individual (38) sample stocks plotted in terms of average return against standard deviation -0.2% 0.00% 0.50% 1.00% 1.50% 2.00% 2.50% 3.00% 3.50% 4.00% 4.50% 5.00% Standard deviation Step 1: Average return of a portfolio : Same as what we did in method #1 with portfolio variance, i.e. compute the time series of portfolio returns and then compute the time series average return using the Average worksheetfunction. However, we know that is not optimal in terms of computation time : Relies on matrix algebra. Denoting R x the expected (average) return of portfolio x: R x = x R (5) where R = ( R 1, R 2,..., R n) is the column vector of average individual stock returns We need to compute first the vector of average individual returns. These returns will be stored in (38, 1) array variable R of type Double The cells of this variable will be filled using the same approach as the one we used to compute covariances and applying the Average worksheetfunction Note that it is possible (and recommended) to compute the R vector within one of the loops that computes the VCV matrix Step 2: Generating a feasible portfolio Generating a feasible portfolio amounts to generate 38 random numbers and store them in array variable x These random numbers will be generated using the Rnd VBA functions that draws independent random numbers, uniformly distributed over the interval [0, 1) Since Rnd generates a uniformly distributed random number on [0, 1), Rnd * 2-1 will generate a uniformly distributed random number on [ 1, 1). Generating negative weights allows to account for short positions There is no reason why these 38 random number should add up to 1 (on average the sum will be equal du 0) The initial portfolio will be normalized, i.e. transformed into a feasible portfolio by dividing each of the initial weights by their initial sum Note that the initial weights will add up to 0 on average. Thus, although the initial weights lie in the [ 1, 1) interval, the normalized weights can lie potentially in the (, + ) interval Step 3: computation of portfolio average return and variance Computation of portfolio average return and variance using matrix algebra Average return: R x = x R Standard deviation: σ x = x Vx Computation of portfolio average return and variance in VBA Average return: WorksheetFunction.SumProduct(x, R) Standard deviation: Sqr(WorksheetFunction.SumProduct(x, WorksheetFunction.MMult(VCV, x)))

Step 4: Iteration and display of results Feasible set We will simulate 1,000 random feasible portfolios These portfolios will be simulated using a For... Next loop The standard deviation and average return of the various portfolios will be stored in a (1000, 2) array variable named Results The content of the Results variable will then be reported in a new worksheet named Feasible set A scatter plot will then be produced Based on previous graph analysis, some portfolios are dominated in the sense that we can find portfolios having the same average (expected) return but whose risk is lower The objective in the current application is to build portfolios which, for a given level of risk, maximize the average return This objective is achieved by solving the following constrained optimization program: max {x} Rx s.t. x Vx = σx 2 x 1 = 1 This programm can be solved in closed form using the Lagrangian technique (see UE 106) Here we will solve the program using numerical optimization thanks to Excel solver tool (6) The solver interface

Laying the ground for the solver The Efficient frontier worksheet We need first to prepare a worksheet ( Efficient frontier ) that contains all intermediate computations for the solver to be able to handle the problem The worksheet must contain the following elements 1 The initial vector of weights (starting values) 2 The vector of individual average returns and the VCV matrix 3 The formulas that compute the portfolio average return and variance as well as the sum of its weights The following piece of code aims at performing steps 1 and 2: PF average return and variance 1. Sub Prepare Worksheet 2. Matrices = Compute Matrices 3. Worksheets("Efficient frontier").activate 4. Range("I2").Resize(38, 1).Value = Matrices(2) 5. Range("J2").Resize(38, 38).Value = Matrices(1) 6. End Sub Example #1: Finding the coordinates of the Global Minimum Variance Portfolio (GMVP) Example #2: Finding the coordinates of the MVP whose return variance is equal to.01

Step 0: adding the Solver add-in in the References The Solver add-in must be installed in the VBA project references library Solver programming is made in 5 steps 1 SolverReset resets the solver, i.e. deletes all elements coming from a previous parameterization 2 SolverOk aims at specifying the target cell, the optimization type and variable cells SolverOK SolverOk SetCell:= <target cell>, MaxMinVal: = <optimization type>, [ValueOf:= <target value>, ] ByChange:= <variable cell(s)> The optimization type is coded in the following way : 1 is for maximization, 2 is for minimization and 3 is to equate the target cell with the value given at the ValueOf stage 3 SolverAdd allows to specify the constraint(s). In case of multiple constraints, one SolverAdd block must be created for each constraint SolverAdd SolverAdd CellRef:=<constraint left hand side>, Relation: = <constraint type>, FormulaText:="=<constraint right hand side>" Or FormulaText:="=" & <variable> 4 SolverOption allows to check (True) /uncheck (False) the option on whether control variables can take on negative values or not SolverOptions AssumeNonNeg:=True False 5 SolverSolve serves to indicate whether the solver musk ask the user to validate (False) or not (True) in which case the user accepts by default the solution found by the solver SolverSolver userfinish:=true False The constraint type is coded in the following way: 1 is, 2 is =, 3 is

Finding the coordinates of the GMVP Finding the coordinates of the MVP with.01 variance VBA code for GMVP 1. Worksheets("Efficient frontier").activate 2. SolverReset 3. SolverOk SetCell:=Range("F1"), 4. MaxMinVal:=2, 5. ByChange:=Range("x vec") 6. SolverAdd CellRef:=Range("F3"), 7. Relation:=2, 8. FormulaText:="=1" 9. SolverOptions AssumeNonNeg:=False 10. SolverSolve userfinish:=true VBA code for MVP with.01 variance 1. Worksheets("Efficient frontier").activate 2. SolverReset 3. SolverOk SetCell:=Range("F2"), 4. MaxMinVal:=1, 5. ByChange:=Range("x vec") 6. SolverAdd CellRef:=Range("F3"), 7. Relation:=2, 8. FormulaText:="=1" 9. SolverAdd CellRef:=Range("F1"), 10. Relation:=2, 11. FormulaText:="=.01" 12. SolverOptions AssumeNonNeg:=False 13. SolverSolve userfinish:=true Efficient frontier Our starting point will be the coordinates of the GMVP The coordinates of the GMVP cells F1 and F2 will be copied in cells A2 and B2, repsectively We will also store in a variable the variance of the GMVP We will build 100 MVP of increasing variance. For MVP i, the target variance will be set to GMVP variance + i.005 Each time, the solver will be called to find the coordinates of the new MVP The coordinates of MVP #1 will be copied in cells A3 and B3, those of MVP #2 in cells A4 and B4, etc. We will then draw a scatter plot from the cells contained in range A2:B101