https://github.com/quantopian/bayesalpha
Bayesian models to compute performance and uncertainty of returns and alpha.
https://github.com/quantopian/bayesalpha
bayesian probabilistic-programming quantitative-finance
Last synced: 6 months ago
JSON representation
Bayesian models to compute performance and uncertainty of returns and alpha.
- Host: GitHub
- URL: https://github.com/quantopian/bayesalpha
- Owner: quantopian
- License: other
- Created: 2017-09-29T15:22:45.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-04-07T02:38:13.000Z (almost 3 years ago)
- Last Synced: 2025-08-20T03:07:54.521Z (6 months ago)
- Topics: bayesian, probabilistic-programming, quantitative-finance
- Language: Python
- Homepage:
- Size: 1.91 MB
- Stars: 110
- Watchers: 12
- Forks: 59
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# 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:
```bash
git clone git@github.com:quantopian/bayesalpha.git
cd bayesalpha
pip install -e .
```
To use (this snippet should demonstrate 95% of all use cases):
```python
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')
```