etlportfolio
Expected tail loss portfolio optimisation in Python
Description
This package contains portfolio optimisation class structures to perform alternative portfolio optimisation exercises. Included in the package are a mean-variance portfolio object, two common downside risk-oriented portfolio objects (CVaR and the lower partial moment), as well as an 'expected tail loss' (ETL) portfolio object based on the model of Geman et. al. (2015). Through these objects a user can implement downside risk optimised portfolios in a tractable fashion.
Installation
$ pip install etlportfolio
Usage
# import modules
from etlportfolio import data, portfolio
# historical asset return data
tickers = [...]
returns = data.get_prices(tickers, '1W')
# simple historical estimates of returns and VCV, though this
# can be generated from any forecasting process.
forecast_rets = np.mean(returns)
forecast_covs = np.cov(returns, rowvar=False)
# make an instance of class ETLPortfolio
etl = portfolio.ETLPortfolio()
# set risk aversion loss threshold
etl.k = -0.02
# feed in forecast data
etl.load_forecasts(tickers, forecast_rets, forecast_covs)
# get optimal weights
etl.optimise()
etl.weights
Contributing
Pull requests are welcome.
License
Release files for etlportfolio 2.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| etlportfolio-2.0.4-cp310-cp310-any.whl | CPython 3.10 | CPython 3.10 | any | Details |
Release files / etlportfolio-2.0.4-cp310-cp310-any.whl
| Download URL | etlportfolio-2.0.4-cp310-cp310-any.whl |
|---|---|
| Size | 138.1 kB |
| Tags | CPython 3.10 |
|
SHA-256 checksum How to use checksums |
9512ac2c26d9243181e4c69ecd2f64c799bde77a07a73a0c706a6b565ad6c470
|
|
BLAKE2b-256 checksum How to use checksums |
803e0d52d53037c1c51b7c25dac81e91cdabfa75c383afa132056c89e563ccb7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2024.
Transparency log