Skip to content

Bayesian models to compute performance and uncertainty of returns and alpha.

License

Notifications You must be signed in to change notification settings

quantopian/bayesalpha

Folders and files

NameName
Last commit message
Last commit date
Apr 16, 2020
Jul 11, 2018
Aug 6, 2018
Aug 2, 2018
Oct 5, 2017
Jul 12, 2018
Jun 29, 2020
Feb 7, 2018
Jun 17, 2020
Feb 7, 2018
Oct 24, 2017
Jun 29, 2020
Feb 7, 2018
Oct 5, 2017

Repository files navigation

bayesalpha

BayesAlpha

Bayesian models for alpha estimation.

This project is no longer actively developed but pull requests will be evaluated.

Models

There are currently two models:

  • the returns model, which ingests a returns-stream. It computes (among other things) a forwards-looking gains parameter (which is basically a Sharpe ratio). Of interest is P(gains > 0); that is, the probability that the algorithm will make money. Originally authored by Adrian Seyboldt.

  • the author model, which ingests the in-sample Sharpe ratios of user-run backtests. It computes (among other things) average Sharpe delivered at a population-, author- and algorithm-level. Originally authored by George Ho.

Installation and Usage

To install:

git clone git@github.com:quantopian/bayesalpha.git
cd bayesalpha
pip install -e .

To use (this snippet should demonstrate 95% of all use cases):

import bayesalpha as ba

# Fit returns model
trace = ba.fit_returns_population(data, ...)
trace = ba.fit_returns_single(data, ...)

# Fit author model
trace = ba.fit_authors(data, ...)

# Save to netcdf file
trace.save('foo.nc')
del trace

# Load from netcdf file
trace = ba.load('foo.nc')