Skip to content
All library documents

Normalizing Plug-In Mean-Variance Weights and Adding Risk Aversion

Article Quant Q&A · Author: user3742038

Summary

The document describes a plug-in mean-variance portfolio calculation from estimated asset means and a sample covariance matrix. It forms a direction of exposure by multiplying the inverse covariance matrix by the mean-return vector, then scales that vector into portfolio weights. The accepted response identifies a normalization issue: dividing by the absolute value of the weight sum can produce weights totaling negative one, so normalization by the signed sum is suggested to make weights add to one.

For a risk-aversion parameter, the response says the portfolio should be obtained from the minimum-variance optimization setup and suggests dividing the resulting vector by the parameter. This is a brief correction rather than a full derivation. It does not discuss constraints such as short-sale limits, estimation error, transaction costs, or what to do when the weight sum is zero, so the prescription should be understood within the simplified unconstrained formulation.

Key ideas

  • The plug-in approach combines estimated expected returns with the inverse sample covariance matrix.
  • Portfolio weights need normalization by their signed sum to target a total weight of one.
  • The absolute value of the sum can produce weights totaling negative one.
  • Risk aversion scales the solution in the stated minimum-variance formulation.
  • The discussion omits practical constraints and estimation uncertainty.

Tags

Full text
# Calculate mean variance portfolio


# Calculate mean variance portfolio












I am trying to calculate the mean variance portfolio using the plug-in approach.

First I generate some artificial data:

```
x <- replicate(10,rnorm(1000))
```

Then I apply the plug-in principle:

```
#count number of columns in the datasets
N <- ncol(x)

#create vector of ones
In <- rep(1,N)

#calculate covariance
covariance <- cov(x)

#calculate mean returns
mu <- colMeans(x)
mu <- t(t(mu))

#use the plug-in principle

xt <- solve(covariance) %*% mu
mean.var <- as.vector(xt) / abs(In %*% xt)
```

I would like to know:

- Is this the correct way to implement the mean variance strategy?

- How can I incorporate a risk-aversion parameter in this framework?

## Answer by Stefan Voigt (score 3, accepted)

https://quant.stackexchange.com/a/22764

There is one minor mistake: If you compute sum(mean.var) you'll obtain $-1$ instead of $1$. So it should be

```
 mean.var<-xt/sum(xt)
```

in order to ensure that the weights sum up to one. The remainder is correct. Incorporating a risk aversion parameter into the framework requires the solution to the minVar problem (See for example here). Therefore, dividing your result with the risk aversion parameter $\gamma$ is sufficient to solve your problem.

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.