The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.
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.
Check out the documentation here: https://mirca.github.io/riskParityPortfolio.
To install the latest stable version of riskParityPortfolio from CRAN, run the following commands in R:
> install.packages("riskParityPortfolio")
To install the development version of riskParityPortfolio from GitHub, 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.
A Python3 implementation of this package is currently under development at https://github.com/dppalomar/riskparity.py. Its stable version is available in PYPI and can be installed as follows:
$ pip install riskparityportfolio
Alternatively, the development version can be installed as
$ git clone https://github.com/dppalomar/riskparity.py
$ cd python
$ pip install -e .
library(riskParityPortfolio)
set.seed(42)
# create covariance matrix
<- 5
N <- matrix(rnorm(N^2), ncol = N)
V <- cov(V)
Sigma
# risk parity portfolio
<- riskParityPortfolio(Sigma)
res names(res)
#> [1] "w" "relative_risk_contribution"
#> [3] "is_feasible"
$w
res#> [1] 0.32715962 0.27110678 0.14480081 0.09766356 0.15926922
# risk budgeting portfolio
<- riskParityPortfolio(Sigma, b = c(0.4, 0.4, 0.1, 0.05, 0.05))
res $relative_risk_contribution
res#> [1] 0.40 0.40 0.10 0.05 0.05
For more detailed information, please check the vignette.
If you find this package useful in your research, please consider citing the following works:
We welcome all sorts of contributions. Please feel free to open an issue to report a bug or discuss a feature request.
README file: GitHub-readme.
Vignettes: CRAN-vignette, slides R/Finance 2019, slides RPP - Convex Optimization Course (HKUST), slides HKML meetup 2020, and tutorial - Data-driven Portfolio Optimization Course (HKUST)
The information, software, and any additional resources contained in this repository are not intended as, and shall not be understood or construed as, financial advice. Past performance is not a reliable indicator of future results and investors may not recover the full amount invested. The authors of this repository accept no liability whatsoever for any loss or damage you may incur. Any opinions expressed in this repository are from the personal research and experience of the authors and are intended as educational material.
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.