Quantitative Strategic Asset Allocation, Easy for Everyone.
Riskfolio-Lib is a library for making quantitative strategic asset allocation or portfolio optimization in Python made in Peru 🇵🇪. Its objective is to help students, academics and practitioners to build investment portfolios based on mathematically complex models with low effort. It is built on top of cvxpy and closely integrated with pandas data structures.
Some of key functionalities that Riskfolio-Lib offers:
Mean Risk and Logarithmic Mean Risk (Kelly Criterion) Portfolio Optimization with 4 objective functions:
Mean Risk and Logarithmic Mean Risk (Kelly Criterion) Portfolio Optimization with 13 convex risk measures:
Vanilla Risk Parity Portfolio Optimization with 10 convex risk measures:
Hierarchical Clustering Portfolio Optimization: Hierarchical Risk Parity (HRP) and Hierarchical Equal Risk Contribution (HERC) with 22 risk measures:
Worst Case Mean Variance Portfolio Optimization.
Portfolio optimization with Black Litterman model.
Portfolio optimization with Risk Factors model.
Portfolio optimization with Black Litterman Bayesian model.
Portfolio optimization with Augmented Black Litterman model.
Portfolio optimization with constraints on tracking error and turnover.
Portfolio optimization with short positions and leveraged portfolios.
Portfolio optimization with constraints on number of assets and number of effective assets.
Tools to build efficient frontier for 13 risk measures.
Tools to build linear constraints on assets, asset classes and risk factors.
Tools to build views on assets and asset classes.
Tools to build views on risk factors.
Tools to calculate risk measures.
Tools to calculate risk contributions per asset.
Tools to calculate uncertainty sets for mean vector and covariance matrix.
Tools to calculate assets clusters based on codependence metrics.
Tools to estimate loadings matrix (Stepwise Regression and Principal Components Regression).
Tools to visualizing portfolio properties and risk measures.
Tools to build reports on Jupyter Notebook and Excel.
Option to use commercial optimization solver like MOSEK or GUROBI for large scale problems.
Online documentation is available at Documentation.
The docs include a tutorial with examples that shows the capacities of Riskfolio-Lib.
Riskfolio-Lib supports Python 3.7+.
The latest stable release (and older versions) can be installed from PyPI:
pip install riskfolio-lib
Riskfolio-Lib development takes place on Github: https://github.com/dcajasn/Riskfolio-Lib
The plan for this module is to add more functions that will be very useful to asset managers.