## MAFS6010R - Portfolio Optimization with R

MSc in Financial Mathematics - MAFM

Hong Kong University of Science and Technology (HKUST), Fall 2018-19

Prof. Daniel P. Palomar

Prof. Daniel P. Palomar

## Description

Modern portfolio theory started with Harry Markowitz’s 1952 seminal paper “Portfolio Selection,” for which he would later receive the Nobel prize in 1990. He put forth the idea that risk-adverse investors should optimize their portfolio based on a combination of two objectives: expected return and risk. Until today, that idea has remained central in portfolio optimization. However, the vanilla Markowitz portfolio formulation does not seem to behave as expected in practice and most practitioners tend to avoid it.

During the past half century, researchers and practitioners have reconsidered the Markowitz portfolio formulation and have proposed countless of improvements and variations, namely, robust optimization methods, alternative measures of risk (e.g., CVaR or ES), regularization via sparsity, improved estimators of the covariance matrix via random matrix theory, robust estimators for heavy tails, factor models, mean models, volatility clustering models, risk-parity formulations, etc.

This course will explore the Markowitz portfolio optimization in its many variations and extensions, with special emphasis on R programming. Each week will be devoted to a specific topic, during which the theory will be first presented, followed by an exposition of a practical implementation based on R programing.

During the past half century, researchers and practitioners have reconsidered the Markowitz portfolio formulation and have proposed countless of improvements and variations, namely, robust optimization methods, alternative measures of risk (e.g., CVaR or ES), regularization via sparsity, improved estimators of the covariance matrix via random matrix theory, robust estimators for heavy tails, factor models, mean models, volatility clustering models, risk-parity formulations, etc.

This course will explore the Markowitz portfolio optimization in its many variations and extensions, with special emphasis on R programming. Each week will be devoted to a specific topic, during which the theory will be first presented, followed by an exposition of a practical implementation based on R programing.

## Textbooks

- Yiyong Feng and Daniel P. Palomar,
*A Signal Processing Perspective on Financial Engineering*, Foundations and Trends® in Signal Processing, Now Publishers, 2016. [pdf] - S. Boyd and L. Vandenberghe, Convex Optimization, Cambridge University Press, 2004.
- G. Cornuejols and R. Tutuncu,
*Optimization Methods in Finance*. Cambridge Univ. Press, 2007. - F. J. Fabozzi, P. N. Kolm, D. A. Pachamanova, and S. M. Focardi,
*Robust Portfolio Optimization and Management*. Wiley, 2007.

## Lectures

Course syllabus.

Theory: Introduction to convex optimization

Practice: R for finance primer

Homework assignment #0 (due 7pm Tue 11-Sep-2018)

Theory: Convex optimization problems

Practice: Solvers in R

Theory: Portfolio optimization

Practice: Portfolio optimization with R

Portfolio game - Instructions:

1) install the package

2) prepare your portfolio design in a function as described in the README (or with more detail in the vignette), and

3) prepare your R script for submission like this example.

Portfolio game - Round 1:

Deadline: 11pm Friday 28-Sep-2018

Parameters: shortselling = FALSE, leverage = 1, T_rolling_window = 252, optimize_every = 20, rebalance_every = 5

Ranking: weighted average of the rank percentiles of the following score quantities: Sharpe ratio (10%), max drawdown (10%), cpu_time (5%), and failure rate (75%).

Theory: Factor models for asset returns

Practice: Factor models with R

Portfolio game - Round 2:

Deadline: 11pm Sunday 7-Oct-2018

Parameters: shortselling = TRUE, leverage = 1, T_rolling_window = 252, optimize_every = 20, rebalance_every = 5

Ranking: weighted average of the rank percentiles of the following score quantities: Sharpe ratio (15%), max drawdown (8%), cpu_time (2%), and failure rate (75%).

Theory: Prior information: Shrinkage and Black-Litterman

Practice: Prior information: Shrinkage and Black-Litterman with R

Homework assignment #1 (due 7pm Tue 16-Oct-2018)

Theory: Regularized robust estimators under heavy tails and outliers

Practice: Heavy-tailed estimators with R

Portfolio game - Round 3

Theory: Time series modeling of financial data

Practice: Time series modeling of financial data with R

Portfolio game - Round 4

Theory: Robust portfolio optimization

Practice: Robust portfolio optimization with R

Portfolio game - Round 5

Theory: Portfolio design with alternative risk measures

Practice: Portfolio design with alternative risk measures with R

Portfolio game - Round 6

Theory: Risk-parity portfolio

Practice: Risk-parity portfolios with R

Portfolio game - Round 7

Homework assignment #2 (due 11pm Thu 29-Nov-2018)

Theory: Sparse index tracking via majorization-minimization (MM)

Practice: Sparse index tracking with R

Theory: Pairs Trading

Practice: Pairs Trading with R

Project presentations by students

**Week 1**(4-Sep-2018):Theory: Introduction to convex optimization

Practice: R for finance primer

Homework assignment #0 (due 7pm Tue 11-Sep-2018)

**Week 2**(11-Sep-2018):Theory: Convex optimization problems

Practice: Solvers in R

**Week 3**(18-Sep-2018):Theory: Portfolio optimization

Practice: Portfolio optimization with R

Portfolio game - Instructions:

1) install the package

**portfolioBacktest**from GitHub,2) prepare your portfolio design in a function as described in the README (or with more detail in the vignette), and

3) prepare your R script for submission like this example.

Portfolio game - Round 1:

Deadline: 11pm Friday 28-Sep-2018

Parameters: shortselling = FALSE, leverage = 1, T_rolling_window = 252, optimize_every = 20, rebalance_every = 5

Ranking: weighted average of the rank percentiles of the following score quantities: Sharpe ratio (10%), max drawdown (10%), cpu_time (5%), and failure rate (75%).

**Week 4**(2-Oct-2018):Theory: Factor models for asset returns

Practice: Factor models with R

Portfolio game - Round 2:

Deadline: 11pm Sunday 7-Oct-2018

Parameters: shortselling = TRUE, leverage = 1, T_rolling_window = 252, optimize_every = 20, rebalance_every = 5

Ranking: weighted average of the rank percentiles of the following score quantities: Sharpe ratio (15%), max drawdown (8%), cpu_time (2%), and failure rate (75%).

**Week 5**(9-Oct-2018):Theory: Prior information: Shrinkage and Black-Litterman

Practice: Prior information: Shrinkage and Black-Litterman with R

Homework assignment #1 (due 7pm Tue 16-Oct-2018)

**Week 6**(16-Oct-2018):Theory: Regularized robust estimators under heavy tails and outliers

Practice: Heavy-tailed estimators with R

Portfolio game - Round 3

**Week 7**(23-Oct-2018):Theory: Time series modeling of financial data

Practice: Time series modeling of financial data with R

Portfolio game - Round 4

**Week 8**(6-Nov-2018):Theory: Robust portfolio optimization

Practice: Robust portfolio optimization with R

Portfolio game - Round 5

**Week 9**(13-Nov-2018):Theory: Portfolio design with alternative risk measures

Practice: Portfolio design with alternative risk measures with R

Portfolio game - Round 6

**Week 10**(20-Nov-2018):Theory: Risk-parity portfolio

Practice: Risk-parity portfolios with R

Portfolio game - Round 7

Homework assignment #2 (due 11pm Thu 29-Nov-2018)

**Week 11**(27-Nov-2018):Theory: Sparse index tracking via majorization-minimization (MM)

Practice: Sparse index tracking with R

**Week 12**(make up class on Sat 1-Dec-2018, 2-5pm, same classroom):Theory: Pairs Trading

Practice: Pairs Trading with R

**Week 13**(4-Dec-2018):Project presentations by students