Skip to content

Commit

Permalink
Merge pull request dcajasn#86 from ryanrussell/master
Browse files Browse the repository at this point in the history
docs(various): Fix typos
  • Loading branch information
dcajasn authored May 22, 2022
2 parents a3b88f6 + 88fb7c6 commit 49b7a9d
Show file tree
Hide file tree
Showing 14 changed files with 46 additions and 46 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ The latest stable release (and older versions) can be installed from PyPI:

## Citing

If you use Riskfolio-Lib for published work, please use the following BibTeX entrie:
If you use Riskfolio-Lib for published work, please use the following BibTeX entry:

```
@misc{riskfolio,
Expand Down
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ Some of key functionalities that Riskfolio-Lib offers:
Citing
======

If you use Riskfolio-Lib for published work, please use the following BibTeX entrie:
If you use Riskfolio-Lib for published work, please use the following BibTeX entry:

::

Expand Down
2 changes: 1 addition & 1 deletion docs/source/portfolio.rst
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ Where:

:math:`\psi`: is the average risk of the portfolio.

:math:`\gamma`: is the lower bound of each asset risk constribution.
:math:`\gamma`: is the lower bound of each asset risk contribution.

:math:`\zeta_{i}`: is the marginal risk of asset :math:`i`.

Expand Down
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Tutorials:
- Index Tracking / Replicating Portfolios [Tutorial 7](https://github.com/microprediction/Riskfolio-Lib/blob/master/examples/Tutorial%207.ipynb)
- Short and Leveraged Portfolios [Tutorial 8](https://github.com/microprediction/Riskfolio-Lib/blob/master/examples/Tutorial%208.ipynb)
- Portfolio Optimization with Risk Factors and Principal Components Regression (PCR) [Tutorial 9](https://github.com/microprediction/Riskfolio-Lib/blob/master/examples/Tutorial%209.ipynb)
- Risk Parity Portfolio Optimization [Tuturial 10](https://github.com/microprediction/Riskfolio-Lib/blob/master/examples/Tutorial%2010.ipynb)
- Risk Parity Portfolio Optimization [Tutorial 10](https://github.com/microprediction/Riskfolio-Lib/blob/master/examples/Tutorial%2010.ipynb)
- Risk Parity Portfolio Optimization with Risk Factors using Stepwise Regression [Tutorial 11](https://github.com/microprediction/Riskfolio-Lib/blob/master/examples/Tutorial%2011.ipynb)
- Worst Case Mean Variance Portfolio Optimization [Tutorial 12](https://github.com/microprediction/Riskfolio-Lib/blob/master/examples/Tutorial%2012.ipynb)
- Riskfolio-Lib and Xlwings [Tutorial 13](https://github.com/microprediction/Riskfolio-Lib/blob/master/examples/Tutorial%2013.ipynb)
Expand Down
2 changes: 1 addition & 1 deletion examples/Tutorial 12.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1307,7 +1307,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Finally, you can try several combinations of differents uncertainty sets and estimation methods of parameters."
"Finally, you can try several combinations of different uncertainty sets and estimation methods of parameters."
]
}
],
Expand Down
4 changes: 2 additions & 2 deletions examples/Tutorial 3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@
" 'Set': ['Industry', 'Industry', 'Industry'],\n",
" 'Position': ['Energy', 'Consumer Staples', 'Materials'],\n",
" 'Sign': ['>=', '>=', '>='],\n",
" 'Weight': [0.08, 0.1, 0.09], # Anual terms \n",
" 'Weight': [0.08, 0.1, 0.09], # Annual terms \n",
" 'Type Relative': ['Classes', 'Classes', 'Classes'],\n",
" 'Relative Set': ['Industry', 'Industry', 'Industry'],\n",
" 'Relative': ['Financials', 'Utilities', 'Industrials']}\n",
Expand Down Expand Up @@ -1279,7 +1279,7 @@
"source": [
"## 3. Estimating Black Litterman Mean Risk Portfolios\n",
"\n",
"When we use risk measures differents than Standard Deviation, Riskfolio-Lib only considers the vector of expected returns, and use historical returns to calculate risk measures.\n",
"When we use risk measures different than Standard Deviation, Riskfolio-Lib only considers the vector of expected returns, and use historical returns to calculate risk measures.\n",
"\n",
"### 3.4 Calculate Black Litterman Portfolios for Several Risk Measures"
]
Expand Down
4 changes: 2 additions & 2 deletions examples/Tutorial 4.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1580,7 +1580,7 @@
"source": [
"## 3. Optimization with Key Rate Durations Constraints\n",
"\n",
"This part shows how __Riskfolio-Lib__ can be used to build immunized portfolios using __duration matching__ and __convexity matching__, however the example only use duration matching. More information about inmunization theory can be found in this __[link](https://www.investopedia.com/terms/i/immunization.asp)__.\n",
"This part shows how __Riskfolio-Lib__ can be used to build immunized portfolios using __duration matching__ and __convexity matching__, however the example only use duration matching. More information about immunization theory can be found in this __[link](https://www.investopedia.com/terms/i/immunization.asp)__.\n",
"\n",
"### 3.1 Statistics of Risk Factors"
]
Expand Down Expand Up @@ -3738,7 +3738,7 @@
"source": [
"## 5. Optimization of Equity and Bond Portfolio with Key Rate Durations Constraints\n",
"\n",
"This part shows how __Riskfolio-Lib__ can be used to build immunized portfolios using __duration matching__ and __convexity matching__, however the example only use duration matching. More information about inmunization theory can be found in this __[link](https://www.investopedia.com/terms/i/immunization.asp)__.\n",
"This part shows how __Riskfolio-Lib__ can be used to build immunized portfolios using __duration matching__ and __convexity matching__, however the example only use duration matching. More information about immunization theory can be found in this __[link](https://www.investopedia.com/terms/i/immunization.asp)__.\n",
"\n",
"### 5.1 Statistics of Risk Factors"
]
Expand Down
4 changes: 2 additions & 2 deletions riskfolio/ConstraintsFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -779,12 +779,12 @@ def assets_clusters(
codep = af.ltdi_matrix(returns, alpha_tail).astype(float)
dist = -np.log(codep)

# Hierarchcial clustering
# Hierarchical clustering
dist = dist.to_numpy()
dist = pd.DataFrame(dist, columns=codep.columns, index=codep.index)
if linkage == "DBHT":
# different choices for D, S give different outputs!
D = dist.to_numpy() # dissimilatity matrix
D = dist.to_numpy() # dissimilarity matrix
if codependence in {"pearson", "spearman"}:
S = (1 - dist**2).to_numpy()
else:
Expand Down
4 changes: 2 additions & 2 deletions riskfolio/HCPortfolio.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,12 @@ def _hierarchical_clustering(
elif codependence in {"tail"}:
dist = -np.log(self.codep).astype(float)

# Hierarchcial clustering
# Hierarchical clustering
dist = dist.to_numpy()
dist = pd.DataFrame(dist, columns=self.codep.columns, index=self.codep.index)
if linkage == "DBHT":
# different choices for D, S give different outputs!
D = dist.to_numpy() # dissimilatity matrix
D = dist.to_numpy() # dissimilarity matrix
if codependence in {"pearson", "spearman", "custom_cov"}:
codep = 1 - dist**2
S = codep.to_numpy() # similarity matrix
Expand Down
8 changes: 4 additions & 4 deletions riskfolio/ParamsEstimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ def backward_regression(X, y, criterion="pvalue", threshold=0.05, verbose=False)

def PCR(X, y, n_components=0.95):
r"""
Estimate the coeficients using Principal Components Regression (PCR).
Estimate the coefficients using Principal Components Regression (PCR).
Parameters
----------
Expand All @@ -514,7 +514,7 @@ def PCR(X, y, n_components=0.95):
n_components : int, float, None or str, optional
if 1 < n_components (int), it represents the number of components that
will be keep. if 0 < n_components < 1 (float), it represents the
percentage of variance that the is explained by the components keeped.
percentage of variance that the is explained by the components kept.
See `PCA <https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.PCA.html>`_
for more details. The default is 0.95.
Expand Down Expand Up @@ -607,7 +607,7 @@ def loadings_matrix(
n_components : int, float, None or str, optional
if 1 < n_components (int), it represents the number of components that
will be keep. if 0 < n_components < 1 (float), it represents the
percentage of variance that the is explained by the components keeped.
percentage of variance that the is explained by the components kept.
See `PCA <https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.PCA.html>`_
for more details. The default is 0.95.
verbose : bool, optional
Expand Down Expand Up @@ -741,7 +741,7 @@ def risk_factors(
n_components : int, float, None or str, optional
if 1 < n_components (int), it represents the number of components that
will be keep. if 0 < n_components < 1 (float), it represents the
percentage of variance that the is explained by the components keeped.
percentage of variance that the is explained by the components kept.
See `PCA <https://scikit-learn.org/stable/modules/generated/sklearn.decomposition.PCA.html>`_
for more details. The default is 0.95.
error : bool
Expand Down
12 changes: 6 additions & 6 deletions riskfolio/PlotFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2055,13 +2055,13 @@ def plot_clusters(
codep = af.cov2corr(custom_cov).astype(float)
dist = np.sqrt(np.clip((1 - codep) / 2, a_min=0.0, a_max=1.0))

# Hierarchcial clustering
# Hierarchical clustering
dist = dist.to_numpy()
dist = pd.DataFrame(dist, columns=codep.columns, index=codep.index)
dim = len(dist)
if linkage == "DBHT":
# different choices for D, S give different outputs!
D = dist.to_numpy() # dissimilatity matrix
D = dist.to_numpy() # dissimilarity matrix
if codependence in {"pearson", "spearman", "custom_cov"}:
S = (1 - dist**2).to_numpy()
else:
Expand Down Expand Up @@ -2378,12 +2378,12 @@ def plot_dendrogram(
codep = af.cov2corr(custom_cov).astype(float)
dist = np.sqrt(np.clip((1 - codep) / 2, a_min=0.0, a_max=1.0))

# Hierarchcial clustering
# Hierarchical clustering
dist = dist.to_numpy()
dist = pd.DataFrame(dist, columns=codep.columns, index=codep.index)
if linkage == "DBHT":
# different choices for D, S give different outputs!
D = dist.to_numpy() # dissimilatity matrix
D = dist.to_numpy() # dissimilarity matrix
if codependence in {"pearson", "spearman", "custom_cov"}:
S = (1 - dist**2).to_numpy()
else:
Expand Down Expand Up @@ -2629,12 +2629,12 @@ def plot_network(
codep = af.cov2corr(custom_cov).astype(float)
dist = np.sqrt(np.clip((1 - codep) / 2, a_min=0.0, a_max=1.0))

# Hierarchcial clustering
# Hierarchical clustering
dist = dist.to_numpy()
dist = pd.DataFrame(dist, columns=codep.columns, index=codep.index)
if linkage == "DBHT":
# different choices for D, S give different outputs!
D = dist.to_numpy() # dissimilatity matrix
D = dist.to_numpy() # dissimilarity matrix
if codependence in {"pearson", "spearman", "custom_cov"}:
S = (1 - dist**2).to_numpy()
else:
Expand Down
16 changes: 8 additions & 8 deletions riskfolio/Portfolio.py
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,7 @@ def optimization(
- 'BLFM': use estimates of expected return vector and covariance matrix based on Black Litterman applied to a Risk Factor model specified by the user.
rm : str, optional
The risk measure used to optimze the portfolio.
The risk measure used to optimize the portfolio.
The default is 'MV'. Possible values are:
- 'MV': Standard Deviation.
Expand Down Expand Up @@ -1083,7 +1083,7 @@ def optimization(
If model = 'FM', True means historical covariance and returns and
False Risk Factor model for covariance and returns.
If model = 'BL_FM', True means historical covariance and returns,
False Black Litteram with Risk Factor model for covariance and
False Black Litterman with Risk Factor model for covariance and
Risk Factor model for returns, and '2' Risk Factor model for
covariance and returns. The default is True.
Expand Down Expand Up @@ -1822,7 +1822,7 @@ def rp_optimization(self, model="Classic", rm="MV", rf=0, b=None, hist=True):
- 'FM': use estimates of expected return vector and covariance matrix based on a Risk Factor model specified by the user.
rm : str, optional
The risk measure used to optimze the portfolio.
The risk measure used to optimize the portfolio.
The default is 'MV'. Possible values are:
- 'MV': Standard Deviation.
Expand Down Expand Up @@ -2187,7 +2187,7 @@ def rrp_optimization(self, model="Classic", version="A", l=1, b=None, hist=True)
:math:`\psi`: is the average risk of the portfolio.
:math:`\gamma`: is the lower bound of each asset risk constribution.
:math:`\gamma`: is the lower bound of each asset risk contribution.
:math:`\zeta_{i}`: is the marginal risk of asset :math:`i`.
Expand Down Expand Up @@ -2955,7 +2955,7 @@ def frontier_limits(self, model="Classic", rm="MV", kelly=False, rf=0, hist=True
Methodology used to estimate input parameters.
The default is 'Classic'.
rm : str, optional
The risk measure used to optimze the portfolio.
The risk measure used to optimize the portfolio.
The default is 'MV'. Possible values are:
- 'MV': Standard Deviation.
Expand Down Expand Up @@ -2992,7 +2992,7 @@ def frontier_limits(self, model="Classic", rm="MV", kelly=False, rf=0, hist=True
If model = 'FM', True means historical covariance and returns and
False Risk Factor model for covariance and returns.
If model = 'BL_FM', True means historical covariance and returns,
False Black Litteram with Risk Factor model for covariance and
False Black Litterman with Risk Factor model for covariance and
Risk Factor model for returns, and '2' Risk Factor model for
covariance and returns. The default is True.
Expand Down Expand Up @@ -3036,7 +3036,7 @@ def efficient_frontier(
Methodology used to estimate input parameters.
The default is 'Classic'.
rm : str, optional
The risk measure used to optimze the portfolio.
The risk measure used to optimize the portfolio.
The default is 'MV'. Possible values are:
- 'MV': Standard Deviation.
Expand Down Expand Up @@ -3076,7 +3076,7 @@ def efficient_frontier(
If model = 'FM', True means historical covariance and returns and
False Risk Factor model for covariance and returns.
If model = 'BL_FM', True means historical covariance and returns,
False Black Litteram with Risk Factor model for covariance and
False Black Litterman with Risk Factor model for covariance and
Risk Factor model for returns, and '2' Risk Factor model for
covariance and returns. The default is True.
Expand Down
4 changes: 2 additions & 2 deletions riskfolio/Reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ def jupyter_report(
- 'UCI': Ulcer Index of uncompounded cumulative returns.
rf : float, optional
Risk free rate or minimum aceptable return. The default is 0.
Risk free rate or minimum acceptable return. The default is 0.
alpha : float, optional
Significante level of VaR, CVaR, EVaR, DaR and CDaR.
Significant level of VaR, CVaR, EVaR, DaR and CDaR.
The default is 0.05.
others : float, optional
Percentage of others section. The default is 0.05.
Expand Down
26 changes: 13 additions & 13 deletions riskfolio/RiskFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ def EVaR_Hist(X, alpha=0.05):
def MDD_Abs(X):
r"""
Calculate the Maximum Drawdown (MDD) of a returns series
using uncumpounded cumulative returns.
using uncompounded cumulative returns.
.. math::
\text{MDD}(X) = \max_{j \in (0,T)} \left [\max_{t \in (0,j)}
Expand All @@ -422,7 +422,7 @@ def MDD_Abs(X):
Returns
-------
value : float
MDD of an uncumpounded cumulative returns.
MDD of an uncompounded cumulative returns.
"""

Expand Down Expand Up @@ -451,7 +451,7 @@ def MDD_Abs(X):
def ADD_Abs(X):
r"""
Calculate the Average Drawdown (ADD) of a returns series
using uncumpounded cumulative returns.
using uncompounded cumulative returns.
.. math::
\text{ADD}(X) = \frac{1}{T}\sum_{j=0}^{T}\left [ \max_{t \in (0,j)}
Expand All @@ -470,7 +470,7 @@ def ADD_Abs(X):
Returns
-------
value : float
ADD of an uncumpounded cumulative returns.
ADD of an uncompounded cumulative returns.
"""

Expand Down Expand Up @@ -505,7 +505,7 @@ def ADD_Abs(X):
def DaR_Abs(X, alpha=0.05):
r"""
Calculate the Drawdown at Risk (DaR) of a returns series
using uncumpounded cumulative returns.
using uncompounded cumulative returns.
.. math::
\text{DaR}_{\alpha}(X) & = \max_{j \in (0,T)} \left \{ \text{DD}(X,j)
Expand All @@ -529,7 +529,7 @@ def DaR_Abs(X, alpha=0.05):
Returns
-------
value : float
DaR of an uncumpounded cumulative returns series.
DaR of an uncompounded cumulative returns series.
"""

Expand Down Expand Up @@ -559,7 +559,7 @@ def DaR_Abs(X, alpha=0.05):
def CDaR_Abs(X, alpha=0.05):
r"""
Calculate the Conditional Drawdown at Risk (CDaR) of a returns series
using uncumpounded cumulative returns.
using uncompounded cumulative returns.
.. math::
\text{CDaR}_{\alpha}(X) = \text{DaR}_{\alpha}(X) + \frac{1}{\alpha T}
Expand All @@ -569,7 +569,7 @@ def CDaR_Abs(X, alpha=0.05):
Where:
:math:`\text{DaR}_{\alpha}` is the Drawdown at Risk of an uncumpound
:math:`\text{DaR}_{\alpha}` is the Drawdown at Risk of an uncompounded
cumulated return series :math:`X`.
Parameters
Expand All @@ -587,7 +587,7 @@ def CDaR_Abs(X, alpha=0.05):
Returns
-------
value : float
CDaR of an uncumpounded cumulative returns series.
CDaR of an uncompounded cumulative returns series.
"""

Expand Down Expand Up @@ -620,7 +620,7 @@ def CDaR_Abs(X, alpha=0.05):
def EDaR_Abs(X, alpha=0.05):
r"""
Calculate the Entropic Drawdown at Risk (EDaR) of a returns series
using uncumpounded cumulative returns.
using uncompounded cumulative returns.
.. math::
\text{EDaR}_{\alpha}(X) & = \inf_{z>0} \left \{ z
Expand All @@ -643,7 +643,7 @@ def EDaR_Abs(X, alpha=0.05):
Returns
-------
(value, z) : tuple
EDaR of an uncumpounded cumulative returns series
EDaR of an uncompounded cumulative returns series
and value of z that minimize EDaR.
"""
Expand Down Expand Up @@ -672,7 +672,7 @@ def EDaR_Abs(X, alpha=0.05):
def UCI_Abs(X):
r"""
Calculate the Ulcer Index (UCI) of a returns series
using uncumpounded cumulative returns.
using uncompounded cumulative returns.
.. math::
\text{UCI}(X) =\sqrt{\frac{1}{T}\sum_{j=0}^{T} \left [ \max_{t \in
Expand All @@ -692,7 +692,7 @@ def UCI_Abs(X):
Returns
-------
value : float
Ulcer Index of an uncumpounded cumulative returns.
Ulcer Index of an uncompounded cumulative returns.
"""

Expand Down

0 comments on commit 49b7a9d

Please sign in to comment.