Metadata-Version: 2.1
Name: riskoptima
Version: 1.12.0
Summary: 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
Home-page: https://github.com/JordiCorbilla/RiskOptima
License: MIT
Keywords: portfolio,risk,optimization,VaR,backtesting,monte-carlo,machine-learning,random-forest,linear-regression,gradient-boosting,mean-variance,black-litterman
Author: Jordi Corbilla
Author-email: jordi.coll.corbilla@gmail.com
Requires-Python: >=3.11
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: matplotlib (>=3.8.4)
Requires-Dist: numpy (>=1.26.4)
Requires-Dist: pandas (>=2.1.4)
Requires-Dist: scikit-learn (>=1.5.1)
Requires-Dist: scipy (>=1.13.1)
Requires-Dist: seaborn (>=0.13.2)
Requires-Dist: squarify (>=0.4.4)
Requires-Dist: statsmodels (>=0.14.2)
Requires-Dist: xgboost (>=2.1.3)
Requires-Dist: yfinance (>=0.2.51)
Project-URL: Repository, https://github.com/JordiCorbilla/RiskOptima
Description-Content-Type: text/markdown

# RiskOptima

![image](https://github.com/user-attachments/assets/b9bc3bd0-d8fa-4f01-97e6-44bf4b886bcb)


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
```python
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
```python
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](https://github.com/JordiCorbilla/RiskOptima)

## 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.


