18.2. MPT and CAPM: analytical solution#
This section details the closed-form matrix derivations for Modern Portfolio Theory (MPT) and the Capital Asset Pricing Model (CAPM).
18.2.1. MPT: fully invested portfolio with no risk-free asset#
When short-selling and leverage are allowed without limits, the optimization problem can be solved exactly using the method of Lagrange Multipliers.
Problem setup. MPT can be formulated as a costrained optimization problem, to find the vector \(\mathbf{w}\) describing the asset allocation of the portfolio that produces the minimum variance portfolio, for a given expected return of the portfolio and under the constraint of fully invested portfolio,
The expression of portfolio expected return \(\overline{\mu}\) and variance \(\sigma^2\) are given by (18.1) and (18.2) as functions of the expected value \(\boldsymbol\mu\) and variance matrix \(\boldsymbol\sigma^2\) of the assets and portfolio weights \(\mathbf{w}\).
Constrained optimization, with Lagrange multipliers. Using Lagrange multiplier method, and adding a factor \(\frac{1}{2}\) to the variance of the portfolio (to avoid a factor \(2\) later), the augmented objective function reads
If the constraints hold, then \(\sigma^2 = 2 \widetilde{J}\).
Solution of the optimization problem. Setting to zero the gradient of the augmented objective function1 w.r.t. asset weights \(\mathbf{w}\), and Lagrange multipliers \(a\), \(b\), the optimal solution is found as the solution of the following linear system,
Solution of the linear system - Details
Without any risk-free asset, the covariance matrix is non-singular, and thus invertible. (Formally) solving the first equation for \(\mathbf{w}\),
a system of 2 equations in 2 unknowns \(a\), \(b\) reads
and thus
Thus, the optimal asset allocation is a 1-degree function of \(\mu\),
and its variance is a 2-degree function of \(\mu\),
As the matrix \(\mathbf{A}\) is definite positive (its inverse is definite positive as well?), it follows that \(\sigma^2 > 0\) for any value of \(\mu\), as expected for the value of a variance.
Some analytic geometry. The function
is the function of a parabola, with vertex in
Using \(\sigma\) as an independent coordinate (and not \(\text{Var}[r] = \sigma^2\))…
Properties of matrix \(\ \mathbf{A}\)
Is it positive definite? Covariance matrix is positive matrix, so for \(\forall \mathbf{v}\)
and choosing \(\mathbf{v} = \begin{bmatrix} \boldsymbol\mu & \mathbf{1} \end{bmatrix} \begin{bmatrix} a \\ b \end{bmatrix}\), for \(\forall a, b\), it immediately follows
and thus matrix \(\mathbf{A}\) is definite positive.
18.2.1.1. Sensitivity of the MPT to data uncertainty#
Sensitivity of the solution to data uncertainty. Once a solution is found, the senstivity of this solution w.r.t. variation in the expected return and the variance of the assets are evaluated as the gradient of the augmented objective function (18.3) w.r.t. to \(\boldsymbol\mu\), and \(\boldsymbol\sigma^2\) respectively,
and, since \(\nabla \sigma^2 = 2 \sigma \nabla \sigma\),
Some example is provided is discussed in the Jupyter notebook Uncertainty in MPT and CAPM Models.
Sensitivity and Taylor expansion
Let the objective function
having explicitly written the dependence from the parameters (input data) of the model, \(\boldsymbol\mu\), \(\boldsymbol\sigma^2\). If the expected value and the variance of the returns become \(\boldsymbol\mu + \Delta \boldsymbol\mu\), \(\boldsymbol\sigma^2 + \Delta \boldsymbol\sigma^2\), the objective function becomes
Sensitivity of the asset allocation. The optimal solution comes from the solution of the linear system (18.4), that can be formally written as
The change in the asset allocation \(\Delta \mathbf{w}\) due to a change of the expected return of the asset \(\Delta \boldsymbol\mu\), follows from a linear expansion around the optimal solution,
and thus
Details - Rearranging terms
As
it’s possible to rearrange the linear system for the variation of asset allocation as
Some example is provided is discussed in the Jupyter notebook Uncertainty in MPT and CAPM Models, where the changes of asset allocation due to unitary variation of the expected return of individual assets are discussed.
18.2.2. CAPM#
Analytical solution of the MPT-CAPM optimization problem, with a risk-free asset. If a risk-free asset exists, the covariance matrix is singular. However, the risk-free asset can be partitioned from the risky assets, so that the covariance matrix of the return of the risky asset is non-singular. The problem becomes
…
From the second and the fourth equation,
and thus
whose solution reads
and the relationship between the variance and the expected value of the optimal portfolios,
or the linear relation between the standard deviation of the portoflio \(\sigma\) and the excess return \(\mu_e\) of the portfolio w.r.t. the risk-free asset,
Solution of the linear system - Details
and thus
Eventually, the variance of the portfolio reads
with \(\mu_e := \mu - \mu_0\) the excess desired return of the portfolio w.r.t. the risk-free asset, and \(\boldsymbol\mu_e := \boldsymbol\mu - \mu_0 \mathbf{1}\) the vector of the excess returns of each risky asset w.r.t. the risk-free asset. Taking the square root of the last relation, a 1-degree function relates the standard deviation and the return of the portfolio,
Tangency condition as a maximization of a measure of risk-adjusted return, namely Sharpe ratio comparing the excess return and the variance of the portfolio w.r.t. a risk-free (zero variance) asset \((\cdot)_0\) used as a benchmark \((\cdot)_b\)
as the variance reads
Tangency condition between optimal portfolio lines w/ and w/o risk-free asset
W/o risk-free asset
with \(A_{22} = \mathbf{1}^T \boldsymbol\sigma^{-2} \mathbf{1}\), \(\mathbf{A}_{11} = \boldsymbol\mu^T \boldsymbol\sigma^{-2} \boldsymbol\mu\), \(A_{12} = \boldsymbol\mu^T \boldsymbol\sigma^{-2} \mathbf{1}\), and \(\Delta = A_{11} A_{22} - A_{12}\)
W/ risk-free asset
Tangency condition
or with the variance,
…
- 1
The augmented objective function is a quadratic function \(\mathbf{w}\), and thus it has only one extreme point.