Skip to main content

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.

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.
  • 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:

RiskOptima GitHub

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

riskoptima-1.7.0.tar.gz (20.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

riskoptima-1.7.0-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

Details for the file riskoptima-1.7.0.tar.gz.

File metadata

  • Download URL: riskoptima-1.7.0.tar.gz
  • Upload date:
  • Size: 20.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.12.7 Windows/10

File hashes

Hashes for riskoptima-1.7.0.tar.gz
Algorithm Hash digest
SHA256 dfc6285989a329da5899fbb75c7a799026c28bfdbab5b96211e0c1ac9a3dc728
MD5 c28187e5bae23f212cd657e541ff707f
BLAKE2b-256 305a360d7da3f513748015d2b06cee02b5581987f42ad2906fe9d6b2298259e2

See more details on using hashes here.

File details

Details for the file riskoptima-1.7.0-py3-none-any.whl.

File metadata

  • Download URL: riskoptima-1.7.0-py3-none-any.whl
  • Upload date:
  • Size: 19.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.12.7 Windows/10

File hashes

Hashes for riskoptima-1.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 877ea1176db7b7389126f051afd90222947aff6994903aa52af6e843e4b9fe00
MD5 9b920fd7ba774c530e6495bbae9eac3f
BLAKE2b-256 f9ac63e5493e36156addb0fac0e9dc25cf9973ce824b9f80ef1b1a5aec44f378

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page