3.8 Derivatives of Simple Matrix Functions

Result: Let A be an n×n symmetric matrix, and let x and y be n×1 vectors. Then, xn×1xy=(x1xyxnxy)=y,xn×1Ax=(x1(Ax)xn(Ax))=A,xn×1xAx=(x1xAxxnxAx)=2Ax. We will demonstrate these results with simple examples. Let, A=(abbc), x=(x1x2),y=(y1y2). First, consider (3.12). Now, xy=x1y1+x2y2. Then, xxy=(x1xyx2xy)=(x1(x1y1+x2y2)x2(x1y1+x2y2))=(y1y2)=y. Next, consider (3.13). Note that, Ax=(abbc)(x1x2)=(ax1+bx2bx1+cx2), and, (Ax)=(ax1+bx2,bx1+cx2). Then, xAx=(x1(ax1+bx2,bx1+cx2)x2(ax1+bx2,bx1+cx2))=(abbc)=A. Finally, consider (3.14). We have, xAx=(x1x2)(abbc)(x1x2)=ax21+2bx1x2+cx22. Then, xxAx=(x1(ax21+2bx1x2+cx22)x2(ax21+2bx1x2+cx22))=(2ax1+2bx22bx1+2cx2)=2(abbc)(x1x2)=2Ax.

Example 3.9 (Calculating an asset’s marginal contribution to portfolio volatility)

In portfolio risk budgeting (see chapter 14), asset i’s marginal contribution to portfolio volatility σp=(xΣx)1/2 is given by MCRσi=σpxi=(xΣx)1/2xi, and approximates how much portfolio volatility changes when the allocation to asset i increases by a small amount. Using the chain rule and matrix derivatives we can compute the entire vector of asset marginal contributions at once:

(xΣx)1/2x=12(xΣx)1/2xΣxx=12(xΣx)1/22Σx=(xΣx)1/2Σx=Σxσp.

Then asset i’s marginal contribution is given by the i-th row of Σxσp.

Example 2.33 (Finding the global minimum variance portfolio)

Let R denote an n×1 random vector of asset returns with E[R]=μ and var(R)=Σ. The global minimum variance portfolio (see Chapter 11, Section 11.3) m solves the constrained minimization problem: min The Lagrangian function is: L(\mathbf{m},\lambda)=\mathbf{m}^{\prime}\Sigma \mathbf{m}+\lambda\mathbf{(m}^{\prime}\mathbf{1}-1). The first order conditions can be expressed in matrix notation as, \begin{align} \underset{(n\times1)}{\mathbf{0}} & =\frac{\partial L(\mathbf{m},\lambda)}{\partial\mathbf{m}}=\frac{\partial}{\partial\mathbf{m}}\mathbf{m}^{\prime}\Sigma \mathbf{m+}\frac{\partial}{\partial\mathbf{m}}\lambda\mathbf{(m}^{\prime}\mathbf{1}-1)=2\cdot\Sigma \mathbf{m+}\lambda\cdot\mathbf{1}\tag{3.16}\\ \underset{(1\times1)}{0} & =\frac{\partial L(\mathbf{m},\lambda)}{\partial\lambda}=\frac{\partial}{\partial\lambda}\mathbf{m}^{\prime}\Sigma \mathbf{m+}\frac{\partial}{\partial\lambda}\lambda\mathbf{(m}^{\prime}\mathbf{1}-1)=\mathbf{m}^{\prime}\mathbf{1}-1\tag{3.17} \end{align} These first order conditions represent a system of n+1 linear equations in n+1 unknowns (\mathbf{m} and \lambda). These equations can be represented in matrix form as the system \left[\begin{array}{cc} 2\Sigma & \mathbf{1}\\ \mathbf{1}^{\prime} & 0 \end{array}\right]\left[\begin{array}{c} \mathbf{m}\\ \lambda \end{array}\right]=\left[\begin{array}{c} \mathbf{0}\\ 1 \end{array}\right], which is of the form \mathbf{Az}=\mathbf{b} for \mathbf{A}=\left[\begin{array}{cc} 2\Sigma & \mathbf{1}\\ \mathbf{1}^{\prime} & 0 \end{array}\right],\,\mathbf{z}=\left[\begin{array}{c} \mathbf{m}\\ \lambda \end{array}\right],\,\mathbf{b}=\left[\begin{array}{c} \mathbf{0}\\ 1 \end{array}\right]. The portfolio weight vector \mathbf{m} can be found as the first n elements of \mathbf{z}=\mathbf{A}^{-1}\mathbf{b}.

\blacksquare