Design of Risk Parity Portfolios

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. . F. Spinu (2013), An Algorithm for Computing Risk Parity Weights. . T. Griveau-Billion, J. Richard, and T. Roncalli (2013). A fast algorithm for computing High-dimensional risk parity portfolios. .


CRAN_Status_Badge CRANDownloads CRAN DownloadsTotal

codecov Travis-CI-Badge Buildstatus CircleCI Docker BuildStatus

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.

Installation

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.

Usage of riskParityPortfolio

library(riskParityPortfolio)
 
set.seed(42)
# create covariance matrix
N <- 5
V <- matrix(rnorm(N^2), ncol = N)
Sigma <- cov(V)
 
# risk parity portfolio
res <- riskParityPortfolio(Sigma)
names(res)
#> [1] "w"                 "risk_contribution"
res$w
#> [1] 0.32715962 0.27110678 0.14480081 0.09766356 0.15926922
res$risk_contribution
#> [1] 0.03857039 0.03857039 0.03857039 0.03857039 0.03857039
c(res$w * (Sigma %*% res$w))
#> [1] 0.03857039 0.03857039 0.03857039 0.03857039 0.03857039
 
# risk budggeting portfolio
res <- 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

Documentation

For more detailed information, please check the CRAN vignette, GitHub vignette, or the package webpage.

Citation

If you find this package useful in your research, please consider citing the following works:

Links

Package: CRAN and GitHub.

README file: CRAN-readme and GitHub-readme.

Vignette: CRAN-html-vignette, CRAN-pdf-vignette, GitHub-html-vignette, and GitHub-pdf-vignette.

News

Changes in riskParityPortfolio version 0.1.1 (2019-01-07)

  • Revised vignette (fix name issue and include new section on algorithm description).
  • Revise the error control of riskParityPortfolio().
  • Check feasibility in riskParityPortfolio().
  • Improved tests.

Changes in riskParityPortfolio version 0.1.0 (2018-12-15)

  • Initial release is on CRAN.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.