Skip to content

Commit 86875f6

Browse files
Merge pull request #1 from antonvorobets/main
v0.1
2 parents d7bb75d + bb27919 commit 86875f6

File tree

6 files changed

+3314
-16
lines changed

6 files changed

+3314
-16
lines changed

CVaROptBenchmarks.ipynb renamed to 1_CVaROptBenchmarks.ipynb

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
"\n",
1414
"The problems become increasingly hard, ranging from CVaR efficient frontier optimization of long-only cash portfolios without transaction costs to CVaR optimization of derivatives portfolios with transaction costs, absolute leverage constraints, and risk budgets.\n",
1515
"\n",
16-
"Finally, we add non-uniform scenario probabilities to all these problems through a Sequential Entropy Pooling CVaR stress-test (see Chapter 5 in the Portfolio Construction and Risk Management book: https://antonvorobets.substack.com/p/pcrm-book).\n",
16+
"Finally, we add non-uniform scenario probabilities to all these problems through a Sequential Entropy Pooling CVaR stress-test, see Chapter 5 in the Portfolio Construction and Risk Management book: https://antonvorobets.substack.com/p/pcrm-book\n",
1717
"\n",
18-
"In total, there are 24 CVaR optimization problems that are optimized with 100 different expected return vectors. Note that for portfolios that contain derivatives Entropy Pooling is applied to compute consistent derivatives expected returns as described in: https://ssrn.com/abstract=4825945 \n",
18+
"In total, there are 24 CVaR optimization problems that are optimized with 100 different expected return vectors. Note that for portfolios that contain derivatives, Entropy Pooling is applied to compute consistent derivatives expected returns as described in: https://ssrn.com/abstract=4825945 \n",
1919
"\n",
2020
"You can use the results to see which CVaR optimization problems are possible to solve and in what time. You can potentially compare the speed and stability to your own CVaR optimization implementations.\n",
2121
"\n",
22-
"If you can solve all problems using a Python API significantly faster than in this Notebook, and your implementation is not publicly available, please contant us at [email protected]. We might be willing to buy your implementation.\n",
22+
"If you can solve all problems using a Python API significantly faster than in this notebook, and your implementation is not publicly available, please contant us at [email protected]. We might be willing to buy your implementation.\n",
2323
"\n",
2424
"The CVaR optimization problems below have been solved using the following CPU: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz (2.30 GHz)"
2525
]
@@ -1077,7 +1077,7 @@
10771077
},
10781078
{
10791079
"cell_type": "code",
1080-
"execution_count": 10,
1080+
"execution_count": null,
10811081
"id": "e48928d3",
10821082
"metadata": {},
10831083
"outputs": [],
@@ -1093,8 +1093,6 @@
10931093
"\n",
10941094
"# Constraints cash-only portfolio with transaction costs\n",
10951095
"pf_cash = ia.Portfolio(current_portfolio_cash, benchmark_cash)\n",
1096-
"bounds_lower_cash = np.zeros(I_cash)\n",
1097-
"bounds_upper_cash = np.ones(I_cash)\n",
10981096
"pf_cash.set_individual_bounds(bounds_lower_cash, bounds_upper_cash)\n",
10991097
"\n",
11001098
"# Constraints derivatives portfolios without transaction costs\n",
@@ -1108,10 +1106,6 @@
11081106
"\n",
11091107
"# Constraints derivatives portfolios with transaction costs\n",
11101108
"pf = ia.Portfolio(current_portfolio, benchmark)\n",
1111-
"bounds_lower = np.zeros(I)\n",
1112-
"bounds_lower[-6:] = -0.5 # Derivatives shorting bounds\n",
1113-
"bounds_upper = np.ones(I)\n",
1114-
"bounds_upper[-6:] = 0.5 # Derivatives upper bounds\n",
11151109
"pf.set_individual_bounds(bounds_lower, bounds_upper)\n",
11161110
"pf.set_gross_exposure_max(2) # Total derivatives leverage at most 2x"
11171111
]

OptimizationExample.ipynb renamed to 2_OptimizationExample.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"\n",
1111
"These problems are the easiest to solve, so they are a good starting point for understanding the data. After becoming comfortable with these problems, you can proceed to the more challenging ones that include derivatives, leverage constraints, transaction costs and risk budgets.\n",
1212
"\n",
13-
"To see how the results have been computed using Fortitudo Technologies' Investment Analysis module, see the CVaROptBenchmarks.ipynb file: https://github.com/fortitudo-tech/cvar-optimization-benchmarks/blob/main/CVaROptBenchmarks.ipynb "
13+
"To see how the results have been computed using Fortitudo Technologies' Investment Analysis module, see the 1_CVaROptBenchmarks notebook: https://github.com/fortitudo-tech/cvar-optimization-benchmarks/blob/main/1_CVaROptBenchmarks.ipynb "
1414
]
1515
},
1616
{

README.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,30 @@
11
# CVaR optimization benchmark problems
2-
This repository contains Conditional Value-at-Risk (CVaR) portfolio optimization benchmark problems for fully general Monte Carlo distributions and derivatives portfolios.
2+
This repository contains Conditional Value-at-Risk (CVaR) portfolio optimization benchmark
3+
problems for fully general Monte Carlo distributions and derivatives portfolios.
34

4-
The starting point is the [next-generation investment framework's market representation](https://youtu.be/4ESigySdGf8?si=yWYuP9te1K1RBU7j&t=46) given by the matrix $R\in \mathbb{R}^{S\times I}$ and associated joint scenario probability vectors $p,q\in \mathbb{R}^{S}$.
5+
The starting point is the [next-generation investment framework's market representation](https://youtu.be/4ESigySdGf8?si=yWYuP9te1K1RBU7j&t=46)
6+
given by the matrix $R\in \mathbb{R}^{S\times I}$ and associated joint scenario probability
7+
vectors $p,q\in \mathbb{R}^{S}$.
58

6-
The [CVaROptBenchmarks notebook](https://github.com/fortitudo-tech/cvar-optimization-benchmarks/blob/main/CVaROptBenchmarks.ipynb) illustrates how the benchmark problems can be solved using Fortitudo Technologies' Investment Analysis module.
9+
The [1_CVaROptBenchmarks notebook](https://github.com/fortitudo-tech/cvar-optimization-benchmarks/blob/main/1_CVaROptBenchmarks.ipynb)
10+
illustrates how the benchmark problems can be solved using Fortitudo Technologies' Investment
11+
Analysis module.
712

8-
The [OptimizationExample notebook](https://github.com/fortitudo-tech/cvar-optimization-benchmarks/blob/main/OptimizationExample.ipynb) shows how you can replicate the results using the [fortitudo.tech open-source Python package](https://github.com/fortitudo-tech/fortitudo.tech) for the efficient frontier optimizations of long-only cash portfolios, which are the easiest problems to solve.
13+
The [2_OptimizationExample notebook](https://github.com/fortitudo-tech/cvar-optimization-benchmarks/blob/main/2_OptimizationExample.ipynb)
14+
shows how you can replicate the results using the [fortitudo.tech open-source Python package](https://github.com/fortitudo-tech/fortitudo.tech)
15+
for the efficient frontier optimizations of long-only cash portfolios, which are the easiest problems to solve.
916

10-
You can read much more about the next-generation investment framework in the [Portfolio Construction and Risk Management book](https://antonvorobets.substack.com/p/pcrm-book).
17+
## Installation Instructions
18+
It is recommended to install the code dependencies in a
19+
[conda environment](https://conda.io/projects/conda/en/latest/user-guide/concepts/environments.html):
20+
21+
conda create -n cvar-optimization-benchmarks python
22+
pip install cvar-optimization-benchmarks
23+
24+
After this, you should be able to run the code in the [2_OptimizationExample notebook](https://github.com/fortitudo-tech/cvar-optimization-benchmarks/blob/main/2_OptimizationExample.ipynb).
25+
26+
## Portfolio Construction and Risk Management book
27+
You can read much more about the [next-generation investment framework](https://antonvorobets.substack.com/p/anton-vorobets-next-generation-investment-framework)
28+
in the [Portfolio Construction and Risk Management book](https://antonvorobets.substack.com/p/pcrm-book),
29+
including a thorough description of CVaR optimization problems and
30+
[Resampled Portfolio Stacking](https://antonvorobets.substack.com/p/resampled-portfolio-stacking).

0 commit comments

Comments
 (0)