Risk Management





Kevin Crotty

Risk Management

  • Strategies so far have been focused on expected returns

  • We should also think about managing portfolio risk.

  • We have been equally-weighting portfolios.

  • Could we reduce portfolio volatility using different weighting schemes?

Optimal Portfolios

  1. Tangency portfolio
  • maximize Sharpe ratio
  • requires expected returns, std deviations, & correlations
  1. Global minimum variance portfolio
  • minimize variance
  • requires std deviations & correlations

Today, we’ll focus on GMV.

GMV

The Global Minimum Variance Problem

  • The GMV portfolio is the portfolio of risky assets with the smallest variance.

Mathematically, choose portfolio weights to solve the following constrained optimization problem:

\[ \underset{w_1,w_2,\dots,w_N}{\text{min}} \text{var}[r_{p}] \]

subject to constraints: \(\sum_i w_i=1\)

Optimization in Python

The function cvxopt.solvers.qp solves problems of the general form: \[\begin{align} \underset{w}{\text{min }}& \frac{1}{2} w' Q w + p'w \\ \text{subject to } & Gw \le h \\ & Aw = b \\ \end{align}\]

  • We can write portfolio variance as \(w' V w\) for weights \(w\) and covariance matrix \(V\).

GMV in Python

def gmv(means, cov):
    n = len(means)
    Q = matrix(cov, tc="d")
    p = matrix(np.zeros(n), (n, 1), tc="d")
    # Constraint: short-sales allowed
    G = matrix(np.zeros((n,n)), tc="d")
    h = matrix(np.zeros(n), (n, 1), tc="d")
    # Constraint: fully-invested portfolio
    A = matrix(np.ones(n), (1, n), tc="d")
    b = matrix([1], (1, 1), tc="d")
    sol = Solver(Q, p, G, h, A, b)
    wgts = np.array(sol["x"]).flatten() if sol["status"] == "optimal" else np.array(n * [np.nan])
    return wgts

Short-sales constraints: GMV

def gmv_ssc(means, cov):
    n = len(mns)
    Q = matrix(cov, tc="d")
    p = matrix(np.zeros(n), (n, 1), tc="d")
    # Constraint: short-sales not allowed
    G = matrix(-np.identity(n), tc="d")
    h = matrix(np.zeros(n), (n, 1), tc="d")
    # Constraint: fully-invested portfolio
    A = matrix(np.ones(n), (1, n), tc="d")
    b = matrix([1], (1, 1), tc="d")
    sol = Solver(Q, p, G, h, A, b)
    wgts = np.array(sol["x"]).flatten() if sol["status"] == "optimal" else np.array(n * [np.nan])
    return wgts

Upper and Lower position limits: GMV

def constrained_gmv(means, cov, min_wgt, max_wgt):
    n = len(means)
    Q = matrix(cov, tc="d")
    p = matrix(np.zeros(n), (n, 1), tc="d")
    # Constraint: minimum and maximum position limits
    G = matrix(np.vstack((-np.identity(n), np.identity(n))), tc="d")
    h = matrix(np.append(min_wgt*np.ones(n), max_wgt*np.ones(n)), (2*n, 1), tc="d")        
    # Constraint: fully-invested portfolio
    A = matrix(np.ones(n), (1, n), tc="d")
    b = matrix([1], (1, 1), tc="d")
    sol = Solver(Q, p, G, h, A, b)
    wgts = np.array(sol["x"]).flatten() if sol["status"] == "optimal" else np.array(n * [np.nan])
    return wgts  

Estimation strategies

Portfolio optimization inputs

  • Set of expected returns for assets

  • Set of std deviations (variances) for assets

  • Set of correlations (covariances) across assets

How good are we at estimating these things?

We’ll use four strategies for input estimation.

Strategy 1: Est-All

  • use historical data to estimate expected returns, standard deviations, and correlations.
  • optimal risky portfolio is the tangency portfolio
  • scale tangency up or down depending on risk aversion or target expected return

Strategy 2: Est-SD-Corr

  • use historical data to estimate standard deviations and correlations
  • assume expected returns are the same across all assets.
  • optimal risky portfolio is the global minimum variance portfolio.
  • for the purposes of determining optimal capital allocation, use the cross-sectional average of the historical time-series average return as the expected return input.

Strategy 3: Est-SD

  • use historical data to estimate standard deviations only
  • assume correlations across assets are zero
  • assume expected returns are the same across all assets
  • for the purposes of determining optimal capital allocation, use the cross-sectional average of the historical time-series average return as the expected return input.

Strategy 4: Est-None

  • do not use historical data to estimate expected returns, standard deviations, or correlations.
  • the optimal portfolio is an equal-weighted portfolio of the assets (\(1/N\) portfolio).
  • for the purposes of determining optimal capital allocation, use the cross-sectional average of the historical time-series average return as the expected return input.

Alternatives (for a later date)

  • Better method to forecast volatility?
  • Use a factor model to estimate cross-asset correlations?
  • Estimate within- and across-industry correlations?
  • Model industry correlations using a factor model?

Today’s notebooks contain backtests comparing estimation choices and position limit choices for portfolios of

  • stocks, bonds, and gold
  • Fama-French 48 industry portfolios.