### How to construct a Risk-Parity portfolio?

• If I would like to construct a fully invested long-only portfolio with two asset classes (Bonds $B$ and Stocks $S$) based on the concept of risk-parity.

The weights $W$ of my portfolio would then be the following:

Then the weight of the bonds: $$W_B = \textrm{Vol}(S)/[\textrm{Vol(S)}+\textrm{Vol(B)}]$$

and the weights of the stocks $$W_S = 1 - W_B$$

Based on this result, I am going to overweight the low-volatility asset and underweight the high-volatility asset.
My question is: how do I calculate the weights for a portfolio with multiple asset classes, 5 for example, so that each asset class will have the same volatility and contribute the same amount of risk into my portfolio. From historical data I can extract the volatility of each asset class and the correlation between them.

Can you show us what you tried and define some variables and equations? In its current form the question is off topic IMHO, see the FAQ.

You can offset some of the "diversification" (it's diversification only if the numbers hold during high stress periods) by raising the leverage on the low volatility assets.

@Bootvis: I don't think it's OT. But the formatting could certainly be improved. But the subject is non-trivial.

It certainly is an interesting topic but the question, as it is now, does not seem to be written by a professional quant. I would edit the question if I had the time.

9 years ago

Risk Parity is not about "having the same volatility", it is about having each asset contributing in the same way to the portfolio overall volatility.

The volatility of the portfolio is defined as:

$$\sigma(w)=\sqrt{w' \Sigma w}$$

The risk contribution of asset $i$ is computed as follows:

$$\sigma_i(w)= w_i \times \partial_{w_i} \sigma(w)$$

You can then show that:

$$\sigma(w)=\sum_{i=1}^n \sigma_i(w)$$

The vector of the marginal contributions ($\partial_{w_i} \sigma(w)$) is computed as follows:

$$c(w)= \frac{\Sigma w}{\sqrt{w' \Sigma w}}$$

You can then find the solution by running the following optimization:

$$\underset{w}{\arg \min} \sum_{i=1}^N [\frac{\sqrt{w^T \Sigma w}}{N} - w_i \cdot c(w)_i]^2$$ This article contains all the developments you require to understand how the formulas above are derived.

Can you explain what techniques are needed to run that optimization?

You can basically run this through fmincon in MATLAB for example. Not sure what you mean by "techniques". Are you looking for a specific optimization algorithm?

I meant what packages/routines to use if I were doing this in R?

@nxstock-trader: you should be able to find something on this page. I haven't used R for optimization for a long time. You can ask on [math.se] or [so] as well.

What is the reason that the risk contribution of each asset is defined as its weight times corresponding marginal contribution? It makes sense to me that marginal contribution describes how fast total risk changes if the asset's weight changes a small amount. But partial derivative times weight is not intuitive to me when it's used to describe risk contribution, though noting that the sum (and here it happens to be $\sigma(w)$) is directional derivative in mathematics. Any intuition behind this definition?

Also, does the optimization problem have any constraint like $\sum_{i=1}^{n} w_i = 1$?

@SRKX if OP merely wants risk parity/ERC, does it not suffice to simply do $b=1/n$ then $w = \sqrt(b) / \sqrt(diag(\Sigma))$ with $w$ then normalized to sum to 1? It looks like that is all the R package referenced below is doing in the first 6 lines of code: https://github.com/dppalomar/riskParityPortfolio/blob/master/R/riskParityPortfolio.R

Mr. Chan: that is a shortcut that works in case the covariance matrix is diagonal, it is not the general ERC which takes into account off-diagonal elements. Using this shortcut is sometimes called "naive risk parity" because you are not taking into account correlations only variances.