\( \newcommand{\bm}[1]{\boldsymbol{#1}} \newcommand{\textm}[1]{\textsf{#1}} \def\T{{\mkern-2mu\raise-1mu\mathsf{T}}} \newcommand{\R}{\mathbb{R}} % real numbers \newcommand{\E}{{\rm I\kern-.2em E}} \newcommand{\w}{\bm{w}} % bold w \newcommand{\bmu}{\bm{\mu}} % bold mu \newcommand{\bSigma}{\bm{\Sigma}} % bold mu \newcommand{\bigO}{O} %\mathcal{O} \renewcommand{\d}[1]{\operatorname{d}\!{#1}} \)

Exercises

Exercise 7.1 (Efficient frontier)

  1. Download market data corresponding to \(N\) assets (e.g., stocks or cryptocurrencies) during a period with \(T\) observations, \(\bm{r}_1, \dots, \bm{r}_T \in \R^N\).
  2. Estimate the expected return vector \(\bmu\) and covariance matrix \(\bSigma\).
  3. Plot the mean–volatility efficient frontier computed by solving different mean–variance formulations, namely:
    • the scalarized form: \[ \begin{array}{ll} \underset{\w}{\textm{maximize}} & \w^\T\bmu - \frac{\lambda}{2}\w^\T\bSigma\w\\ \textm{subject to} & \bm{1}^\T\w=1, \quad \w\ge\bm{0}; \end{array} \]
    • the variance-constrained form: \[ \begin{array}{ll} \underset{\w}{\textm{maximize}} & \w^\T\bmu\\ \textm{subject to} & \w^\T\bSigma\w \leq \alpha\\ & \bm{1}^\T\w=1, \quad \w\ge\bm{0}; \end{array} \]
    • the expected return-constrained scalarized form: \[ \begin{array}{ll} \underset{\w}{\textm{minimize}} & \w^\T\bSigma\w\\ \textm{subject to} & \w^\T\bmu \geq \beta\\ & \bm{1}^\T\w=1, \quad \w\ge\bm{0}. \end{array} \]
  4. Discuss the benefits and drawbacks of the three methods for calculating the efficient frontier.

Exercise 7.2 (Efficient frontier with practical constraints) Repeat Exercise 7.1 including different realistic constraints and discuss the differences. In particular:

  • leverage constraint: \(\left\Vert \w\right\Vert_1\leq\gamma\)
  • turnover constraint: \(\left\Vert \w-\w_{0}\right\Vert _{1}\leq\tau\)
  • max position constraint: \(|\w| \leq \bm{u}\)
  • market neutral constraint: \(\bm{\beta}^\T\w = 0\)
  • sparsity constraint: \(\left\Vert \w\right\Vert _{0} \leq K.\)

Exercise 7.3 (Efficient frontier out of sample)

  1. Download market data corresponding to \(N\) assets during a period with \(T\) observations.
  2. Using 70% of the data:
    • estimate the expected return vector \(\bmu\) and covariance matrix \(\bSigma\);
    • plot the mean–volatility efficient frontier by solving mean–variance formulations; and
    • plot some randomly generated feasible portfolios.
  3. Using the remaining 30% of the data (out of sample):
    • estimate the expected return vector \(\bmu\) and covariance matrix \(\bSigma\);
    • plot the new mean–volatility efficient frontier; and
    • re-evaluate and plot the mean and volatility of the previously computed portfolios (the ones defining the efficient frontier and the random ones).
  4. Discuss the difference between the two efficient frontiers, as well as how the portfolios shift from in-sample to out-of-sample performance.

Exercise 7.4 (Improving the mean--variance portfolio with heuristics) Repeat Exercise 7.3 including the following heuristic constraints to regularize the mean–variance portfolios:

  • upper bound constraint: \(\|\w\|_\infty\leq0.25\)
  • diversification constraint: \(\|\w\|_2^2\leq 0.25.\)

Exercise 7.5 (Computation of the MSRP)

  1. Download market data corresponding to \(N\) assets during a period with \(T\) observations.
  2. Estimate the expected return vector \(\bmu\) and covariance matrix \(\bSigma\).
  3. Compute the maximum Sharpe ratio portfolio \[ \begin{array}{ll} \underset{\w}{\textm{maximize}} & \dfrac{\w^\T\bmu - r_\textm{f}}{\sqrt{\w^\T\bSigma\w}}\\ \textm{subject to} & \begin{array}{l} \bm{1}^\T\w=1, \quad \w\ge\bm{0},\end{array} \end{array} \] with the following methods:
    • bisection method
    • Dinkelbach method
    • Schaible transform method.

Exercise 7.6 (Kelly portfolio)

  1. Download market data corresponding to \(N\) assets during a period with \(T\) observations.
  2. Compute the Kelly portfolio \[ \begin{array}{ll} \underset{\w}{\textm{maximize}} & \E\left[\textm{log}\left(1 + \w^\T\bm{r}\right)\right]\\ \textm{subject to} & \bm{1}^\T\w=1, \quad \w\ge\bm{0}, \end{array} \] with the following methods:
    • sample average approximation
    • mean–variance approximation
    • Levy-Markowitz approximation.

Exercise 7.7 (Expected utility portfolio)

  1. Download market data corresponding to \(N\) assets during a period with \(T\) observations.
  2. Compute the expected utility portfolio \[ \begin{array}{ll} \underset{\w}{\textm{maximize}} & \E\left[U(\w^\T\bm{r})\right]\\ \textm{subject to} & \bm{1}^\T\w=1, \quad \w\ge\bm{0}, \end{array} \] with different utilities such as
    • \(U(x) = \textm{log}\left(1 + x\right)\)
    • \(U(x) = \sqrt{1 + x}\)
    • \(U(x) = -1/x\)
    • \(U(x) = -p/x^p\) with \(p>0\)
    • \(U(x) = -1/\sqrt{1 + x}\)
    • \(U(x) = 1 - \textm{exp}(-\lambda x)\) with \(\lambda>0\).

Exercise 7.8 (Universal successive mean--variance approximation method)

  1. Consider the maximum Sharpe ratio portfolio, \[ \begin{array}{ll} \underset{\w}{\textm{maximize}} & \dfrac{\w^\T\bmu - r_\textm{f}}{\sqrt{\w^\T\bSigma\w}}\\ \textm{subject to} & \begin{array}{l} \bm{1}^\T\w=1, \quad \w\ge\bm{0},\end{array} \end{array} \] and the mean–volatility portfolio, \[ \begin{array}{ll} \underset{\w}{\textm{maximize}} & \w^\T\bmu - \kappa\sqrt{\w^\T\bSigma\w}\\ \textm{subject to} & \bm{1}^\T\w=1, \quad \w\ge\bm{0}, \end{array} \] both of which lie on the efficient frontier.
  2. Solve them with some appropriate method.
  3. Solve them via the universal successive mean–variance approximation method, which at each iteration \(k\), solves the mean–variance problem: \[ \begin{array}{ll} \underset{\w}{\textm{maximize}} & \w^\T\bmu - \dfrac{\lambda^k}{2}\w^\T\bSigma\w\\ \textm{subject to} & \bm{1}^\T\w=1, \quad \w\ge\bm{0}, \end{array} \] with a properly chosen \(\lambda^k\).
  4. Compare the obtained solutions and the computational cost.