Skip to content

Commit 6474e8e

Browse files
committed
Version 6.2.3
Fix documentation and some bugs in plot_pie function.
1 parent a740617 commit 6474e8e

21 files changed

+65
-44
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ If you use Riskfolio-Lib for published work, please use the following BibTeX ent
262262
```
263263
@misc{riskfolio,
264264
author = {Dany Cajas},
265-
title = {Riskfolio-Lib (6.2.2)},
265+
title = {Riskfolio-Lib (6.2.3)},
266266
year = {2024},
267267
url = {https://github.com/dcajasn/Riskfolio-Lib},
268268
}

docs/requirements.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
sphinx>=7.2.6
1+
sphinx>=7.4.6
22
numpydoc
33
sphinxcontrib-napoleon==0.7
44
sphinx_rtd_theme==2.0.0
5-
sphinxcontrib-bibtex==2.6.1
6-
sphinxemoji==0.1.8
7-
sphinx-sitemap==2.5.1
5+
sphinxcontrib-bibtex==2.6.2
6+
sphinxcontrib-applehelp==2.0.0
7+
sphinxcontrib-htmlhelp==2.1.0
8+
sphinxemoji==0.3.1
9+
sphinx-sitemap==2.6.0
10+
backports.tarfile==1.2.0
811
RinohType
912
numpy
1013
scipy

docs/source/biblio.bib

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,6 @@ @article{Ahmadi2017
575575
author = {Ahmadi Javid, Amir and Fallah, Malihe},
576576
year = {2017},
577577
month = {08},
578-
pages = {},
579578
title = {Portfolio optimization with entropic value-at-risk},
580579
journal = {European Journal of Operational Research},
581580
doi = {10.1016/j.ejor.2019.02.007}
@@ -585,7 +584,6 @@ @article{Ahmadi2012
585584
author = {Ahmadi Javid, Amir},
586585
year = {2012},
587586
month = {12},
588-
pages = {},
589587
title = {Entropic Value-at-Risk: A new coherent risk measure},
590588
volume = {155},
591589
journal = {Journal of Optimization Theory and Applications},
@@ -709,7 +707,7 @@ @article{twogap
709707

710708
@article{Szekely,
711709
author = {Gábor J. Székely and Maria L. Rizzo and Nail K. Bakirov},
712-
title = {{Measuring and testing dependence by correlation of distances}},
710+
title = {Measuring and testing dependence by correlation of distances},
713711
volume = {35},
714712
journal = {The Annals of Statistics},
715713
number = {6},
@@ -753,14 +751,21 @@ @article{Song
753751
}
754752

755753
@article{Massara,
756-
title={Network Filtering for Big Data: Triangulated Maximally Filtered Graph},
757-
author={Guido Previde Massara and T. D. Matteo and T. Aste},
758-
journal={J. Complex Networks},
759-
year={2017},
760-
volume={5},
761-
pages={161-178}
754+
author = {Massara, Guido Previde and Di Matteo, T. and Aste, Tomaso},
755+
title = "{Network Filtering for Big Data: Triangulated Maximally Filtered Graph}",
756+
journal = {Journal of Complex Networks},
757+
volume = {5},
758+
number = {2},
759+
pages = {161-178},
760+
year = {2016},
761+
month = {06},
762+
issn = {2051-1310},
763+
doi = {10.1093/comnet/cnw015},
764+
url = {https://doi.org/10.1093/comnet/cnw015},
765+
eprint = {https://academic.oup.com/comnet/article-pdf/5/2/161/13794756/cnw015.pdf},
762766
}
763767

768+
764769
@article{Song2,
765770
title = {Nested hierarchies in planar graphs},
766771
journal = {Discrete Applied Mathematics},
@@ -786,7 +791,6 @@ @TechReport{Pfitzinger
786791
number={14/2019},
787792
abstract={Hierarchical Risk Parity (HRP) is a risk-based portfolio optimisation algorithm, which has been shown to generate diversified portfolios with robust out-of-sample properties without the need for a positive-definite return covariance matrix (Lopez de Prado 2016). The algorithm applies machine learning techniques to identify the underlying hierarchical correlation structure of the portfolio, allowing clusters of similar assets to compete for capital. The resulting allocation is both well-diversified over risk sources and intuitively appealing. This paper proposes a method of fully exploiting the information created by the clustering process, achieving enhanced out-of-sample risk and return characteristics. In addition, a practical approach to calculating HRP weights under box and group constraints is introduced. A comprehensive set of portfolio simulations over 6 equity universes demonstrates the appeal of the algorithm for portfolios consisting of 20 - 200 assets. HRP delivers highly diversified allocations with low volatility, low portfolio turnover and competitive performance metrics.},
788793
keywords={Risk Parity; Diversification; Portfolio Optimisation; Clustering},
789-
doi={},
790794
}
791795

792796

@@ -814,8 +818,6 @@ @TechReport{RichardRoncalli
814818
url={https://ideas.repec.org/p/arx/papers/1902.05710.html},
815819
number={1902.05710},
816820
abstract={This article develops the theory of risk budgeting portfolios, when we would like to impose weight constraints. It appears that the mathematical problem is more complex than the traditional risk budgeting problem. The formulation of the optimization program is particularly critical in order to determine the right risk budgeting portfolio. We also show that numerical solutions can be found using methods that are used in large-scale machine learning problems. Indeed, we develop an algorithm that mixes the method of cyclical coordinate descent (CCD), alternating direction method of multipliers (ADMM), proximal operators and Dykstra's algorithm. This theoretical body is then applied to some investment problems. In particular, we show how to dynamically control the turnover of a risk parity portfolio and how to build smart beta portfolios based on the ERC approach by improving the liquidity of the portfolio or reducing the small cap bias. Finally, we highlight the importance of the homogeneity property of risk measures and discuss the related scaling puzzle.},
817-
keywords={},
818-
doi={},
819821
}
820822

821823
@article{Prado2,
@@ -839,7 +841,8 @@ @article{jLogo
839841
publisher={American Physical Society (APS)},
840842
author={Barfuss, Wolfram and Massara, Guido Previde and Di Matteo, T. and Aste, Tomaso},
841843
year={2016},
842-
month={Dec} }
844+
month={12}
845+
}
843846

844847
@book{MLforAM,
845848
place={Cambridge},
@@ -849,7 +852,8 @@ @book{MLforAM
849852
publisher={Cambridge University Press},
850853
author={López de Prado, Marcos M.},
851854
year={2020},
852-
collection={Elements in Quantitative Finance}}
855+
collection={Elements in Quantitative Finance}
856+
}
853857

854858
@article{Cajas3,
855859
doi = {10.2139/ssrn.3988927},
@@ -889,7 +893,7 @@ @article{Gerber2021
889893
publisher = {Elsevier {BV}},
890894
author = {Sander Gerber and Harry Markowitz and Philip Ernst and Yinsen Miao and Babak Javid and Paul Sargen},
891895
title = {The Gerber Statistic: A Robust Co-Movement Measure for Portfolio Optimization},
892-
journal = {{SSRN} Electronic Journal}
896+
journal = {SSRN Electronic Journal},
893897
}
894898

895899
@article{Cajas4,
@@ -924,7 +928,8 @@ @article{Cajas5
924928
publisher = {Elsevier {BV}},
925929
author = {Dany Cajas},
926930
title = {Portfolio Optimization of Relativistic Value at Risk},
927-
journal = {{SSRN} Electronic Journal}
931+
journal = {SSRN Electronic Journal},
932+
doi = {10.2139/ssrn.4378498},
928933
}
929934

930935
@article{Cajas6,
@@ -933,14 +938,14 @@ @article{Cajas6
933938
publisher = {Elsevier {BV}},
934939
author = {Dany Cajas},
935940
title = {Higher Order Moment Portfolio Optimization with L-Moments},
936-
journal = {{SSRN} Electronic Journal}
941+
journal = {SSRN Electronic Journal},
942+
doi = {10.2139/ssrn.4393155},
937943
}
938944

939945
@article{Cajas7,
940946
author = {Dany Cajas},
941947
year = {2023},
942948
month = {6},
943-
pages = {},
944949
title = {Approximation of Portfolio Kurtosis through Sum of Squared Quadratic Forms},
945950
journal = {SSRN Electronic Journal},
946951
doi = {10.2139/ssrn.4472793},
@@ -950,7 +955,6 @@ @article{Cajas8
950955
author = {Dany Cajas},
951956
year = {2023},
952957
month = {8},
953-
pages = {},
954958
title = {On the Spectral Decomposition of Portfolio Skewness and its Application to Portfolio Optimization},
955959
journal = {SSRN Electronic Journal},
956960
doi = {10.2139/ssrn.4540021},
@@ -960,7 +964,6 @@ @article{Cajas9
960964
author = {Dany Cajas},
961965
year = {2023},
962966
month = {9},
963-
pages = {},
964967
title = {Portfolio Optimization of Brownian Distance Variance},
965968
journal = {SSRN Electronic Journal},
966969
doi = {10.2139/ssrn.4540021},
@@ -970,22 +973,20 @@ @article{Cajas10
970973
author = {Dany Cajas},
971974
year = {2023},
972975
month = {10},
973-
pages = {},
974976
title = {A Graph Theory Approach to Portfolio Optimization},
975977
journal = {SSRN Electronic Journal},
976978
doi = {10.2139/ssrn.4602019},
977979
}
980+
978981
@article{Cajas11,
979982
author = {Dany Cajas},
980983
year = {2023},
981984
month = {12},
982-
pages = {},
983985
title = {A Graph Theory Approach to Portfolio Optimization Part II},
984986
journal = {SSRN Electronic Journal},
985987
doi = {10.2139/ssrn.4667426},
986988
}
987989

988-
989990
@book{Meucci2005,
990991
doi = {10.1007/978-3-540-27904-4},
991992
url = {https://doi.org/10.1007/978-3-540-27904-4},
@@ -1058,8 +1059,8 @@ @Inbook{VanLoan1993
10581059
address={Dordrecht},
10591060
pages={293--314},
10601061
isbn={978-94-015-8196-7},
1061-
doi={10.1007/978-94-015-8196-7_17},
1062-
url={https://doi.org/10.1007/978-94-015-8196-7_17}
1062+
doi={10.1007/978-94-015-8196-7\_17},
1063+
url={https://doi.org/10.1007/978-94-015-8196-7\_17}
10631064
}
10641065

10651066
@mastersthesis{Yang2019,

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
copyright = '2020-2024, Dany Cajas'
2626
author = 'Dany Cajas'
2727

28-
__version__ = "6.2.2"
28+
__version__ = "6.2.3"
2929

3030
# The short X.Y version
3131
version = '.'.join(__version__.split('.')[:2])

docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ If you use Riskfolio-Lib for published work, please use the following BibTeX ent
310310

311311
@misc{riskfolio,
312312
author = {Dany Cajas},
313-
title = {Riskfolio-Lib (6.2.2)},
313+
title = {Riskfolio-Lib (6.2.3)},
314314
year = {2024},
315315
url = {https://github.com/dcajasn/Riskfolio-Lib},
316316
}

riskfolio/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""""" #
2+
23
"""
34
Copyright (c) 2020-2024, Dany Cajas
45
All rights reserved.

riskfolio/external/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""""" #
2+
23
"""
34
Copyright (c) 2020-2024, Dany Cajas
45
All rights reserved.

riskfolio/external/cppfunctions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""""" #
2+
23
"""
34
Copyright (c) 2020-2024, Dany Cajas
45
All rights reserved.

riskfolio/src/AuxFunctions.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""""" #
2+
23
"""
34
Copyright (c) 2020-2024, Dany Cajas
45
All rights reserved.
@@ -267,6 +268,10 @@ def block_vec_pq(A, p, q):
267268
"""
268269
if isinstance(A, pd.DataFrame):
269270
A_ = A.to_numpy()
271+
elif isinstance(A, np.ndarray):
272+
A_ = A.copy()
273+
else:
274+
raise ValueError("A must be an 2darray or DataFrame.")
270275

271276
mp, nq = A_.shape
272277
if mp % p == 0 and nq % q == 0:
@@ -406,9 +411,7 @@ def numBins(n_samples, corr=None):
406411
b = np.round(z / 6 + 2 / (3 * z) + 1 / 3)
407412
# bivariate case
408413
else:
409-
b = np.round(
410-
2**-0.5 * (1 + (1 + 24 * n_samples / (1 - corr**2)) ** 0.5) ** 0.5
411-
)
414+
b = np.round(2**-0.5 * (1 + (1 + 24 * n_samples / (1 - corr**2)) ** 0.5) ** 0.5)
412415

413416
bins = np.int32(b)
414417

riskfolio/src/ConstraintsFunctions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""""" #
2+
23
"""
34
Copyright (c) 2020-2024, Dany Cajas
45
All rights reserved.

0 commit comments

Comments
 (0)