improved docstrings

This commit is contained in:
robertmartin8
2019-12-12 10:13:22 +00:00
parent a5b95ef04b
commit 23add87b1f
6 changed files with 25 additions and 2 deletions

View File

@@ -105,7 +105,7 @@ class BaseScipyOptimizer(BaseOptimizer):
- ``tickers`` - str list
- ``weights`` - np.ndarray
- ``bounds`` - float tuple OR (float tuple) list
- ``initial_guess`` - nnp.ndarray
- ``initial_guess`` - np.ndarray
- ``constraints`` - dict list
"""

View File

@@ -110,6 +110,9 @@ class BlackLittermanModel(base_optimizer.BaseOptimizer):
- ``bl_weights()`` - weights implied by posterior returns
- ``portfolio_performance()`` calculates the expected return, volatility
and Sharpe ratio for the allocated portfolio.
- ``set_weights()`` creates self.weights (np.ndarray) from a weights dict
- ``clean_weights()`` rounds the weights and clips near-zeros.
- ``save_weights_to_file()`` saves the weights to csv, json, or txt.
"""
def __init__(

View File

@@ -46,6 +46,17 @@ class CLA(base_optimizer.BaseOptimizer):
- ``f`` - float list list
- Outputs: ``weights`` - np.ndarray
Public methods:
- ``max_sharpe()`` optimises for maximal Sharpe ratio (a.k.a the tangency portfolio)
- ``min_volatility()`` optimises for minimum volatility
- ``efficient_frontier()`` computes the entire efficient frontier
- ``portfolio_performance()`` calculates the expected return, volatility and Sharpe ratio for
the optimised portfolio.
- ``set_weights()`` creates self.weights (np.ndarray) from a weights dict
- ``clean_weights()`` rounds the weights and clips near-zeros.
- ``save_weights_to_file()`` saves the weights to csv, json, or txt.
"""
def __init__(self, expected_returns, cov_matrix, weight_bounds=(0, 1)):

View File

@@ -43,6 +43,9 @@ class EfficientFrontier(base_optimizer.BaseScipyOptimizer):
- ``efficient_return()`` minimises risk for a given target return
- ``portfolio_performance()`` calculates the expected return, volatility and Sharpe ratio for
the optimised portfolio.
- ``set_weights()`` creates self.weights (np.ndarray) from a weights dict
- ``clean_weights()`` rounds the weights and clips near-zeros.
- ``save_weights_to_file()`` saves the weights to csv, json, or txt.
"""
def __init__(self, expected_returns, cov_matrix, weight_bounds=(0, 1), gamma=0):

View File

@@ -33,6 +33,9 @@ class HRPOpt(base_optimizer.BaseOptimizer):
- ``hrp_portfolio()`` calculates weights using HRP
- ``portfolio_performance()`` calculates the expected return, volatility and Sharpe ratio for
the optimised portfolio.
- ``set_weights()`` creates self.weights (np.ndarray) from a weights dict
- ``clean_weights()`` rounds the weights and clips near-zeros.
- ``save_weights_to_file()`` saves the weights to csv, json, or txt.
"""
def __init__(self, returns):

View File

@@ -34,6 +34,9 @@ class CVAROpt(base_optimizer.BaseScipyOptimizer):
- ``min_cvar()``
- ``normalize_weights()``
- ``set_weights()`` creates self.weights (np.ndarray) from a weights dict
- ``clean_weights()`` rounds the weights and clips near-zeros.
- ``save_weights_to_file()`` saves the weights to csv, json, or txt.
"""
def __init__(self, returns, weight_bounds=(0, 1)):