Abstract: This vignette provides selected sections, with R code, from my book Constructing Insurable Risk Portfolios. Copy and paste the R-code to run it yourself.

# A function to make attractive tables
#  Default Widths for Latex
ColWidth4  <- "1.8cm"
ColWidth5  <- "1.6cm"
ColWidth6  <- "1.4cm"
ColWidth7  <- "1.3cm"
ColWidth8  <- "1.1cm"
ColWidth9  <- "1.0cm"
ColWidth10 <- "0.9cm"
ColWidth14 <- "0.5cm"
#  Function to Create a Style for Generating Tables
TableGen1 <-function(TableData,TextTitle,Align=`r`, Digits=0, ColumnSpec=1,
                     ColumnSpec0=1, ColWidth0= "2.5cm", 
                     BorderRight=1, ColWidth= "1.5cm", latexFont = 10){
  if (HtmlEval){ColumnSpec <- ColumnSpec+1
  #kable(TableData)
     TextTitle1 <- paste0('**', TextTitle,'**', collapse='')
     kableExtra::kbl(TableData, caption=TextTitle1, align = Align,
                     booktabs = T, digits=Digits) %>%
     kableExtra::kable_classic(full_width = F, font = 12, html_font = "Cambria") %>%
     kable_styling(bootstrap_options = c("striped", "condensed"))  %>%
     kableExtra::column_spec(ColumnSpec0, width =  ColWidth0) %>%
     kableExtra::column_spec(ColumnSpec, width =  ColWidth) %>%
     kableExtra::column_spec(BorderRight, border_right = TRUE)
   } else  
   { ColumnSpec <- ColumnSpec+1
     TextTitle1 <- paste0('\\textbf{',TextTitle,'}', collapse='')
     kableExtra::kbl(TableData, caption = TextTitle1, align = Align,
                     booktabs = T, digits=Digits,escape = FALSE) %>%
    kableExtra::kable_styling(latex_options = c("striped", "condensed") ,
                              font = latexFont, protect_latex= TRUE)   %>%
    kableExtra::column_spec(ColumnSpec, width =  ColWidth) %>%
    kableExtra::column_spec(BorderRight, border_right = TRUE) 
   }  
}

Section 1.3. Investment Asset Portfolio Strategies

This book approaches diversifying risky portfolios similar to the strategy pioneered by Markowitz (1952) in his development of asset portfolio theory. In this approach, the investor considers \(p\) asset risks and wishes to determine \(c_j\), the proportion of wealth allocated to the jth risk. The goal is to minimize the uncertainty of the portfolio subject to a budget constraint based on the portfolio earning a required expected return level. Example 1.3.1 provides a concrete example of risks typically encountered in the investment allocation problem.

Example 1.3.1. Portfolio of Insurance Stock Returns. I consider a portfolio of \(p=8\) asset risks from the insurance sector. For illustrative purposes, the largest companies (by market capitalization) in each of eight countries were chosen. With ticker symbols in parens (), they are:

Daily stock prices were extracted from Yahoo Finance for the period 5 January 2015 to 14 September 2023 and are displayed in Figure 1. Over the entire period, United Health had the largest price increase.

R Code to Extract Yahoo Returns
R Code to Split Data
Normalized Prices of Eight Insurers

Figure 1: Normalized Prices of Eight Insurers

As is common in finance, insurance, and other areas that employ data science, I split the data into two components. The first is a five-year training period, 5 January 2015 to 31 December 2019, that will be used to develop alternative portfolios. The second is a three-year test period, 1 June 2020 to 31 May 2023, that will be used to assess the performance of the portfolios. From Figure 1, one can see that during the period omitted (in between the training and test periods), most stock prices dropped dramatically due to the global effect of the Covid pandemic. There are various ways of modeling such outlying features - for this analysis, I choose to omit this aberrant behavior. Table 1 summarizes several performance measures over training and testing periods.

Table 1: Insurance Sector Performance Measures
Train Ann Return Train Std Dev Train Sharpe (Rf=0) Test Ann Return Test Std Dev Test Sharpe (Rf=0)
United Health 0.254 0.213 1.193 0.206 0.220 0.938
AIA 0.147 0.239 0.613 0.022 0.311 0.070
Ping An 0.189 0.264 0.714 -0.108 0.377 -0.286
Chubb 0.088 0.160 0.546 0.162 0.237 0.684
Allianz 0.150 0.193 0.779 0.092 0.228 0.403
Aon 0.182 0.170 1.072 0.183 0.235 0.776
AXA 0.116 0.241 0.480 0.211 0.245 0.862
Tokio Marine 0.119 0.267 0.447 0.295 0.248 1.190

The \(p=8\) risks were chosen from the insurance sector for illustrative purposes. For notation, let \(R_1, \ldots, R_8\) be the returns from the eight risks. With investment allocations \(c_j\), one can form the portfolio

\[ P_R= c_1 R_1 + \cdots + c_8 R_8 . \]

The goal is to determine the investment allocations \(c_j\) in a way that minimizes the uncertainty of \(S\) subject to a budget constraint.


Section 3.4. Asset Allocation Problem

Asset allocations can be readily seen as a type of constrained optimization problem.

Section 3.4.1. Markowitz Portfolio Optimization

To describe how portfolios are formed, we first introduce a bit of notation. An investor considers:

  • \(p\) asset risks \(\mathbf{R} =(R_1, \ldots, R_p)^{\prime}\), each with mean \(\mathrm{E }(R_j)\) and variance \(\mathrm{Var }(R_j) = \Sigma_{jj}\), \(j=1, \ldots,p\).
  • The risks may depend on each other through covariance \(\mathrm{Cov}(R_i, R_j) = \Sigma_{ij}\). The \(p \times p\) matrix \(\boldsymbol \Sigma\) collects variances and covariances (with \(\Sigma_{ij}\) as the element in the \(i\)th row and \(j\)th column).
  • Let \(c_j\) be the fraction of an investor’s wealth in the \(j\)th asset and \(\mathbf{c} =(c_1, \ldots, c_p)^{\prime}\) is the corresponding vector. These are the choices that the investor makes.
  • The weighted sum \(P_R(\mathbf{c}) = \sum_{j=1}^p c_j R_j = \mathbf{c}^{\prime}\mathbf{R}\) gives the investor’s portfolio return.
  • For a given allocation vector \(\bf c\), the portfolio mean is \(\mathrm{E }[P_R(\mathbf{c})] = \mathbf{c}^{\prime} ~\mathrm{E}(\mathbf{R})\) and the variance is \(\mathrm{Var}[P_R(\mathbf{c})] = \mathbf{c}^{\prime} ~\mathbf{\Sigma}~\mathbf{c}\).

Asset Allocation Problem. The asset allocation problem can be expressed as one of three following forms:

\[\begin{equation} \boxed{ \begin{array}{lrlllcc} {\small \text{maximize}}_{\mathbf{c}} & \mathrm{E }[P_R(\mathbf{c})] &= \mathbf{c}^{\prime} ~\mathrm{E}(\mathbf{R}) \\ {\small \text{subject to}} & \mathrm{Var}[P_R(\mathbf{c})] &= \mathbf{c}^{\prime} ~\mathbf{\Sigma}~\mathbf{c} \le Var_0 \\ \end{array} } \tag{1} \end{equation}\]

\[\begin{equation} \boxed{ {\small \text{maximize}}_{\mathbf{c}} \ \ \ \mathbf{c}^{\prime} ~\mathrm{E}(\mathbf{R}) - \lambda_{Port} ~\mathbf{c}^{\prime} ~\mathbf{\Sigma}~\mathbf{c} } \tag{2} \end{equation}\]

\[\begin{equation} \boxed{ \begin{array}{lrlllcc} {\small \text{minimize}}_{\mathbf{c}} & \mathrm{Var}[P_R(\mathbf{c})] &= \mathbf{c}^{\prime} ~\mathbf{\Sigma}~\mathbf{c} \\ {\small \text{subject to}} & \mathrm{E }[P_R(\mathbf{c})] &= \mathbf{c}^{\prime} ~\mathrm{E}(\mathbf{R}) \ge Req_0 \\ \end{array} } \tag{3} \end{equation}\]

Here, \(Var_0\) is the maximal portfolio variance, \(\lambda_{Port}\) is a Lagrange multiplier that controls the trade-off between the portfolio mean and variance, and \(Req_0\) is the required expected portfolio return. Displays (1)-(3) are equivalent in the sense that they trace the same frontier by varying the values of \(Var_0\), \(\lambda_{Port}\), and \(Req_0\).

Example 3.4.1. Portfolio of Insurance Stock Returns. This is a continuation of Example 1.3.1. The portfolio frontier is displayed in Figure 2 for these data. In addition to the frontier, stocks with the highest mean and lowest standard deviation are displayed for comparison purposes. Also shown is the equally weighted portfolio, where \(c_j = \frac{1}{8}\) for each \(j\).

Frontier of Portfolio Standard Deviations and Means

Figure 2: Frontier of Portfolio Standard Deviations and Means

R Code to Create Portfolios

Three portfolios were created, all subject to the constraint that the allocation choices sum to one, \(\sum_j c_j =\mathbf{c}^{\prime}\mathbf{1} = 1\) (the bold-faced \(\mathbf{1}\) is a vector of ones). One is the equally weighted portfolio, the second a “Markowitz” portfolio (taking \(\lambda_{Port}=5\)), and the third is a “minimum variance” portfolio. You can think of the third as a special case of the Markowitz portfolio in Display (3) where the minimal expected return \(Req_0\) is so small that it can be neglected. The three sets of portfolio weights are shown in Figure 3. The Markowitz portfolios were calculated using the R package CVXR - you can learn more about this package at the website https://cvxr.rbind.io.

Three Sets of Portfolio Allocations, by Insurer

Figure 3: Three Sets of Portfolio Allocations, by Insurer

The first three columns of Table 2 summarize the performance of the portfolios on the training sample. As anticipated, the MinVar minimum variance portfolio had the lowest standard deviation. Many financial analysts use the Sharpe ratio, the mean minus a risk-free rate divided by the standard deviation, to summarize portfolio performance. With a zero risk-free rate, the Markowitz portfolio is the strongest performer for the training sample based on the Sharpe ratio.

Columns four through six of Table 2 summarize the performance of the portfolios on the test sample. Interestingly, the MinVar portfolio had the highest standard deviation (although not by much). Based on the Sharpe ratio criterion, it was also the strongest performer.

Table 2: Portfolio Performance Measures
Train Ann Return Train Std Dev Train Sharpe (Rf=0) Test Ann Return Test Std Dev Test Sharpe (Rf=0)
MinVar 0.164 0.119 1.378 0.168 0.143 1.178
Markowitz 0.203 0.126 1.614 0.166 0.143 1.160
Equal 0.173 0.130 1.329 0.155 0.142 1.093

To get a better sense of the portfolios’ performance on the test sample, Figure 4 shows cumulative returns. All three are close to one another.

Cumulative Portfolio Returns (Test Sample)

Figure 4: Cumulative Portfolio Returns (Test Sample)

One cannot conclude too much from these results. Practicing analysts will use this approach while conducting more extensive testing by varying the training period, the test period, and the sample of stocks (risks) selected. Readers are invited to experiment with the code to determine their own optimal portfolios, see, for example [Exercise 3.3].

Section 3.4.2. Constraining Markowitz Portfolio Optimization

The popularity of the Markowitz portfolio approach is due in part to the fact that there is a simple closed form solution to the problem (see [Exercise 4.2]).

Moreover, given knowledge of the means, variances, and covariances, the optimization problem summarized in Displays (1)-(3) is convex (quadratic). As will be discussed in Chapter 4, this means that fast solvers are readily available for the problem. Convexity will also mean that one can impose additional linear (or convex) constraints on the problem and still achieve quick, reliable solutions. Display (4) exhibits several additional constraints regularly employed by practicing analysts:

\[\begin{equation} \boxed{ {\small \begin{array}{cc} \mathbf{c}' {\bf 1}= 1 & \text{capital budget constraint} \\ c_j \ge 0 & \text{long-only constraint} \\ \mathbf{c}' {\bf 1}= 0 & \text{dollar-neutral or self-financing constraint}\\ lower_j \le c_{j} \le upper_j & \text{holding constraint} \\ \sum_j |c_j| \le Bound_{leverage} & \text{leverage constraint} \\ \sum_j |c_j - c_{0,j}| \le Bound_{turnover} & \text{turnover constraint }\\ & \ \ \ \ \ \ \ \ \ \ c_{0,j} \text{ represents the current position} \\ \end{array} } . } \tag{4} \end{equation}\]

The first condition, “capital budget constraint,” ensures that one can interpret the allocations \(c_j\) as fractions of a given wealth amount invested in a portfolio.The second condition excludes “short selling” as is common in financial investment transactions; an investor may not take a negative position on a risk. The other conditions place limits on the portfolio allocations to meet differing investment strategies.

Section 4.4.1. Special Case: Asset Allocations

Asset allocations, summarized in Section 3.4, can be cast as a convex optimization problem. In addition, mathematically the asset allocation problem is similar to the quota share problem described in Section ??. Naturally, the practices are very different; the former considers allocation concerns of investors whereas the latter is about diversifying liabilities that is typically only done by insurers and major companies. A common simplifying feature of both problems is that the decision variables, \(c_1, \ldots, c_p\), are linear in the risks. This means that the problem is convex in many situations. In this section, we expand the discussion and use the expected shortfall \(ES\) as our risk measure.

To see the convexity of the problem, the approach is to define an expanded version of the expected shortfall function,

\[ \begin{array}{ll} ES1(\mathbf{c},z) &= z + \frac{1}{1-\alpha} \left\{\mathrm{E}[\mathbf{c}'\mathbf{X}] -\mathrm{E}[\mathbf{c}'\mathbf{X} \wedge z]\right\}\\ &= z + \frac{1}{1-\alpha} \mathrm{E}[\mathbf{c}'\mathbf{X} - z]_+ .\\ \end{array} \]

For fixed values of \(\mathbf{c}\) it is easy to check that the solution of the unconstrained minimization problem is the \(\alpha\) quantile. Moreover, the minimum value is the expected shortfall. This point will be developed in more detail in Section ??.

Moreover, we verify below that the function \(ES1(\mathbf{c},z)\) is convex in the decision variables \(\mathbf{c}\) and \(z\). Because minimums of convex function are also convex (see, for example, Boyd and Vandenberghe (2004), Section 3.2.5), this means that the \(ES\) function is convex.

Earlier in Display (3), we wrote the asset allocation problem as minimizing the portfolio variance subject to constraints on the mean return. Now, we extend this by using the expected shortfall as our risk measure. Specifically, we consider

\[\begin{equation} \boxed{ \begin{array}{lcc} {\small \text{minimize}}_{\mathbf{c},z} & ES1(\mathbf{c},z) & \\ {\small \text{subject to}} & \mathrm{E }[P_R(\mathbf{c})] = \mathbf{c}^{\prime} ~\mathrm{E}(\mathbf{R}) \ge Req_0 \\ \end{array} } \tag{5} \end{equation}\]

Example 4.4.1. Portfolio of Insurance Stock Returns. This is a continuation of Example 1.3.1 and Example 3.4.1. We are now ready to compute the portfolio specified Display (5) with the CVXR package.

As in Example 3.4.1, we determine optimal allocations using the training data. With these allocations, various summary measures are computed. Then, the optimal allocations are used on the test data and several summary measures are determined.

Table 3 summarizes performance for both the training and test samples. For comparison purposes, also included are the performance measures summarized earlier in Example 3.4.1.

R Code to ES Portfolios
Table 3: Portfolio Performance Measures, with ES
Train Ann Return Train Std Dev Train Sharpe (Rf=0) Test Ann Return Test Std Dev Test Sharpe (Rf=0)
MinVar 0.164 0.119 1.378 0.168 0.143 1.178
Markowitz 0.203 0.126 1.614 0.166 0.143 1.160
Equal 0.173 0.130 1.329 0.155 0.142 1.093
ES-\(\alpha = 0.95\) 0.173 0.120 1.436 0.158 0.144 1.099
ES-\(\alpha = 0.99\) 0.181 0.128 1.412 0.155 0.152 1.020

Another way of presenting the performance of the differing portfolios is to track their performance over time. In Figure 5, we can see that all portfolios behave similarly over the test period.

Cumulative Portfolio Returns (Test Sample), with ES

Figure 5: Cumulative Portfolio Returns (Test Sample), with ES

As emphasized in Example 3.4.1, one cannot conclude too much from these results. Practicing analysts will use this approach while conducting more extensive testing by varying the training period, the test period, and the sample of stocks (risks) selected. In addition, many of the constraints on allocations introduced in Section ?? will come into play (note that these allocation constraints are linear and so can readily be incorporated into the convex optimization problem). Readers are invited to experiment with the code to determine their own optimal portfolios.

Section 9.4. Asset Allocation Sensitivity and Robustness

For sensitivities to parameter assumptions, it is particularly interesting to consider the asset allocation problem introduced in Section ??. This is because this framework, although well received intellectually (it just makes sense to academics and practitioners), has not made the impact regarding practical implementations in part due to parameter uncertainty.

Section 9.4.1. Asset Allocation Sensitivity

The inputs for the optimization model are means, variances, and covariances/correlations that are typically estimated from historical data of financial returns, as illustrated in Example 1.3.1. It is known that the optimal asset weights are highly sensitive to estimates of expected returns. Many investment managers find the optimal portfolio weights to extreme and counter-intuitive (e.g., He and Litterman (2002)). Further, the instability of weights means that the optimal portfolio can perform poorly out sample, see for example, De Prado (2016). In addition, the uncertainty in the means almost can lead to highly concentrated portfolios. For example, Best and Grauer (1991) show how small changes in expected returns can lead to heavy investments in one return balanced by a strong “negative” investment (shorting an asset) when assets are correlated.

One of the basic purposes of the asset allocation strategy is to diversify a portfolio of assets meaning that variances and covariances are at the heart of this theory. Sadly, these inputs are also subject to estimation error which can lead to unstable portfolio weights. Interestingly, Chopra and Ziemba (1993) find that uncertainty in expected returns is roughly ten times as important as that in the covariance matrix. In addition, the variance–covariance matrix can become unstable when asset correlations increase which happens at times when diversification is important and yet more difficult to achieve (De Prado (2016)).

As summarized in Beketov, Lehmann, and Wittke (2018), in practical applications, all optimization model inputs are modified, substituted, and/or complemented by various methods including robo-advising methods outlined in Section 6.5. One of the goals of this section is to put forth a method to quantify the sensitivity of these inputs using methods developed earlier in the chapter.

To this end, based on the notation from Section ??, we now let \(\boldsymbol \mu\) be the vector of mean returns and, as before, let \(\boldsymbol \Sigma\) be the variance-covariance matrix. We wish to minimize the objective function as \(f_0({\bf c}, \boldsymbol \Sigma) = -\left({\bf c}^{\prime} \boldsymbol \mu - \lambda_{Port} ~ {\bf c}^{\prime} \boldsymbol \Sigma {\bf c} \right)\) subject to a single (\(p=1\)) budget constraint \(f_{eq}({\bf c}) = {\bf c}^{\prime}\mathbf{1} - 1=0\). In this minimal setting with no requirement that the allocation parameters be nonnegative, we can get closed-form expressions for the sensitivities which helps provide intuition for the results.

To begin, consider the uncertainty due to mean parameters and choose the auxiliary variable to be \(a=\mu\), where \(\mu\) is an element of \(\boldsymbol \mu\) and use \(\partial_{\mu} \boldsymbol \mu\) for the change in the vector with respect to that element. So, for example, if \(\mu\) is the first mean, then \(\partial_{\mu} \boldsymbol \mu\) represents a vector with 1 in the first entry and 0 for the other entries. Then, one can use the extended version of the Envelope theorem in equation (??) to establish

\[\begin{equation} \begin{array}{rl} \partial_{\mu} {\bf c}^*(\mu) = \frac{1}{2\lambda_{Port}} \boldsymbol \Sigma^{-1}\left\{ [\partial_{\mu} \boldsymbol \mu] - {\bf 1} ~\partial_{\mu} LME^*(\mu) \right\} \end{array} \tag{6} \end{equation}\]

and

\[\begin{equation} \partial_{\mu} LME^*(\mu) = \frac{{\bf 1}^{\prime} \boldsymbol \Sigma^{-1} [\partial_{\mu} \boldsymbol \mu]}{{\bf 1}^{\prime} \boldsymbol \Sigma^{-1} {\bf 1}} .\\ \tag{7} \end{equation}\]

With this, the portfolio sensitivity for the mean, variance, and standard deviation are

\[ \begin{array}{rl} \partial_{\mu} \left[\boldsymbol \mu'{\bf c}^*\right] &= \boldsymbol \mu' [\partial_{\mu} {\bf c}^*] + [\partial_{\mu} ~\boldsymbol \mu ]^{\prime} {\bf c}^{*} \\ \partial_{\mu} \left[{\bf c}^{*\prime} \boldsymbol \Sigma {\bf c}^{*}\right] &= [\partial_{\mu} {\bf c}^{*}]' \boldsymbol \Sigma {\bf c}^{*} + {\bf c}^{*\prime} \boldsymbol \Sigma [\partial_{\mu} {\bf c}^{*}] \\ \partial_{\mu} \sqrt{{\bf c}^{*\prime} \boldsymbol \Sigma {\bf c}^{*}} &= \frac{1}{2 \sqrt{{\bf c}^{*\prime} \boldsymbol \Sigma {\bf c}^{*}} }~~ \partial_{\mu} [{\bf c}^{*\prime} \boldsymbol \Sigma {\bf c}^{*}] = \partial_{\mu}~ SD[c^{*'}X] , \end{array} \]

that can be evaluated using equations (6) and (7).

Example 9.4.1. Portfolio of Insurance Stock Returns. This is a continuation of Example 4.4.1 which is based on Example 1.3.1 and Example 3.4.1. However, unlike these earlier examples, we now no longer require nonnegative allocation parameters.

# load(file= "../../Data/Chap1Data/InsurSectorReturns.Rdata")
# load(file="../../Data/Chap1Data/Frontier.Rdata")
load(file= "InsurSectorReturns2023.Rdata")
load(file="Frontier2023.Rdata")

# Training period summary statistics
numTradingDays <- 252 # Approximately nrow(Return_trn)/5
Sigma  <- cov(Return_trn)*numTradingDays
StdDev <- sqrt(diag(Sigma))
Means  <- colMeans(Return_trn)*numTradingDays
#  Determine the optimal allocations

portfolioMarkowitz <- function(mu, Sigma, lmd = 5) {
  c.prop <- Variable(nrow(Sigma))
  prob   <- Problem(Maximize(t(mu) %*% c.prop - 
                               lmd*quad_form(c.prop, Sigma)),
                  constraints = list(#c.prop >= 0, 
                                     sum(c.prop) == 1))
  result <- solve(prob)
  c.prop <- as.vector(result$getValue(c.prop))
  names(c.prop) <- colnames(Sigma)
  return(c.prop)
}
LPort <- 10
cstar <- portfolioMarkowitz(mu=Means, Sigma=Sigma, lmd=LPort)

PortfolioMean     <- t(as.vector(Means)) %*% cstar
PortfolioVariance <- t(cstar) %*% Sigma %*% cstar
PortfolioStdDev   <- sqrt(PortfolioVariance)

SigmaInv   <- solve(Sigma)
one.vec    <- rep(1,8)
one.SigInv <- one.vec  %*% SigmaInv
sum.SigInv <- sum(one.SigInv) # sum(SigmaInv)
LMEmu.vec  <- one.SigInv/sum.SigInv
c.mu       <- matrix(0, nrow=8,ncol=8)
one.vec    <- rep(1,8) 

MeanPort.muvec     <- rep(0,8)
VariancePort.muvec <- rep(0,8)
for (iaux in 1:8){
  zero.vec         <- rep(0,8) -> oneone.vec
  oneone.vec[iaux] <- 1
  c.mu[iaux,]      <- 1/(2*LPort)*
                SigmaInv %*% (oneone.vec - one.vec*LMEmu.vec[iaux])
  MeanPort.muvec[iaux] <- t(as.vector(Means)) %*% c.mu[iaux,] + cstar[iaux]
  VariancePort.muvec[iaux] <- t(c.mu[iaux,]) %*% Sigma %*% cstar +
                                t(cstar)  %*% Sigma  %*% c.mu[iaux,]
  }

StdDevPort.muvec <- as.numeric(0.5 * PortfolioStdDev**(-1)) * VariancePort.muvec
AssetAllocMat <- rbind(Means, StdDev, cstar, diag(c.mu), MeanPort.muvec, StdDevPort.muvec)
rownames(AssetAllocMat) <- c("$\\mu$", "$\\sigma$", 
                        "$c^*$", "$\\partial_{\\mu}~ c^*(\\mu)$", 
                        "$\\partial_{\\mu}~ [c^{*'}\\mu]$",
                        "$\\partial_{\\mu}~ SD[c^{*'}X]$")                      
colnames(c.mu) <- colnames(AssetAllocMat) -> rownames(c.mu)
#rowSums(c.mu)  #  Sum of each row is zero, as anticipated 

Table 4 summarizes results. The first two rows provide estimates of the mean and standard deviation based on five years of the training sample. These are annualized estimates based on daily data.

The third row provides the optimal allocation parameters \({\bf c}^*\) using a penalty parameter \(\lambda_{Port}=5\) as in Example 3.4.1. Note that the estimate for the French insurer AXA is negative, suggesting a negative investment or “shorting” this asset. For benchmarking, the optimal portfolio mean is 0.197 and the corresponding standard deviation is 0.126.

The fourth row provides allocation coefficient sensitivities for that risk. For example, if the mean for United Health increases by 1 unit (holding other means fixed), then the allocation for United Health increases by 1.262. The allocation parameters for the other seven stocks also change but are displayed in Table 5.

The fifth and sixth rows display the marginal changes of the portfolio mean and standard deviation for changes in each mean parameter. It is interesting to see that the changes in the standard deviations tend to be smaller in magnitude than mean changes.

Table 4: Mean Sensitivities to Asset Allocations
United Health AIA Ping An Chubb Allianz Aon AXA Tokio Marine
\(\mu\) 0.249 0.166 0.208 0.097 0.159 0.181 0.139 0.148
\(\sigma\) 0.213 0.239 0.264 0.160 0.193 0.169 0.241 0.267
\(c^*\) 0.269 0.125 0.080 0.005 0.270 0.329 -0.164 0.086
\(\partial_{\mu}~ c^*(\mu)\) 1.262 1.222 1.075 3.021 3.802 2.780 2.493 0.781
\(\partial_{\mu}~ [c^{*'}\mu]\) 0.405 0.107 0.122 -0.271 0.330 0.465 -0.229 0.071
\(\partial_{\mu}~ SD[c^{*'}X]\) 0.054 -0.007 0.017 -0.110 0.024 0.054 -0.026 -0.006

Table 5 provides more information about the allocation coefficient sensitivities. For example, as in the fourth row of Table 4, we see that if the mean for United Health increases by 1 unit (holding other means fixed), then the allocation for United Health increases by 1.262. Furthermore, the first row of Table 5 provides changes in allocations for the other risks, all due to the 1 unit increase in the mean of United Health. In particular, note that there is a significant decrease in the Chubb allocation, -0.517. For each row, the sum of these changes is zero due to the budget constraint \({\bf c}^{\prime}\mathbf{1} = 1\). Thus, the entire portfolio of asset allocations is highly sensitive to the uncertainty of even a single input mean, suggesting the need for more robust approaches as will be taken up in Section 9.4.2.

Table 5: Mean Sensitivities to Allocation Coefficients - \(\partial_{\mu}~ c^*(\mu)\)
United Health AIA Ping An Chubb Allianz Aon AXA Tokio Marine
United Health 1.262 -0.057 -0.055 -0.517 -0.165 -0.375 -0.035 -0.058
AIA -0.057 1.222 -0.591 -0.102 -0.206 -0.055 -0.032 -0.178
Ping An -0.055 -0.591 1.075 0.013 -0.122 -0.134 -0.051 -0.136
Chubb -0.517 -0.102 0.013 3.021 -0.636 -1.799 0.125 -0.105
Allianz -0.165 -0.206 -0.122 -0.636 3.802 -0.259 -2.294 -0.120
Aon -0.375 -0.055 -0.134 -1.799 -0.259 2.780 -0.090 -0.068
AXA -0.035 -0.032 -0.051 0.125 -2.294 -0.090 2.493 -0.116
Tokio Marine -0.058 -0.178 -0.136 -0.105 -0.120 -0.068 -0.116 0.781
Show Example 9.4.1 Code Solution

[Exercise 9.4.3] shows how to construct sensitivities due to variance and covariance parameters. Readers will find it interesting to compare these sensitivities to the mean sensitivities described above to re-affirm the industry perception that mean changes have a greater effect than variance and covariance changes.

Section 9.4.2. Asset Allocation Robustness

Stress testing, such as illustrated in Section ??, and the sensitivity analysis (via the [Envelope Theorem]) of the prior sections of this chapter sought to understand the impact on risk modeling results based on changes made to underlying assumptions. In arenas such as financial asset allocation problems, it is known that there can be extensive estimation error in parameters such as the means, variances, and covariances of stocks. This parameter uncertainty has led to development of alternative optimization techniques that guard against, or are robust to, this underlying parameter uncertainty.

To illustrate this robustness concept, we consider the asset allocation problem summarized in Section ??. As we saw in that section, in asset allocations it is common to maximize expected returns subject to a penalty for the uncertainty and express the problem as

\[ {\small \text{maximize}}_{\bf c} \left\{ {\bf c}^{\prime} \boldsymbol \mu - \frac{LME}{2} \times {\bf c}^{\prime} \boldsymbol \Sigma {\bf c} \right\} . \]

A robust version is

\[\begin{equation} {\small \text{maximize}}_{\bf c} \left\{ {\small \text{minimize}}_{\boldsymbol \mu \in \bf U}\left({\bf c}^{\prime} \boldsymbol \mu \right) - \frac{LME}{2} \times {\bf c}^{\prime} \boldsymbol \Sigma {\bf c} \right\} . \tag{8} \end{equation}\]

Here, \(\bf U\) is the uncertainty set. Intuitively, the mean parameters are unknown and vary within the uncertainty set. The minimization yields the worst portfolio mean within \(\bf U\). Practitioners feel this is a conservative and hence prudent form of portfolio construction, with parameter uncertainty built directly into the portfolio optimization process. In this way, the optimization maximizes penalized worst case portfolio returns.

In typical applications, the uncertainty set is centered about \(\bar{\boldsymbol\mu} = ( \bar{\mu}_1, \ldots, \bar{\mu}_p)\) and takes on one of two forms:

\[ \begin{array}{ccccc} {\bf U} = \{ |\mu_j - \bar{\mu}_j| \le \xi_j, j=1, \ldots, p \}& ~~ & {\bf U} = \{ (\boldsymbol\mu - \bar{\boldsymbol\mu})^{\prime} \boldsymbol \Omega^{-1}(\boldsymbol\mu - \bar{\boldsymbol\mu})\le \kappa^2 \} .\\ {\small \textit{box uncertainty set}} &~~ & {\small \textit{quadratric uncertainty set}} \end{array} \]

For the box uncertainty set, it can be shown (c.f., Yin, Perchet, and Soupé (2021)) that equation (8) reduces to

\[ {\small \text{maximize}}_{\bf c} \left\{ {\bf c}^{\prime} \bar{\boldsymbol \mu} - \kappa ~\times \max_j(|c_j|) - \frac{LME}{2} \times {\bf c}^{\prime} \boldsymbol \Sigma {\bf c} \right\} . \]

In the same way, for the quadratic uncertainty set, equation (8) reduces to

\[ {\small \text{maximize}}_{\bf c} \left\{ {\bf c}^{\prime} \bar{\boldsymbol \mu} - \kappa \sqrt{{\bf c}^{\prime}\boldsymbol \Omega{\bf c}} - \frac{LME}{2} \times {\bf c}^{\prime} \boldsymbol \Sigma {\bf c} \right\} . \]

Both problems are convex, specifically, second-order cone programming problems and so can be readily solved with modern tools, c.f., Boyd and Vandenberghe (2004) (Section 4.4.2). In asset allocation applications, it is common to also introduce uncertainty sets for the variance-covariance parameters, see, for example, Yin, Perchet, and Soupé (2021). Moreover, because this is a convex optimization problem, it is straight-forward to add the convex constraints on allocation parameters described in Section ??.


Example 9.4.2. Portfolio of Insurance Stock Returns. This is a continuation of Example 9.4.1. We illustrate the variability based on the quadratic uncertainty set. As before, we use sample training data to estimate the baseline mean vector \(\bar{\boldsymbol \mu}\) and variance-covariance matrix \(\boldsymbol \Sigma\). The uncertainty associated with the means is assumed to be proportional to \(\boldsymbol \Sigma\), so \(\boldsymbol \Omega \propto \boldsymbol \Sigma\). This proportionality constant can be absorbed into the \(\kappa\) parameter, so the constrained optimization problem of interest is

\[\begin{equation} \boxed{ \begin{array}{ccc} {\small \text{maximize}}_{\bf c} & {\bf c}^{\prime} \bar{\boldsymbol \mu} - \kappa \sqrt{{\bf c}^{\prime}\boldsymbol \Sigma{\bf c}} - \frac{LME}{2} \times {\bf c}^{\prime} \boldsymbol \Sigma {\bf c}\\ {\small \text{subject to}} & {\bf c}' {\bf 1} = 1 \\ & c_j \ge 0, \ \ \ \ j=1, \ldots, p . \end{array} } \tag{9} \end{equation}\]

We are now ready to compute the portfolio specified Display (9) with the CVXR package.

R Code to Develop Robust Allocations

Figure 6 summarizes results over four optimizations. The first is the Markowitz portfolio optimum, with \(\kappa=0\), that serves as a benchmark. The second is a base robust optimization using Display (9). For the third and fourth, we perturbed values of \(\bar{\boldsymbol \mu}\) by adding small Gaussian noise and used these perturbed values in the Display (9) optimization problem. Figure 6 shows that the three robust allocations are similar when compared to the Markowitz allocations.

Four Sets of Robust Portfolio Allocations, by Insurer

Figure 6: Four Sets of Robust Portfolio Allocations, by Insurer

References

Beketov, Mikhail, Kevin Lehmann, and Manuel Wittke. 2018. “Robo Advisors: Quantitative Methods Inside the Robots.” Journal of Asset Management 19 (6): 363–70.

Best, Michael J, and Robert R Grauer. 1991. “On the Sensitivity of Mean-Variance-Efficient Portfolios to Changes in Asset Means: Some Analytical and Computational Results.” The Review of Financial Studies 4 (2): 315–42.

Boyd, Stephen P, and Lieven Vandenberghe. 2004. Convex Optimization. Cambridge University Press.

Chopra, Vijay K, and William T Ziemba. 1993. “The Effect of Errors in Means, Variances, and Covariances on Optimal Portfolio Choice.” Journal of Portfolio Management; 19 (2): 6–11.

De Prado, Marcos Lopez. 2016. “Building Diversified Portfolios That Outperform Out of Sample.” The Journal of Portfolio Management 42 (4): 59–69.

He, Guangliang, and Robert Litterman. 2002. “The Intuition Behind Black-Litterman Model Portfolios.” SSRN. https://ssrn.com/abstract=334304.

Markowitz, Harry. 1952. “The Utility of Wealth.” Journal of Political Economy 60 (2): 151–58.

Yin, Chenyang, Romain Perchet, and François Soupé. 2021. “A Practical Guide to Robust Portfolio Optimization.” Quantitative Finance 21 (6): 911–28.