The RiskOptima toolkit is a comprehensive Python solution designed to assist investors in evaluating, managing, and optimizing the risk of their investment portfolios. This package implements advanced financial metrics and models to compute key risk indicators, including Value at Risk (VaR), Conditional Value at Risk (CVaR), and volatility assessment
Project description
RiskOptima
RiskOptima is a comprehensive Python toolkit for evaluating, managing, and optimizing investment portfolios. This package is designed to empower investors and data scientists by combining financial risk analysis, backtesting, mean-variance optimization, and machine learning capabilities into a single, cohesive package.
Stats
https://pypistats.org/packages/riskoptima
Key Features
- Portfolio Optimization: Includes mean-variance optimization, efficient frontier calculation, and maximum Sharpe ratio portfolio construction.
- Risk Management: Compute key financial risk metrics such as Value at Risk (VaR), Conditional Value at Risk (CVaR), volatility, and drawdowns.
- Backtesting Framework: Simulate historical performance of investment strategies and analyze portfolio dynamics over time.
- Machine Learning Integration: Future-ready for implementing machine learning models for predictive analytics and advanced portfolio insights.
- Monte Carlo Simulations: Perform extensive simulations to analyze potential portfolio outcomes. See example here https://github.com/JordiCorbilla/efficient-frontier-monte-carlo-portfolio-optimization
- Comprehensive Financial Metrics: Calculate returns, Sharpe ratios, covariance matrices, and more.
Installation
See the project here: https://pypi.org/project/riskoptima/
pip install riskoptima
Usage
Example 1: Efficient Frontier
from riskoptima import RiskOptima
import pandas as pd
# Download market data
data = RiskOptima.download_data_yfinance(['AAPL', 'MSFT', 'GOOG'], '2022-01-01', '2022-12-31')
daily_returns, cov_matrix = RiskOptima.calculate_statistics(data)
# Calculate Efficient Frontier
mean_returns = daily_returns.mean()
vols, rets, weights = RiskOptima.efficient_frontier(mean_returns, cov_matrix)
# Plot Efficient Frontier
RiskOptima.plot_ef_ax(50, mean_returns, cov_matrix)
Example 2: Monte Carlo Simulation
simulated_portfolios, weights_record = RiskOptima.run_monte_carlo_simulation(daily_returns, cov_matrix)
Example 3: Macaulay Duration
Navigate to -> https://github.com/JordiCorbilla/portfolio_risk_kit/blob/main/portfolio_risk_kit.ipynb
Documentation
For complete documentation and usage examples, visit the GitHub repository:
Contributing
We welcome contributions! If you'd like to improve the package or report issues, please visit the GitHub repository.
License
RiskOptima is licensed under the MIT License.
Support me
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file riskoptima-1.15.0.tar.gz.
File metadata
- Download URL: riskoptima-1.15.0.tar.gz
- Upload date:
- Size: 31.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.12.7 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40735e52f65e7ea72d9395d0dec3d66046a4599e31ac7e586051e95eeeef96b6
|
|
| MD5 |
115997ecf2273079f1b5088ef3af8bc2
|
|
| BLAKE2b-256 |
01af3cfcba29e9a8a7f8cfb1a01f27091ebb3dcc58fddb15d370e2f829f08f63
|
File details
Details for the file riskoptima-1.15.0-py3-none-any.whl.
File metadata
- Download URL: riskoptima-1.15.0-py3-none-any.whl
- Upload date:
- Size: 31.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.12.7 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b63500c72566ec0a98e27a20d147c3acc0850cf83337f0bb51f7102546fc3de5
|
|
| MD5 |
f3c6a84057d6479d3f2fc44dedbb4491
|
|
| BLAKE2b-256 |
53001efa610db7c61222ca254b8983df141ad79a61567b607cecca26442a4e59
|