Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spread Modeling - ML Approach #25

Merged
merged 37 commits into from Feb 15, 2021
Merged

Spread Modeling - ML Approach #25

merged 37 commits into from Feb 15, 2021

Conversation

AaronDeb
Copy link

@AaronDeb AaronDeb commented Nov 30, 2020

Purpose

Implementation of the second element of the ML Roadmap - Spread modelling. Implementation of the concepts for the paper "Modelling and trading the gasoline crack spread: A non-linear story" by Christian L. Dunis, Jason Laws and Ben Evans.

Approach

Applying ML to model pair spreads.

Tests for New Behavior

The following unit tests were added:

  • test_feature_expander.py
  • test_filters.py
  • test_futures_roller.py
  • test_neural_networks.py
  • test_regressor_committee.py
  • test_spread_modeling_helper.py
  • test_tar.py

Checklist

Make sure you did the following (if applicable):

  • Added tests for any new features or behaviors.
  • Ran ./pylint to make sure code style is consistent.
  • Built and reviewed the docs.
  • Added a note to the changelog.

Learning [to be updated]

Describe the research stage

Links to blog posts, patterns, libraries or addons used to solve this problem

@AaronDeb AaronDeb added documentation Improvements or additions to documentation enhancement New feature or request labels Nov 30, 2020
@AaronDeb AaronDeb self-assigned this Nov 30, 2020
@PanPip PanPip self-requested a review December 10, 2020 09:50
Copy link
Contributor

@PanPip PanPip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked the PR. Filters and models (TAR, RNN, MLP, PiSigma) look good. Will have to check the roller classes.

Waiting for the Notebook to check how the created structures work and if we should change anything in terms of input/output.

@PanPip PanPip changed the title [Draft] Spread modeling Spread Modeling - ML Approach Dec 15, 2020
Copy link
Contributor

@PanPip PanPip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great draft PR! Roller classes look good.

Waiting for the final code adjustments and docs to do a more detailed review.

arbitragelab/ml_approach/correlation_filter.py Outdated Show resolved Hide resolved
arbitragelab/ml_approach/correlation_filter.py Outdated Show resolved Hide resolved
arbitragelab/ml_approach/filters.py Outdated Show resolved Hide resolved
arbitragelab/ml_approach/mlp.py Outdated Show resolved Hide resolved
arbitragelab/util/base_futures_roller.py Outdated Show resolved Hide resolved
arbitragelab/util/base_futures_roller.py Outdated Show resolved Hide resolved
arbitragelab/util/base_futures_roller.py Show resolved Hide resolved
arbitragelab/ml_approach/correlation_filter.py Outdated Show resolved Hide resolved
Copy link
Contributor

@PanPip PanPip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the code part of this PR. There are places to fix, as some docstrings are lacking descriptions. Overall, the code itself is approved.

Please check every place where the functionality was later changed, but the variables are still present in the docstrings. (If the functions work as you expect them to)

Fixed some small details here and there.

arbitragelab/ml_approach/filters.py Outdated Show resolved Hide resolved
arbitragelab/ml_approach/neural_networks.py Outdated Show resolved Hide resolved
arbitragelab/ml_approach/regressor_committee.py Outdated Show resolved Hide resolved
arbitragelab/util/base_futures_roller.py Outdated Show resolved Hide resolved
arbitragelab/util/cl_roller.py Outdated Show resolved Hide resolved
arbitragelab/util/nbp_roller.py Outdated Show resolved Hide resolved
arbitragelab/util/rb_roller.py Outdated Show resolved Hide resolved
docs/source/conf.py Outdated Show resolved Hide resolved
Copy link
Contributor

@PanPip PanPip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These docs are great, a lot of work here. Awesome Futures Rollover section 👍

Please finish the code examples and add references for the images where needed. This is important! Otherwise, the docs are approved.

docs/source/data/futures_rollover.rst Outdated Show resolved Hide resolved
docs/source/ml_approach/filters.rst Outdated Show resolved Hide resolved
docs/source/ml_approach/neural_networks.rst Outdated Show resolved Hide resolved
docs/source/ml_approach/neural_networks.rst Show resolved Hide resolved
docs/source/ml_approach/neural_networks.rst Outdated Show resolved Hide resolved
docs/source/ml_approach/neural_networks.rst Outdated Show resolved Hide resolved
Copy link
Contributor

@PanPip PanPip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unit tests look good 👌

I see some sections are yet to be finished. Will check them again once the coverage is passing for this PR.

Copy link
Contributor

@PanPip PanPip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for finishing the docs and the unit tests. This PR is almost complete now. 🙂

We should add links to the notebooks in the docs, and I think the unit tests need improvement. Will discuss in more detail over the call.

docs/source/data/futures_rollover.rst Outdated Show resolved Hide resolved
docs/source/ml_approach/neural_networks.rst Outdated Show resolved Hide resolved
docs/source/ml_approach/spread_modeling.rst Show resolved Hide resolved
docs/source/ml_approach/threshold_ar.rst Outdated Show resolved Hide resolved
tests/test_feature_expander.py Outdated Show resolved Hide resolved
arbitragelab/util/rollers.py Outdated Show resolved Hide resolved
tests/test_futures_roller.py Outdated Show resolved Hide resolved
@PanPip PanPip merged commit 080045f into develop Feb 15, 2021
@PanPip PanPip deleted the spread_modeling branch March 8, 2021 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants