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

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

RiskTorrent: Using Portfolio Optimisation for Media Streaming

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

Contents Critique 26. portfolio optimization 32

Minimum Downside Volatility Indices

An adaptive cubic regularization algorithm for nonconvex optimization with convex constraints and its function-evaluation complexity

Asian Option Pricing: Monte Carlo Control Variate. A discrete arithmetic Asian call option has the payoff. S T i N N + 1

Chapter 7: Portfolio Theory

SciBeta CoreShares South-Africa Multi-Beta Multi-Strategy Six-Factor EW

International Finance. Estimation Error. Campbell R. Harvey Duke University, NBER and Investment Strategy Advisor, Man Group, plc.

What can we do with numerical optimization?

Maximization of utility and portfolio selection models

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

Mean Variance Analysis and CAPM

Trust Region Methods for Unconstrained Optimisation

EC316a: Advanced Scientific Computation, Fall Discrete time, continuous state dynamic models: solution methods

The Optimization Process: An example of portfolio optimization

Lecture 2: Fundamentals of meanvariance

Market Risk Analysis Volume I

arxiv: v1 [q-fin.pm] 12 Jul 2012

Part 3: Trust-region methods for unconstrained optimization. Nick Gould (RAL)

Bounds on some contingent claims with non-convex payoff based on multiple assets

Session 8: The Markowitz problem p. 1

Portfolio Optimization. Prof. Daniel P. Palomar

Outline. 1 Introduction. 2 Algorithms. 3 Examples. Algorithm 1 General coordinate minimization framework. 1: Choose x 0 R n and set k 0.

Efficient Portfolio and Introduction to Capital Market Line Benninga Chapter 9

Parameter estimation in SDE:s

Introduction to Risk Parity and Budgeting

Applications of Linear Programming

In terms of covariance the Markowitz portfolio optimisation problem is:

The Markowitz framework

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

FINC3017: Investment and Portfolio Management

Modern Portfolio Theory -Markowitz Model

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

Notes. Cases on Static Optimization. Chapter 6 Algorithms Comparison: The Swing Case

Ant colony optimization approach to portfolio optimization

PORTFOLIO OPTIMIZATION: ANALYTICAL TECHNIQUES

A Hybrid Solver for Constrained Portfolio Selection Problems preliminary report

Final Projects Introduction to Numerical Analysis Professor: Paul J. Atzberger

Lecture 3: Factor models in modern portfolio choice

The Fundamental Law of Mismanagement

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

1 Introduction. Term Paper: The Hall and Taylor Model in Duali 1. Yumin Li 5/8/2012

Robust portfolio optimization using second-order cone programming

Financial Mathematics III Theory summary

Optimization Financial Time Series by Robust Regression and Hybrid Optimization Methods

Market Risk Analysis Volume II. Practical Financial Econometrics

Application of MCMC Algorithm in Interest Rate Modeling

1 Overview. 2 The Gradient Descent Algorithm. AM 221: Advanced Optimization Spring 2016

The Yield Envelope: Price Ranges for Fixed Income Products

Near Real-Time Risk Simulation of Complex Portfolios on Heterogeneous Computing Systems with OpenCL

Matlab Workshop MFE 2006 Lecture 4

Chapter 8: CAPM. 1. Single Index Model. 2. Adding a Riskless Asset. 3. The Capital Market Line 4. CAPM. 5. The One-Fund Theorem

Exercise List: Proving convergence of the (Stochastic) Gradient Descent Method for the Least Squares Problem.

Quantitative Risk Management

A Simple Utility Approach to Private Equity Sales

A Heuristic Crossover for Portfolio Selection

Fast Convergence of Regress-later Series Estimators

Calibration and Simulation of Interest Rate Models in MATLAB Kevin Shea, CFA Principal Software Engineer MathWorks

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

Portfolio Management and Optimal Execution via Convex Optimization

Putting the Econ into Econometrics

Marginal Analysis. Marginal Analysis: Outline

A Broader View of the Mean-Variance Optimization Framework

6.231 DYNAMIC PROGRAMMING LECTURE 10 LECTURE OUTLINE

THE OPTIMAL ASSET ALLOCATION PROBLEMFOR AN INVESTOR THROUGH UTILITY MAXIMIZATION

Penalty Functions. The Premise Quadratic Loss Problems and Solutions

Multi-armed bandits in dynamic pricing

Mixed strategies in PQ-duopolies

Support Vector Machines: Training with Stochastic Gradient Descent

Executive Summary: A CVaR Scenario-based Framework For Minimizing Downside Risk In Multi-Asset Class Portfolios

INTRODUCTION TO MODERN PORTFOLIO OPTIMIZATION

Statistical Models and Methods for Financial Markets

A Monte Carlo Based Analysis of Optimal Design Criteria

Budget Management In GSP (2018)

Stochastic Approximation Algorithms and Applications

(IIEC 2018) TEHRAN, IRAN. Robust portfolio optimization based on minimax regret approach in Tehran stock exchange market

Simulation and Meta-heuristic Methods. G. Cornelis van Kooten REPA Group University of Victoria

Robust Portfolio Optimization SOCP Formulations

M.S. in Quantitative Finance & Risk Analytics (QFRA) Fall 2017 & Spring 2018

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

Applications of Quantum Annealing in Computational Finance. Dr. Phil Goddard Head of Research, 1QBit D-Wave User Conference, Santa Fe, Sept.

Optimization Methods in Finance

Optimization in Finance

Optimal Search for Parameters in Monte Carlo Simulation for Derivative Pricing

A Study on the Risk Regulation of Financial Investment Market Based on Quantitative

Testing Out-of-Sample Portfolio Performance

Portfolio Optimization with Alternative Risk Measures

Marginal Analysis Outline

Performance Measurement with Nonnormal. the Generalized Sharpe Ratio and Other "Good-Deal" Measures

Credit Risk Modeling Using Excel and VBA with DVD O. Gunter Loffler Peter N. Posch. WILEY A John Wiley and Sons, Ltd., Publication

Calibration Lecture 1: Background and Parametric Models

Overnight Index Rate: Model, calibration and simulation

Attilio Meucci. Managing Diversification

Modern Portfolio Theory

by Kian Guan Lim Professor of Finance Head, Quantitative Finance Unit Singapore Management University

FMO6 Web: Polls:

Chapter 8. Portfolio Selection. Learning Objectives. INVESTMENTS: Analysis and Management Second Canadian Edition

Asset Selection Model Based on the VaR Adjusted High-Frequency Sharp Index

Transcription:

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

Overview 1 Introduction 2 Economic model 3 Numerical solution 4 Computational implementation 5 Numerical results and simulation 6 Highlights 7 Main references O. Afonso, P. B. Vasconcelos Computational Economics 2 / 22

Introduction The portfolio optimisation model, originally proposed by Markowitz (1952), selects proportions of assets to be included in a portfolio. To have an efficient portfolio: the expected return should be maximised contingent on any given number of risks; or the risk should be minimised for a given expected return. Thus, investors are confronted with a trade-off between expected return and risk. The expected return-risk relationship of efficient portfolios is represented by an efficient frontier curve. Optimisation knowledge is required to solve this problem. Focus is on a Monte Carlo optimisation and on advanced numerical solutions provided by MATLAB/Octave. O. Afonso, P. B. Vasconcelos Computational Economics 3 / 22

Economic model The aim is to maximise the expected return constrained to a given risk max c T x, s.t. x T Hx = σ 2, x n x i = 1 and x i 0, (1) where n is the number of assets, x, n 1, is the vector of the shares invested in each asset i, c, n 1, is the vector of the average benefit per asset, H, n n, is the covariance matrix, and σ 2 is the expected risk goal. Problem (1) is know as a quadratic programming problem. Alternatively, minimise the risk subject to an expected return, c, min x x T Hx, s.t. c T x = c, i=1 n x i = 1 and x i 0. (2) i=1 O. Afonso, P. B. Vasconcelos Computational Economics 4 / 22

Economic model The global minimum variance portfolio is the one satisfying min x T Hx, s.t. x n x i = 1 and x i 0. (3) i=1 The efficient frontier is the set of pairs (risk, return) for which the returns are greater than the return provided by the minimum variance portfolio. The aim is to find the values of variables that optimise an objective, conditional or not to constraints. Numerical methods overcome limitations of size, but there is no universal algorithm to solve optimisation problems. The topic is addressed only in a cursory manner exploiting the MATLAB/Octave optimisation potentialities. O. Afonso, P. B. Vasconcelos Computational Economics 5 / 22

Numerical solution Consider the minimisation problem min f (x) (4) x R n s.t. c i (x) = 0, i E c i (x) 0, i I where f : R n R, c E : R n R n E and ci : R n R n I, respectively, the equality and inequality constraints. A feasible region is the set points satisfying the constraints S = {x : c i (x) = 0, i I and c i (x) 0, i D}. Problems without restrictions I = D = emerge in many applications and as a recast of constraint problems where restrictions are replaced by penality terms added to the objective function. O. Afonso, P. B. Vasconcelos Computational Economics 6 / 22

Numerical solution Optimisation problems can be classified in various ways, according to, for example: (i) functions involved; (ii) type of variables used; (iii) type of restrictions considered; (iv) type of solution to be obtained; and (v) differentiability of the functions involved. Among the countless optimisation problems, linear, quadratic and nonlinear programming are the most usual. Many algorithms for nonlinear programming problems only seek local solutions; in particular, for convex linear programming, local solutions are global. O. Afonso, P. B. Vasconcelos Computational Economics 7 / 22

Numerical solution Unconstrained optimisation in practice Unconstrained optimisation problems Methods such as steepest descent, Newton and quasi-newton are the most used. MATLAB/Octave: fminunc(f,x0) attempts to find a local minimum of function f, starting at point x0; similarly with fminsearch(f,x0) but using a derivative-free method; x0 can be a scalar, vector, or matrix. O. Afonso, P. B. Vasconcelos Computational Economics 8 / 22

Numerical solution Constrained optimisation in practice: linear programming Linear programming problem: both the objective and constraints are linear min x s.t. c T x Ax b, A eq x = b eq, lb x ub where c and x are vectors. MATLAB/Octave: linprog(c,a,b,aeq,beq,lb,ub). O. Afonso, P. B. Vasconcelos Computational Economics 9 / 22

Numerical solution Constrained optimisation in practice: quadratic programming Quadratic programming problem (portfolio problem): this involves a quadratic objective function and linear constraints 1 min x 2 x T Hx + x T c s.t. Ax b, A eq x = b eq, lb x ub where c, x and a i are vetors, and H is a symmetric (Hessian) matrix. MATLAB: quadprog(h,c,a,b,aeq,beq,lb,ub) Octave: qp([],h,c,aeq,beq,lb,ub) O. Afonso, P. B. Vasconcelos Computational Economics 10 / 22

Numerical solution Constrained optimisation in practice: nonlinear programming Nonlinear programming: f and/or constraints are nonlinear min x f (x) s.t. c(x) 0, c eq (x) = 0, Ax b, A eq x = b eq, lb x ub. MATLAB: fmincon(f,x0,a,b,aeq,beq,lb,ub,nonlcon) Octave: minimize(f,args) (where args is a list or arguments to f) O. Afonso, P. B. Vasconcelos Computational Economics 11 / 22

Monte Carlo approach Numerical solution Monte Carlo: experiments anchored on repeated random sampling to obtain numerical approximations of the solution. A Monte Carlo procedure can be schematised as follows. 1 Set a possible solution, and consider it to be the best for the moment 2 For a certain number of times, do: 1 generate (randomly) a set of feasable solutions from the best one available; 2 select (possibilly) a better one; 3 repeat the process. O. Afonso, P. B. Vasconcelos Computational Economics 12 / 22

Computational implementation Consider the following data, respectively, for the returns vector and covariance matrix 0.100 0.005 0.010 0.004 c = 0.200 and H = 0.010 0.040 0.002. 0.150 0.004 0.002 0.023 O. Afonso, P. B. Vasconcelos Computational Economics 13 / 22

Computational implementation Monte Carlo approach: portfolio with minimum variance function [ x, x _ h i s t ] = p o r t f o l i o _ m c a r l o _ f u n (H, nruns, const ) % Monte Carlo s o l u t i o n approach % Implemented by : P. B. Vasconcelos and O. Afonso % based on : Computational Economics, % D. A. Kendrick, P. R. Mercado and H. M. Amman % Princeton U n i v e r s i t y Press, 2006 % i n p u t : % H, covariance ma tr ix % nruns, number of Monte Carlo runs % const, constant to increase / reduce the magnitude of the random % numbers generated % output : % x, best found p o r t f o l i o % x_hist, search h i s t o r y f o r best p o r t f o l i o O. Afonso, P. B. Vasconcelos Computational Economics 14 / 22

Computational implementation % i n i t i a l i z a t i o n parameters and weights ; popsize = 10; n = size (H, 1 ) ; pwm = ( 1 / n ) ones ( n, popsize ) ; c r i t = zeros ( 1, popsize ) ; x _ h i s t = zeros ( n, 1 ) ; % compute nruns x popsize p o r t f o l i o s for k = 1: nruns for j = 1: popsize ; c r i t ( j ) = pwm( :, j ) H pwm( :, j ) ; end % s e l e c t i o n of the best p o r t f o l i o [ ~, top_index ] = min ( c r i t ) ; x = pwm( :, top_index ) ; % s t o r e the best p o r t f o l i o x _ h i s t ( :, k ) = x ; O. Afonso, P. B. Vasconcelos Computational Economics 15 / 22

Computational implementation i f k == nruns, break, end pwm( :, 1 ) = x ; for i = 2: popsize ; x = x+randn ( n, 1 ) const ; pwm( :, i ) = abs ( x /sum( abs ( x ) ) ) ; end end To solve the problem just do: nruns = 40; const = 0.1; [x,x_hist] = portfolio_mcarlo_fun(h,nruns,const); disp( best portfolio: ); for i=1:length(x) fprintf( Asset %d \t %5.4f \n,i,x(i)); end fprintf( expected return: %g \n,c *x); fprintf( risk : %g \n,sqrt(x *H*x)); O. Afonso, P. B. Vasconcelos Computational Economics 16 / 22

Numerical results and simulation --------------------------------------------------------- Portfolio optimization: global minimum variance Monte Carlo solution approach --------------------------------------------------------- best portfolio: Asset 1 0.7649 Asset 2 0.2355 Asset 3 0.0004 expected return: 0.123644 risk : 0.0392812 O. Afonso, P. B. Vasconcelos Computational Economics 17 / 22

Numerical results and simulation 0.8 0.7 0.6 Asset 1 Asset 2 Asset 3 share of each asset 0.5 0.4 0.3 0.2 0.1 0 0 5 10 15 20 25 30 35 40 number of Monte Carlo runs Monte Carlo convergence path for the portfolio with minimum variance O. Afonso, P. B. Vasconcelos Computational Economics 18 / 22

Numerical results and simulation Quadratic programming approach: portfolio with minimum variance Aeq = ones(1,length(c)); beq = 1; lb = zeros(1,length(c)); x = quadprog(2*h,[],[],[],aeq,beq,lb); disp( best portfolio: ); for i=1:length(x) fprintf( Asset %d \t %5.4f \n,i,x(i)); end fprintf( expected return: %g \n,c *x); fprintf( risk : %g \n,sqrt(x *H*x)); O. Afonso, P. B. Vasconcelos Computational Economics 19 / 22

Numerical results and simulation --------------------------------------------------------- Portfolio optimization: global minimum variance quadratic programming approach --------------------------------------------------------- best portfolio: Asset 1 0.7692 Asset 2 0.2308 Asset 3 0.0000 expected return: 0.123077 risk : 0.0392232 O. Afonso, P. B. Vasconcelos Computational Economics 20 / 22

Highlights The portfolio optimisation model selects the optimal proportions of various assets to be included in a portfolio, according to certain criteria. A rational investor aims at choosing a set of assets (diversification) delivering collectively the lowest risk for a target expected return. A portfolio is considered efficient if it is not possible to obtain a higher return without increasing the risk. The expected return-risk relationship of efficient portfolios is represented by an efficient frontier curve. The model is a quadratic programming problem. It is solved by using a simple Monte Carlo approach that only requires the notion of a minimum conditioned to a set of restrictions, and by a more sophisticated method deployed by MATLAB/Octave. O. Afonso, P. B. Vasconcelos Computational Economics 21 / 22

Main references References R. A. Haugen and N. L. Baker The efficient market inefficiency of capitalization-weighted stock portfolios The Journal of Portfolio Management, 17(3): 35 40, 1991 H. Markowitz Portfolio selection The Journal of Finance, 7(1): 77 91, 1952 R. C. Merton An analytic derivation of the efficient portfolio frontier The Journal of Financial and Quantitative Analysis, 7(4): 1851 1872, 1972 J. Nocedal and S. J. Wright Numerical Optimization Springer (2006) D. Pachamanova and F. J. Fabozzi Simulation and optimization in finance: modeling with MATLAB, @RISK, or VBA vol. 173, John Wiley & Sons (2010) O. Afonso, P. B. Vasconcelos Computational Economics 22 / 22