|
1 | | -<p align="center"> |
2 | | - <img width=60% src="https://github.com/PyPortfolio/PyPortfolioOpt/blob/main/media/logo_v1.png?raw=true"> |
3 | | -</p> |
| 1 | +## Welcome to PyPortfolioOpt |
4 | 2 |
|
5 | | -<!-- buttons --> |
6 | | -<p align="center"> |
7 | | - <a href="https://www.python.org"> |
8 | | - <img src="https://img.shields.io/pypi/pyversions/PyPortfolioOpt.svg" |
9 | | - alt="python"></a> |
10 | | - <a href="https://www.python.org"> |
11 | | - <img src="https://img.shields.io/badge/Platforms-linux--64,win--64,osx--64-orange.svg?style=flat-square" |
12 | | - alt="platforms"></a> |
13 | | - <a href="https://pypi.org/project/PyPortfolioOpt/"> |
14 | | - <img src="https://img.shields.io/badge/pypi-v1.5.6-brightgreen.svg" |
15 | | - alt="pypi"></a> |
16 | | - <a href="https://opensource.org/licenses/MIT"> |
17 | | - <img src="https://img.shields.io/badge/license-MIT-brightgreen.svg" |
18 | | - alt="MIT license"></a> |
19 | | - <a href="https://github.com/pyportfolio/pyportfolioopt/actions"> |
20 | | - <img src="https://github.com/pyportfolio/pyportfolioopt/actions/workflows/main.yml/badge.svg?branch=main" |
21 | | - alt="build"></a> |
22 | | - <a href="https://pepy.tech/project/pyportfolioopt"> |
23 | | - <img src="https://pepy.tech/badge/pyportfolioopt" |
24 | | - alt="downloads"></a> |
25 | | - <a href="https://mybinder.org/v2/gh/pyportfolio/pyportfolioopt/main/?filepath=cookbook"> |
26 | | - <img src="https://mybinder.org/badge_logo.svg" |
27 | | - alt="binder"></a> |
28 | | -</p> |
| 3 | +<a href="https://pyportfolioopt.readthedocs.io/en/latest/"><img src="https://github.com/PyPortfolio/PyPortfolioOpt/blob/main/media/logo_v1.png?raw=true" width="275" align="right" /></a> |
29 | 4 |
|
30 | | -<!-- content --> |
| 5 | +PyPortfolioOpt is a library implementing portfolio optimization methods, including |
| 6 | +classical mean-variance optimization, Black-Litterman allocation, or shrinkage and Hierarchical Risk Parity. |
| 7 | +PyPortfolioOpt is inspired by scikit-learn; it is **extensive** yet easily **extensible**, for casual investors, or professionals looking for an easy prototyping tool. Whether you are a fundamentals-oriented investor who has identified a |
| 8 | +handful of undervalued picks, or an algorithmic trader who has a basket of |
| 9 | +strategies, PyPortfolioOpt can help you combine your alpha sources in a risk-efficient way. |
31 | 10 |
|
32 | | -PyPortfolioOpt is a library that implements portfolio optimization methods, including |
33 | | -classical mean-variance optimization techniques and Black-Litterman allocation, as well as more |
34 | | -recent developments in the field like shrinkage and Hierarchical Risk Parity. |
35 | 11 |
|
36 | | -It is **extensive** yet easily **extensible**, and can be useful for either a casual investors, or a professional looking for an easy prototyping tool. Whether you are a fundamentals-oriented investor who has identified a |
37 | | -handful of undervalued picks, or an algorithmic trader who has a basket of |
38 | | -strategies, PyPortfolioOpt can help you combine your alpha sources |
39 | | -in a risk-efficient way. |
| 12 | +<!-- buttons --> |
| 13 | + |
| 14 | +| | **[Documentation](https://pyportfolioopt.readthedocs.io/en/latest/)** · **[Tutorials](https://github.com/pyportfolio/pyportfolioopt/tree/main/cookbook)** · **[Release Notes](https://github.com/PyPortfolio/PyPortfolioOpt/releases)** | |
| 15 | +|---|---| |
| 16 | +| **Open Source** | [](https://github.com/pyportfolio/pyportfolioopt/blob/master/LICENSE) [](https://gc-os-ai.github.io/) | | |
| 17 | +| **Tutorials** | [](https://mybinder.org/v2/gh/pyportfolio/pyportfolioopt/main/?filepath=cookbook) | |
| 18 | +| **Community** | [](https://discord.gg/7uKdHfdcJG) [](https://www.linkedin.com/company/pyportfolioopt/) | |
| 19 | +| **CI/CD** | [](https://github.com/pyportfolio/pyportfolioopt/actions/workflows/release.yml) [](https://pyportfolioopt.readthedocs.io/en/latest/?badge=latest) | |
| 20 | +| **Code** | [](https://pypi.org/project/pyportfolioopt/) [](https://www.python.org/) [](https://github.com/psf/black) | |
| 21 | +| **Downloads** |   [)](https://pepy.tech/project/pyportfolioopt) | |
| 22 | +| **Citation** | [JOSS article](https://joss.theoj.org/papers/10.21105/joss.03066) | |
40 | 23 |
|
41 | | -**PyPortfolioOpt has been [published](https://joss.theoj.org/papers/10.21105/joss.03066) in the Journal of Open Source Software 🎉** |
42 | 24 |
|
43 | | -PyPortfolioOpt is now being maintained by [Tuan Tran](https://github.com/88d52bdba0366127fffca9dfa93895). |
| 25 | +<!-- content --> |
44 | 26 |
|
45 | 27 | Head over to the **[documentation on ReadTheDocs](https://pyportfolioopt.readthedocs.io/en/latest/)** to get an in-depth look at the project, or check out the [cookbook](https://github.com/pyportfolio/pyportfolioopt/tree/main/cookbook) to see some examples showing the full process from downloading data to building a portfolio. |
46 | 28 |
|
@@ -271,9 +253,6 @@ The covariance matrix encodes not just the volatility of an asset, but also how |
271 | 253 | ef = EfficientFrontier(mu, S, weight_bounds=(-1, 1)) |
272 | 254 | ``` |
273 | 255 |
|
274 | | -```result |
275 | | -``` |
276 | | - |
277 | 256 | - Market neutrality: for the `efficient_risk` and `efficient_return` methods, PyPortfolioOpt provides an option to form a market-neutral portfolio (i.e weights sum to zero). This is not possible for the max Sharpe portfolio and the min volatility portfolio because in those cases because they are not invariant with respect to leverage. Market neutrality requires negative weights: |
278 | 257 |
|
279 | 258 | ```python |
@@ -311,9 +290,6 @@ SBUX: 0.0330 |
311 | 290 | ef = EfficientFrontier(mu, S, weight_bounds=(0, 0.1)) |
312 | 291 | ``` |
313 | 292 |
|
314 | | -```result |
315 | | -``` |
316 | | - |
317 | 293 | One issue with mean-variance optimization is that it leads to many zero-weights. While these are |
318 | 294 | "optimal" in-sample, there is a large body of research showing that this characteristic leads |
319 | 295 | mean-variance portfolios to underperform out-of-sample. To that end, I have introduced an |
@@ -352,7 +328,7 @@ SBUX: 0.0695 |
352 | 328 |
|
353 | 329 | ### Black-Litterman allocation |
354 | 330 |
|
355 | | -As of v0.5.0, we now support Black-Litterman asset allocation, which allows you to combine |
| 331 | +Pyportfolioopt supports Black-Litterman asset allocation, which allows you to combine |
356 | 332 | a prior estimate of returns (e.g the market-implied returns) with your own views to form a |
357 | 333 | posterior estimate. This results in much better estimates of expected returns than just using |
358 | 334 | the mean historical return. Check out the [docs](https://pyportfolioopt.readthedocs.io/en/latest/BlackLitterman.html) for a discussion of the theory, as well as advice |
@@ -439,9 +415,6 @@ PyPortfolioOpt provides a test dataset of daily returns for 20 tickers: |
439 | 415 | ['GOOG', 'AAPL', 'FB', 'BABA', 'AMZN', 'GE', 'AMD', 'WMT', 'BAC', 'GM', 'T', 'UAA', 'SHLD', 'XOM', 'RRC', 'BBY', 'MA', 'PFE', 'JPM', 'SBUX'] |
440 | 416 | ``` |
441 | 417 |
|
442 | | -```result |
443 | | -``` |
444 | | - |
445 | 418 | These tickers have been informally selected to meet several criteria: |
446 | 419 |
|
447 | 420 | - reasonably liquid |
@@ -483,7 +456,7 @@ BibTex:: |
483 | 456 |
|
484 | 457 | Contributions are _most welcome_. Have a look at the [Contribution Guide](https://github.com/PyPortfolio/PyPortfolioOpt/blob/main/CONTRIBUTING.md) for more. |
485 | 458 |
|
486 | | -I'd like to thank all of the people who have contributed to PyPortfolioOpt since its release in 2018. |
| 459 | +We'd like to thank all of the people who have contributed to PyPortfolioOpt since its release in 2018. |
487 | 460 | Special shout-outs to: |
488 | 461 |
|
489 | 462 | - Tuan Tran |
|
0 commit comments