riskoptima 1.10.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Jordi Corbilla
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,95 @@
1
+ Metadata-Version: 2.1
2
+ Name: riskoptima
3
+ Version: 1.10.0
4
+ 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
5
+ Home-page: https://github.com/JordiCorbilla/RiskOptima
6
+ License: MIT
7
+ Keywords: portfolio,risk,optimization,VaR,backtesting,monte-carlo,machine-learning,random-forest,linear-regression,gradient-boosting,mean-variance,black-litterman
8
+ Author: Jordi Corbilla
9
+ Author-email: jordi.coll.corbilla@gmail.com
10
+ Requires-Python: >=3.12
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Requires-Dist: matplotlib (>=3.8.4)
16
+ Requires-Dist: numpy (>=1.26.4)
17
+ Requires-Dist: pandas (>=2.1.4)
18
+ Requires-Dist: scikit-learn (>=1.5.1)
19
+ Requires-Dist: scipy (>=1.13.1)
20
+ Requires-Dist: seaborn (>=0.13.2)
21
+ Requires-Dist: statsmodels (>=0.14.2)
22
+ Requires-Dist: xgboost (>=2.1.3)
23
+ Requires-Dist: yfinance (>=0.2.51)
24
+ Project-URL: Repository, https://github.com/JordiCorbilla/RiskOptima
25
+ Description-Content-Type: text/markdown
26
+
27
+ # RiskOptima
28
+
29
+ ![image](https://github.com/user-attachments/assets/b9bc3bd0-d8fa-4f01-97e6-44bf4b886bcb)
30
+
31
+
32
+ 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.
33
+
34
+ ## Stats
35
+ https://pypistats.org/packages/riskoptima
36
+
37
+ ## Key Features
38
+
39
+ - Portfolio Optimization: Includes mean-variance optimization, efficient frontier calculation, and maximum Sharpe ratio portfolio construction.
40
+ - Risk Management: Compute key financial risk metrics such as Value at Risk (VaR), Conditional Value at Risk (CVaR), volatility, and drawdowns.
41
+ - Backtesting Framework: Simulate historical performance of investment strategies and analyze portfolio dynamics over time.
42
+ - Machine Learning Integration: Future-ready for implementing machine learning models for predictive analytics and advanced portfolio insights.
43
+ - Monte Carlo Simulations: Perform extensive simulations to analyze potential portfolio outcomes. See example here https://github.com/JordiCorbilla/efficient-frontier-monte-carlo-portfolio-optimization
44
+ - Comprehensive Financial Metrics: Calculate returns, Sharpe ratios, covariance matrices, and more.
45
+
46
+ ## Installation
47
+
48
+ See the project here: https://pypi.org/project/riskoptima/
49
+
50
+ ```
51
+ pip install riskoptima
52
+ ```
53
+ ## Usage
54
+
55
+ Example 1: Efficient Frontier
56
+ ```python
57
+ from riskoptima import RiskOptima
58
+ import pandas as pd
59
+
60
+ # Download market data
61
+ data = RiskOptima.download_data_yfinance(['AAPL', 'MSFT', 'GOOG'], '2022-01-01', '2022-12-31')
62
+ daily_returns, cov_matrix = RiskOptima.calculate_statistics(data)
63
+
64
+ # Calculate Efficient Frontier
65
+ mean_returns = daily_returns.mean()
66
+ vols, rets, weights = RiskOptima.efficient_frontier(mean_returns, cov_matrix)
67
+
68
+ # Plot Efficient Frontier
69
+ RiskOptima.plot_ef_ax(50, mean_returns, cov_matrix)
70
+ ```
71
+ Example 2: Monte Carlo Simulation
72
+ ```python
73
+ simulated_portfolios, weights_record = RiskOptima.run_monte_carlo_simulation(daily_returns, cov_matrix)
74
+ ```
75
+
76
+ Example 3: Macaulay Duration
77
+ ```
78
+ Navigate to -> https://github.com/JordiCorbilla/portfolio_risk_kit/blob/main/portfolio_risk_kit.ipynb
79
+ ```
80
+
81
+ ## Documentation
82
+
83
+ For complete documentation and usage examples, visit the GitHub repository:
84
+
85
+ [RiskOptima GitHub](https://github.com/JordiCorbilla/RiskOptima)
86
+
87
+ ## Contributing
88
+
89
+ We welcome contributions! If you'd like to improve the package or report issues, please visit the GitHub repository.
90
+
91
+ ## License
92
+
93
+ RiskOptima is licensed under the MIT License.
94
+
95
+
@@ -0,0 +1,68 @@
1
+ # RiskOptima
2
+
3
+ ![image](https://github.com/user-attachments/assets/b9bc3bd0-d8fa-4f01-97e6-44bf4b886bcb)
4
+
5
+
6
+ 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.
7
+
8
+ ## Stats
9
+ https://pypistats.org/packages/riskoptima
10
+
11
+ ## Key Features
12
+
13
+ - Portfolio Optimization: Includes mean-variance optimization, efficient frontier calculation, and maximum Sharpe ratio portfolio construction.
14
+ - Risk Management: Compute key financial risk metrics such as Value at Risk (VaR), Conditional Value at Risk (CVaR), volatility, and drawdowns.
15
+ - Backtesting Framework: Simulate historical performance of investment strategies and analyze portfolio dynamics over time.
16
+ - Machine Learning Integration: Future-ready for implementing machine learning models for predictive analytics and advanced portfolio insights.
17
+ - Monte Carlo Simulations: Perform extensive simulations to analyze potential portfolio outcomes. See example here https://github.com/JordiCorbilla/efficient-frontier-monte-carlo-portfolio-optimization
18
+ - Comprehensive Financial Metrics: Calculate returns, Sharpe ratios, covariance matrices, and more.
19
+
20
+ ## Installation
21
+
22
+ See the project here: https://pypi.org/project/riskoptima/
23
+
24
+ ```
25
+ pip install riskoptima
26
+ ```
27
+ ## Usage
28
+
29
+ Example 1: Efficient Frontier
30
+ ```python
31
+ from riskoptima import RiskOptima
32
+ import pandas as pd
33
+
34
+ # Download market data
35
+ data = RiskOptima.download_data_yfinance(['AAPL', 'MSFT', 'GOOG'], '2022-01-01', '2022-12-31')
36
+ daily_returns, cov_matrix = RiskOptima.calculate_statistics(data)
37
+
38
+ # Calculate Efficient Frontier
39
+ mean_returns = daily_returns.mean()
40
+ vols, rets, weights = RiskOptima.efficient_frontier(mean_returns, cov_matrix)
41
+
42
+ # Plot Efficient Frontier
43
+ RiskOptima.plot_ef_ax(50, mean_returns, cov_matrix)
44
+ ```
45
+ Example 2: Monte Carlo Simulation
46
+ ```python
47
+ simulated_portfolios, weights_record = RiskOptima.run_monte_carlo_simulation(daily_returns, cov_matrix)
48
+ ```
49
+
50
+ Example 3: Macaulay Duration
51
+ ```
52
+ Navigate to -> https://github.com/JordiCorbilla/portfolio_risk_kit/blob/main/portfolio_risk_kit.ipynb
53
+ ```
54
+
55
+ ## Documentation
56
+
57
+ For complete documentation and usage examples, visit the GitHub repository:
58
+
59
+ [RiskOptima GitHub](https://github.com/JordiCorbilla/RiskOptima)
60
+
61
+ ## Contributing
62
+
63
+ We welcome contributions! If you'd like to improve the package or report issues, please visit the GitHub repository.
64
+
65
+ ## License
66
+
67
+ RiskOptima is licensed under the MIT License.
68
+
@@ -0,0 +1,29 @@
1
+ [tool.poetry]
2
+ name = "riskoptima"
3
+ version = "1.10.0"
4
+ description = "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"
5
+ authors = ["Jordi Corbilla <jordi.coll.corbilla@gmail.com>"]
6
+ license = "MIT"
7
+ readme = "README.md"
8
+ homepage = "https://github.com/JordiCorbilla/RiskOptima"
9
+ repository = "https://github.com/JordiCorbilla/RiskOptima"
10
+ keywords = ["portfolio", "risk", "optimization", "VaR", "backtesting", "monte-carlo", "machine-learning", "random-forest", "linear-regression", "gradient-boosting", "mean-variance", "black-litterman"]
11
+
12
+ [tool.poetry.dependencies]
13
+ python = ">=3.12"
14
+ numpy = ">=1.26.4"
15
+ pandas = ">=2.1.4"
16
+ scipy = ">=1.13.1"
17
+ statsmodels = ">=0.14.2"
18
+ yfinance = ">=0.2.51"
19
+ matplotlib = ">=3.8.4"
20
+ scikit-learn = ">=1.5.1"
21
+ xgboost = ">=2.1.3"
22
+ seaborn = ">=0.13.2"
23
+
24
+ [build-system]
25
+ requires = ["poetry-core"]
26
+ build-backend = "poetry.core.masonry.api"
27
+
28
+
29
+
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+ #----------------------------------------------------------------------------
4
+ # Created By : Jordi Corbilla
5
+ # Created Date: 2025
6
+ # version ='1.10.0'
7
+ # ---------------------------------------------------------------------------
8
+
9
+ from .riskoptima import RiskOptima