Gaussian VaR Optimization and Its Link to Minimum Variance
Summary
For normally distributed asset returns with known means and covariance, the document relates portfolio VaR optimization to familiar portfolio objectives. When VaR is defined as a return quantile centered on the portfolio mean, maximizing it is equivalent to minimizing variance. For a lower return quantile without centering, the objective instead combines expected return and portfolio volatility, with the quantile determining the volatility multiplier. The document cautions that unrestricted optimization of some quantiles, such as the median, can be unbounded when leverage is allowed.
A simulated example compares a minimum variance portfolio with a portfolio optimized against an empirical VaR statistic. Their weights and return distributions are close, but the sample optimizer finds a small difference in that particular draw. Thus, a known Gaussian data-generating process does not make a sample-based VaR optimum identical to the population optimum. The example uses a particular setup and algorithm, so it illustrates sampling effects rather than establishing general performance or an exact solution for every constraint set.
Key ideas
- For Gaussian returns, a centered return quantile depends on portfolio volatility, so maximizing it corresponds to minimizing variance.
- An uncentered lower quantile can be expressed as expected return minus a quantile-dependent multiple of portfolio volatility.
- The median objective may be unbounded when leverage is permitted and expected return is positive.
- A sample-based VaR optimum can differ slightly from the population minimum variance portfolio because of sampling variation.
Tags
Full text
# Analytical portfolio optimization for VaR under multivariate normality
# Analytical portfolio optimization for VaR under multivariate normality
Given a set of assets with returns following a multivariate normal distribution with a known mean vector and a known covariance matrix, $$ r \sim N(\mu,\Sigma), $$ I want to find optimal portfolio weights $w^*$ that maximize value at risk (VaR), subject to weights summing up to 1 and being nonnegative: $$ w^*:=\arg \max_{w} F^{-1}(q) \\ \text{subject to} \\ \quad w^{\top}e=1 \quad \text{and} \quad w>0 $$ where $F(\cdot)$ is the CDF of the porfolio return, $q$ is the quantile of interest, $e$ is a vector of ones and $>$ holds for each element of $w$. $F$ is a normal CDF with expectation $w^{\top}\mu$ and variance $w^{\top} \Sigma w$, the parameters being functions of $w$.
Does this problem have an analytical solution?
The elements of the mean vector are not necessarily equal; otherwise a solution is readily available and equals the well-known solution of minimization of portfolio variance.
Note: I do not care about the plausibility of multivariate normality for asset returns; I need this for testing and benchmarking a numerical optimization routine for VaR.
Edit: updated to include formulas and to restrict the question to the case of nonnegative weights (in the original question the latter restriction was optional).
## Answer by Enrico Schumann (score 1)
https://quant.stackexchange.com/a/50283
If you define VaR as a quantile of the portfolio's returns distribution about the mean of those returns, then the minimum-variance portfolio is what you look for: it minimises the volatility around the mean, whereever this mean is. When returns are jointly normal, maximising VaR as just defined does the same.
Regarding my second comment: numerical procedures for VaR typically directly maximise a given order statistic on a sample of portfolio returns. But then there is no guarantee that in the sample the optimal VaR-portfolio will be the same as the minimum-variance portfolio. Thus, for testing a numerical procedure, knowing the true distribution and generating data from it may not be enough. Example (using R):
I create 2000 scenarios for 10 assets; each may have a weight between 0 and 25%. The returns use ridiculously high mean returns, so that the distribution is shifted away from zero.
```
library("NMOF") ## https://github.com/enricoschumann/NMOF
library("neighbours") ## https://github.com/enricoschumann/neighbours
set.seed(32923)
## create random data
na <- 10 ## number of assets
ns <- 2000 ## number of scenarios
k <- ceiling(ns*0.1) ## order statistic to maximise
R <- randomReturns(na = na, ns = ns,
mean = runif(na, 200/100/255, 300/100/255),
sd = runif(na, 0.005, 0.02),
rho = 0.6)
## minimum-variance solution
x.qp <- minvar(cov(R), wmin = 0, wmax = 0.25)
```
The VaR optimisation. The algorithm I use minimises, so I put a minus in front of the VaR.
```
### 1) objective function
of_var <- function(x, R, k, ...)
-(sort(R %*% x, partial = k)[k] - sum(R %*% x)/nrow(R))
### 2) optimisation with Threshold Accepting
x.ta <- TAopt(
OF = of_var, ## SETTINGS
list(nI = 20000, ### number of iterations
neighbour = neighbourfun( ### neighbourhood function
min = 0,
max = 0.25,
stepsize = 1/100),
x0 = rep(1/na, na) ### initial solution: equal weights
),
R = R, k = k)$xbest
```
We can compare the resulting portfolios and their returns distributions: the portfolios are very similar.
```
## compare weights
data.frame(MV = round(100*x.qp, 2),
VaR = round(100*x.ta, 2))
## compare returns distributions under given sample
plot(ecdf(R %*% rep(1/na, na)),
main = "distribution of portfolio returns")
lines(ecdf(R %*% x.qp), col = "blue")
lines(ecdf(R %*% x.ta), col = "darkgreen")
```
Finally, I evaluate the VaR-objective function at the minimum-variance and at the minimum-VaR portfolio.
```
of_var(rep(1/na, na), R, k) ## equal weight
## [1] 0.01316127
of_var(x.qp, R, k) ## minimum variance
## [1] 0.008222392
of_var(x.ta, R, k) ## minimum VaR
## [1] 0.008178637
```
As you can see, Threshold Accepting found a portfolio that provides a tiny advantage over the minimum-variance portfolio in this particular sample. (This could probably be improved, but it only serves to make the point here.) Under the true distribution, both portfolios should be the same.
You may also define VaR as a quantile of the returns distribution, without the centering. You cannot generally maximise any quantile of the returns distribution. Just think of the median: if you can use leverage and the portfolio has a positive return, you can increase the median (which is the same as the mean under the Gaussian distribution) without bound. So you had better define VaR as a lower quantile. Maximising it is, in a Gaussian world, equivalent to maximising
$$\mu'x - \lambda \sqrt{x' \Sigma x}$$
in which $\lambda$ is an appropriate multiplier for the standard deviation, such as `1.645` for the 5% VaR:
```
> qnorm(0.05)
## [1] -1.644854
```
This model should not pose much difficulty to a numeric solver. (For the median, $\lambda$ would be zero.)Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.