Navigation

Portfolio Optimization by Risk Diversification

Portfolio Optimization by Risk Diversification

Minimum Variance Two Asset Portfolio

Portfolio optimization by risk diversification was originally described by Markowitz in 1952. He received in 1989 the John von Neumann Theory Prize and in 1990 the Nobel Memorial Prize in Economic Sciences. The list of the laureats can be found here.

We assume a portfolio P of two assets A and B with proportions 

$$x_A = x \text{     and     } x_B = (1-x).$$

We compile the proportions into a row vector x'

$$\mathbf{x'}=\left[\begin{array}{rr}x_A & x_B\end{array}\right] = \left[\begin{array}{rr}x & (1-x)\end{array}\right] = x\left[\begin{array}{rr}1 & -1\end{array}\right] + \left[\begin{array}{rr}0 & 1\end{array}\right] = x\mathbf{e'}_{AB} + \mathbf{e'}_B,$$

where

$$\mathbf{e'}_{AB}=\left[\begin{array}{rr}1 & -1\end{array}\right]\text{   and   } \mathbf{e'}_B = \left[\begin{array}{rr}0 & 1\end{array}\right].$$

The expected return rates

$$ \mu_A=E(R_A) \text{   and   } \mu_B=E(R_B) $$

are collected in a column vector μ

$$\mathbf{\mu} = \begin{bmatrix}\mu_A \\ \mu_B\end{bmatrix}$$

The expected return of the portfolio is the scalar μp

$$\mathbf{x'}\mathbf{\mu}=\left[x\mathbf{e}_{AB}+\mathbf{e_B} \right]'\begin{bmatrix}\mu_A \\ \mu_B\end{bmatrix}=x\mathbf{e'}_{AB}\begin{bmatrix}\mu_A \\ \mu_B\end{bmatrix}+\mathbf{e'}_B\begin{bmatrix}\mu_A \\ \mu_B\end{bmatrix}=x\begin{bmatrix}1 & -1\end{bmatrix}\begin{bmatrix}\mu_A \\ \mu_B\end{bmatrix}+\begin{bmatrix}0 & 1\end{bmatrix}\begin{bmatrix}\mu_A \\ \mu_B\end{bmatrix}=\mu_P.$$

or explicitly

$$\mu_p=x\mu_A-x\mu_B +\mu_B = \mu_B+x(\mu_A-\mu_B).$$

Let ρAB the correlation and Σ be the (2x2) variance-covariance matrix of the random returns of the two assets A and B

$$\mathbf{\Sigma}= \begin{bmatrix}\sigma^2_{A} & \sigma_{AB} \\ \sigma_{BA} & \sigma^2_{B}\end{bmatrix}=\begin{bmatrix}\sigma^2_{A} & \sigma_A\sigma_B\rho_{AB} \\ \sigma_B\sigma_A\rho_{BA} & \sigma^2_{B}\end{bmatrix},$$

then the variance or risk of portfolio P is the quadratic form

$$\mathbf{x'}\mathbf{\Sigma}\mathbf{x}=\left[x\mathbf{e}_{AB}+\mathbf{e_B} \right]'\Sigma\left[x\mathbf{e}_{AB}+\mathbf{e_B} \right]=x^2\mathbf{e'}_{AB}\Sigma\mathbf{e}_{AB}+2x\mathbf{e'}_{AB}\Sigma\mathbf{e}_B+\mathbf{e'}_B\Sigma\mathbf{e}_B=\sigma^2_P\ge 0$$

where

$$x\mathbf{e}'_{AB}\Sigma\left[x\mathbf{e}_{AB}+\mathbf{e}_B \right] = x\mathbf{e'}_{AB}\Sigma\:x\mathbf{e}_{AB}+ x\mathbf{e'}_{AB}\Sigma\mathbf{e}_{B},$$

$$\mathbf{e}'_{B}\Sigma\left[x\mathbf{e}_{AB}+\mathbf{e}_B \right] = \mathbf{e'}_{B}\Sigma\:x\mathbf{e}_{AB}+ \mathbf{e'}_{B}\Sigma\mathbf{e}_{B},$$

$$\mathbf{e'}_{AB}\Sigma\mathbf{e}_{AB} =\left[\sigma^2_A-2\sigma_A\sigma_B\rho_{AB}+\sigma^2_B\right],$$

$$\mathbf{e'}_{AB}\Sigma\mathbf{e}_{B} =\left[\sigma_A\sigma_B\rho_{AB}-\sigma^2_B\right],$$

$$\mathbf{e'}_{B}\Sigma\mathbf{e}_{B} =\left[\sigma^2_B\right],$$

and explicitly

$$\sigma^2_P = x^2\left[\sigma^2_A-2\sigma_A\sigma_B\rho_{AB}+\sigma^2_B\right]+2x\left[\sigma_A\sigma_B\rho_{AB}-\sigma^2_B\right]+\sigma^2_B\ge 0.$$

To obtain the minimal risk we compute the derivative of the variance to the scalar x, set the derivative to zero and solve for xMVP that is the proportion for asset A in the minimum variance portfolio.

$$\frac{\partial \sigma^2_p}{\partial x}=2x\mathbf{e'}_{AB}\Sigma\mathbf{e}_{AB}+2\mathbf{e'}_{AB}\Sigma\mathbf{e}_B =0$$

$$x\mathbf{e'}_{AB}\Sigma\mathbf{e}_{AB}=-\mathbf{e'}_{AB}\Sigma\mathbf{e}_B $$

$$\boxed{x_{MVP}=-\frac{\mathbf{e'}_{AB}\Sigma\mathbf{e}_B}{\mathbf{e'}_{AB}\Sigma\mathbf{e}_{AB}}=\frac{(\sigma^2_B-\sigma_A\sigma_B\rho_{AB})}{(\sigma^2_A-2\sigma_A\sigma_B\rho_{AB}+\sigma^2_B)}}.$$

(1 - xMVP) is the proportion for asset B in the minimum variance portfolio

$$(1-x_{MVP})=\frac{\mathbf{e'}_{AB}\Sigma\mathbf{e}_{AB}}{\mathbf{e'}_{AB}\Sigma\mathbf{e}_{AB}}+\frac{\mathbf{e'}_{AB}\Sigma\mathbf{e}_{B}}{\mathbf{e'}_{AB}\Sigma\mathbf{e}_{AB}} = \frac{\mathbf{e'}_{AB}\Sigma(\mathbf{e}_{AB}+\mathbf{e}_B)}{\mathbf{e'}_{AB}\Sigma\mathbf{e}_{AB}}=\frac{(\sigma^2_A-\sigma_A\sigma_B\rho_{AB})}{(\sigma^2_A-2\sigma_A\sigma_B\rho_{AB}+\sigma^2_B)}.$$

xMVP designates a minimum, if the second order derivative is not negative:

$$\frac{\partial^2\sigma^2_p}{\partial x^2}=\mathbf{e'}_{AB}\Sigma\mathbf{e}_{AB} = \left(\sigma^2_A-2\sigma_A\sigma_B\rho_{AB}+\sigma^2_B\right)\ge0.$$

So we check whether

$$\sigma^2_A+\sigma^2_B \ge 2\sigma_A\sigma_B\rho_{AB}.$$

Inspired by proof#4 of the Pythagorean theorem we can write

$$\sigma^2_A+\sigma^2_B= 4\frac{\sigma_A\sigma_B}{2}+(\sigma_B-\sigma_A)^2=2\sigma_A\sigma_B+(\sigma_B-\sigma_A)^2.$$

The Pythagorean theorem says

$$a^2+b^2=c^2 =4\frac{ab}{2}+(b-a)^2=2ab+(b-a)^2,$$

where

$$\frac{ab}{2}= \text{  area of the triangle with smaller side lengths a and b}$$

and

$$(b-a)^2 = \text{  area of the "inner" square left over, when placing the 4 triangles abc within square c^2}$$

So we check, whether the following inequality holds for all ρAB:

$$\sigma^2_A+\sigma^2_B=2\sigma_A\sigma_B+(\sigma_B-\sigma_A)^2 \ge 2\sigma_A\sigma_B\rho_{AB}.$$

$$2\sigma_A\sigma_B\rho_{AB} = \left\{\begin{array}{ll}2\sigma_A\sigma_B&&,\rho_{AB}=1\\2\sigma_A\sigma_B\rho_{AB}\lt2\sigma_A\sigma_B&&,0\lt\rho_{AB}\lt1 \\0&&,\rho_{AB}=0\\-2\sigma_A\sigma_B\rho_{AB}\gt-2\sigma_A\sigma_B&&,-1\lt\rho_{AB}\lt0\\-2\sigma_A\sigma_B&&,\rho_{AB}=-1\end{array}\right.$$

 This is true forall ρAB, so xMVP guarantees minimal risk for a two-asset portfolio P.

 

References

  • Cottin, Claudia & Döhler, Sebastian, Risikoanalyse: Modellierung, Beurteilung und Management von Risiken mit Praxisbeispielen, Wiesbaden: Vieweg + Teubner, 2009, ISBN 978-3-8348-0594-2
  • Green, Paul E. & Carroll, J. Douglas, Mathematical Tools for Applied Multivariate Analysis, New York-San Francisco-London: Academic Press, 1976, ISBN 0-12-297550-2
  • Harry Markowitz, The Journal of Finance, Vol. 7, No. 1 (Mar., 1952), pp. 77-91
  • Proof#4, Pythagorean Theorem, https://www.cut-the-knot.org/pythagoras/index.shtml#4 (visited 2018/04/23)

 

Code of WebPPL program: Minimum Variance Two Asset Portfolio

console.log("==============================================================================")
console.log("file: PCM20180415_MinimumVarianceTwoAssetPortfolio  *** PCM *** 2018/04/24 ** ")
console.log("      the numerical example was taken from:                                   ")
console.log("          Cottin, Claudia & Döhler, Sebastian, Risikoanalyse: Modellierung,   ")
console.log("                  Beurteilung und Management von Risiken mit Praxisbeispielen,")
console.log("                  Kap.4.2.2.3, S.181f., Wiesbaden: Vieweg + Teubner, 2009,    ")
console.log("                  ISBN 978-3-8348-0594-2                                      ")
console.log("==============================================================================")
var startTime = Date.now()
var sigmaA = 0.2
console.log("sigmaA = ", sigmaA)
var sigmaB = 0.4
console.log("sigmaB = ", sigmaB)
var muA = 0.1
console.log("muA = ", muA)
var muB = 0.2
console.log("muB = ", muB)
var rhoAB =[1.0, 0.5, 0.0,-0.5,-1.0]
console.log("vector of hypothetical asset correlations"); print(rhoAB)
console.log("==============================================================================")
//-------------------------------------------------------------------------------------------
var runTime = function(startTime) {
  var stopTime = Date.now()
  var runTimeInMsec = (stopTime - startTime)
  var runTimeInSec = runTimeInMsec/1000.
  var runTimeInMin = runTimeInSec/60.
  console.log("runTimeInMsec ---> ", runTimeInMsec)
  console.log("runTimeInSec  ---> ", runTimeInSec)
  console.log("runTimeInMin  ---> ", runTimeInMin)
}
//-------------------------------------------------------------------------------------------
var xMVP_funct = function(rAB) {
  (Math.pow(sigmaB,2)
   - sigmaA*sigmaB*rAB)/(Math.pow(sigmaA,2) - 2*sigmaA*sigmaB*rAB + Math.pow(sigmaB,2))
}
var OneMinus_xMVP_funct = function(rAB) {
  (Math.pow(sigmaA,2)
   - sigmaA*sigmaB*rAB)/(Math.pow(sigmaA,2) - 2*sigmaA*sigmaB*rAB + Math.pow(sigmaB,2))
}
//-------------------------------------------------------------------------------------------
var muMVP = function(xMVP) {
  return (muB - (muB - muA) * xMVP)
}
//-------------------------------------------------------------------------------------------
var varSigmaPSQ = function(x, rho){
  var sigmaASQ = Math.pow(sigmaA, 2)
  var sigmaBSQ = Math.pow(sigmaB, 2)
  var sigmaA_sigmaB_rhoAB = sigmaA*sigmaB*rho
  var sigmaPSQ = Math.pow(x,2)*(sigmaASQ - 2*sigmaA_sigmaB_rhoAB + sigmaBSQ) +
      2*x*(sigmaA_sigmaB_rhoAB - sigmaBSQ) + sigmaBSQ
  return sigmaPSQ
}
//-------------------------------------------------------------------------------------------
var muP = function(x) {
  var mu = x*muA + (1 - x) * muB
  return mu
}
//-------------------------------------------------------------------------------------------
console.log("==============================================================================")
var xs = mapN(function(n){n/100.0 - 1.0}, 301)
var muPs = map(muP, xs)
viz.line(xs, muPs, {xLabel:"Proportion x(A) of asset A", yLabel:"expected return mu(A)"})
console.log("==============================================================================")
map(function(rho){
  console.log("============================================================================")
  console.log("rho_AB = ", rho)
  console.log("==============")
  var xMVP = xMVP_funct(rho)
  console.log("xMVP = ", xMVP)
  var OneMinus_xMVP = OneMinus_xMVP_funct(rho)
  console.log("1-xMVP = ", OneMinus_xMVP)
  var xMVP_check = xMVP + OneMinus_xMVP
  console.log("check: |xMVP+(1-xMVP) - 1| < 10E6 = ", Math.abs(xMVP_check - 1) < 10E6)
  console.log("muMVP = ", muMVP(xMVP))
  var sigmaPSQ_MVP = varSigmaPSQ(xMVP, rho)
  console.log("minimum variance sigma^2_P_MVP = ", sigmaPSQ_MVP)
  console.log("minimum variance sigma_P_MVP = ", Math.sqrt(sigmaPSQ_MVP))
  var sigmaPSQs = map(function(x){varSigmaPSQ(x,rho)}, xs)
  viz.line(xs, sigmaPSQs, {xLabel:"Proportion x(A) of asset A", yLabel:"Risk(P) = sigmaP^2"})
  var sigmaPs = map(function(sigmaPSQ){Math.sqrt(sigmaPSQ)}, sigmaPSQs)
  viz.line(xs,sigmaPs,{xLabel:"Proportion x(A) of asset A", yLabel:"sqrt(Risk(P)) = sigmaP"})
  viz.line(muPs, sigmaPs, {xLabel:"muP", yLabel:"sigmaP"})
  viz.line(sigmaPs, muPs, {xLabel:"sigmaP", yLabel:"muP"})
}, rhoAB)
  console.log("============================================================================")
console.log("runTime = "); display(runTime(startTime))
console.log("==============================================================================")

Remarks related to the following computer output

The problem is described e.g. in Cottin, 2009, ch.4.2.2. From ch. 4.2.2.3 we used their numerical example with two assets with μ(A) = 0.1, μ(B) = 0.2, σ(A) = 0.2, and σ(B) = 0.4. Thus asset B has both a higher return and risk.


For the correlation ρ(A,B) Cottin & Döhler assumed values +1.0, 0.0,-1.0. To that set we added two correlations +0.5 and -0.5.


Output of our WebPPL program is xMVP (= proportion of asset A in the minimum variance portfolio (MVP)), 1 - xMVP (= proportion of asset B in the minimum variance portfolio), variance and standard deviation of the MVP, and the expected return μMVP of the MVP.


Furthermore, we display the σ-μ and μ-σ diagrams. These diagrams demonstrate the efficient border of portfolio; that is what kind of portfolios can be generated by mixing A and B.


In contrast to Cottin & Döhler and others we use only one constraint. Weights have to sum to one. They need be constrained like 0 <= xMVP, (1-xMVP) <= 1.0. In the case of negative weights we have a short position.


This is quite natural when we already possess a portfolio and we only want to readjust weights. Then a negative weight means "sell" and and a weight greater than 1.0 means "buy more".


This special case occured in our analysis when rho(A,B) = +1.0. Cottin & Döhler do not explicitly offer weights. They only write that the minimum variance portfolio should contain only asset A with 100%. Our WebPPL program computes weights xMVP(A) = xMVP = 2.0 and xMVP(B) = (1-xMVP) = -1.0. That is a recommendation for a portfolio owner to sell asset B and reinvest this budget into asset A.

Output of WebPPL Program: Minimum Variance Two Asset Portfolio


==============================================================================

file: PCM20180415_MinimumVarianceTwoAssetPortfolio  *** PCM *** 2018/04/24 ** 

      the numerical example was taken from:                                   

          Cottin, Claudia & Döhler, Sebastian, Risikoanalyse: Modellierung,   

                  Beurteilung und Management von Risiken mit Praxisbeispielen,

                  Kap.4.2.2.3, S.181f., Wiesbaden: Vieweg + Teubner, 2009,    

                  ISBN 978-3-8348-0594-2                                      

==============================================================================

sigmaA =  0.2

sigmaB =  0.4

muA =  0.1

muB =  0.2

vector of hypothetical asset correlations

[1,0.5,0,-0.5,-1]

(3)

==============================================================================

===========

see Fig01 below

===========

============================================================================

rho_AB =  1

==============

xMVP =  2

1-xMVP =  -1

check: |xMVP+(1-xMVP) - 1| < 10E6 =  true

muMVP =  0

minimum variance sigma^2_P_MVP =  0

minimum variance sigma_P_MVP =  0

===========

see Fig02 below

===========

===========

see Fig03 below

===========

===========

see Fig04 below

===========

===========

see Fig05 below

===========

============================================================================

rho_AB =  0.5

==============

xMVP =  1

1-xMVP =  0

check: |xMVP+(1-xMVP) - 1| < 10E6 =  true

muMVP =  0.1

minimum variance sigma^2_P_MVP =  0.04000000000000001

minimum variance sigma_P_MVP =  0.2

===========

see Fig06 below

===========

===========

see Fig07 below

===========

===========

see Fig08 below

===========

===========

see Fig09 below

===========

============================================================================

rho_AB =  0

==============

xMVP =  0.8

1-xMVP =  0.2

check: |xMVP+(1-xMVP) - 1| < 10E6 =  true

muMVP =  0.12

minimum variance sigma^2_P_MVP =  0.03200000000000003

minimum variance sigma_P_MVP =  0.17888543819998326

===========

see Fig10 below

===========

===========

see Fig11 below

===========

===========

see Fig12 below

===========

===========

see Fig13 below

===========

============================================================================

rho_AB =  -0.5

==============

xMVP =  0.7142857142857143

1-xMVP =  0.28571428571428575

check: |xMVP+(1-xMVP) - 1| < 10E6 =  true

muMVP =  0.12857142857142856

minimum variance sigma^2_P_MVP =  0.017142857142857154

minimum variance sigma_P_MVP =  0.13093073414159548

===========

see Fig14 below

===========

===========

see Fig15 below

===========

===========

see Fig16 below

===========

===========

see Fig17 below

===========

============================================================================

rho_AB =  -1

==============

xMVP =  0.6666666666666666

1-xMVP =  0.3333333333333333

check: |xMVP+(1-xMVP) - 1| < 10E6 =  true

muMVP =  0.13333333333333336

minimum variance sigma^2_P_MVP =  0

minimum variance sigma_P_MVP =  0

===========

see Fig18 below

===========

===========

see Fig19 below

===========

===========

see Fig20 below

===========

===========

see Fig21 below

===========

============================================================================

runTime = 

runTimeInMsec --->  2992

runTimeInSec  --->  2.992

runTimeInMin  --->  0.04986666666666666

==============================================================================
Webmlgasterzzv/k (manuiyqwela.wuestefe2zldvb@uipoysol.deowwd5) (Changed: 2020-01-23)