Fast design of risk parity portfolios for financial investment.
The goal of the risk parity portfolio formulation is to equalize or distribute
the risk contributions of the different assets, which is missing if we simply
consider the overall volatility of the portfolio as in the mean-variance
Markowitz portfolio. In addition to the vanilla formulation, where the risk
contributions are perfectly equalized subject to no shortselling and budget
constraints, many other formulations are considered that allow for box
constraints and shortselling, as well as the inclusion of additional
objectives like the expected return and overall variance. See vignette for
a detailed documentation and comparison, with several illustrative examples.
The package is based on the papers:
Y. Feng, and D. P. Palomar (2015). SCRIP: Successive Convex Optimization Methods
for Risk Parity Portfolio Design. IEEE Trans. on Signal Processing, vol. 63,
no. 19, pp. 5285-5300.
The package riskParityPortfolio
provides tools to design risk parity
portfolios. In its simplest form, we consider the convex formulation
with a unique solution proposed by Spinu
(2013) and use a cyclical
method inspired by Griveau-Billion
(2013). For more general
formulations, which are usually nonconvex, we implement the successive
convex approximation method proposed by Feng & Palomar
(2015).
The latest stable version of riskParityPortfolio
is available at
https://CRAN.R-project.org/package=riskParityPortfolio.
The latest development version of riskParityPortfolio
is available at
https://github.com/dppalomar/riskParityPortfolio.
To install the latest stable version of riskParityPortfolio
, run the
following commands in R:
install.packages("riskParityPortfolio")
To install the development version of riskParityPortfolio
, run the
following commands in R:
install.packages("devtools")devtools::install_github("dppalomar/riskParityPortfolio")
To get help:
library(riskParityPortfolio)help(package = "riskParityPortfolio")package?riskParityPortfolio?riskParityPortfolio
Please cite riskParityPortfolio
in publications:
citation("riskParityPortfolio")
You can also get riskParityPortfolio
from Docker as follows:
docker pull mirca/riskparityportfolio
On MS Windows environments, make sure to install the most recent version
of Rtools
.
riskParityPortfolio
library(riskParityPortfolio)set.seed(42)# create covariance matrixN <- 5V <- matrix(rnorm(N^2), ncol = N)Sigma <- cov(V)# risk parity portfoliores <- riskParityPortfolio(Sigma)names(res)#> [1] "w" "risk_contribution"res$w#> [1] 0.32715962 0.27110678 0.14480081 0.09766356 0.15926922res$risk_contribution#> [1] 0.03857039 0.03857039 0.03857039 0.03857039 0.03857039c(res$w * (Sigma %*% res$w))#> [1] 0.03857039 0.03857039 0.03857039 0.03857039 0.03857039# risk budggeting portfoliores <- riskParityPortfolio(Sigma, b = c(0.4, 0.4, 0.1, 0.05, 0.05))res$risk_contribution/sum(res$risk_contribution)#> [1] 0.40 0.40 0.10 0.05 0.05
For more detailed information, please check the CRAN vignette, GitHub vignette, or the package webpage.
If you find this package useful in your research, please consider citing the following works:
README file: CRAN-readme and GitHub-readme.
Vignette: CRAN-html-vignette, CRAN-pdf-vignette, GitHub-html-vignette, and GitHub-pdf-vignette.