Skip to content

[Alpha] Add new alpha and alpha evaluation methods#69

Merged
tjluyao merged 12 commits into
mainfrom
cyx/feat2
Apr 8, 2026
Merged

[Alpha] Add new alpha and alpha evaluation methods#69
tjluyao merged 12 commits into
mainfrom
cyx/feat2

Conversation

@CYX22222003
Copy link
Copy Markdown
Collaborator

This pull request introduces an autoregressive (AR) model for time series prediction and adds an evaluation framework for alpha signals, along with corresponding tests. The main themes are the implementation of the AR model, integration into the alpha signal pipeline, and the addition of an information coefficient (IC) evaluation utility.

Key changes:

Autoregressive Model Implementation

  • Added AR model class and related utilities for training, inference, and dataset preparation in autoregression.py, including functions to build training data, train the model, and load a pretrained model.
  • Introduced a data processing module (data_processing.py) to load financial time series data and compute log returns.

Integration with Alpha Pipeline

  • Implemented AutoregressionAlpha, an IAlpha subclass, which computes AR-based predictions and adds them as a new column (ar_pred) to the DataFrame.

Alpha Signal Evaluation

  • Added AlphaEvaluator class to interface.py, which computes the information coefficient (Spearman correlation) between specified alpha signals and future returns over multiple timeframes.

Testing

  • Added tests for AutoregressionAlpha to verify the presence and correctness of the ar_pred column and its handling of short series.
  • Added tests for AlphaEvaluator to ensure correct output format, value types, and expected behavior on constant alpha signals.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an autoregressive (AR) alpha implementation and a new alpha evaluation utility (information coefficient) with corresponding unit tests, extending the alpha pipeline with model-based signals and evaluation tooling.

Changes:

  • Introduces AR model utilities + a bundled pretrained weights file under alpha/AutoRegression/.
  • Adds AutoregressionAlpha that computes an ar_pred signal column from AR predictions.
  • Adds AlphaEvaluator to compute Spearman IC vs. forward returns, plus new tests for AR alpha and IC evaluation.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
tests/test_alpha.py Adds tests for AutoregressionAlpha and AlphaEvaluator.
alpha/interface.py Adds AlphaEvaluator and forward-return timeframe configuration.
alpha/AutoregressionAlpha.py Implements AR-based alpha signal (ar_pred) using a pretrained torch model.
alpha/AutoRegression/data_processing.py Adds utilities to load data and compute log returns (training/experimentation support).
alpha/AutoRegression/autoregression.py Adds AR model definition, training/inference helpers, and model-loading logic.
alpha/AutoRegression/ar_model.pth Adds pretrained AR model weights artifact.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread alpha/AutoRegression/data_processing.py Outdated
Comment thread alpha/AutoRegression/autoregression.py Outdated
Comment thread alpha/AutoRegression/data_processing.py
Comment thread tests/test_alpha.py
Comment thread alpha/interface.py Outdated
Comment thread alpha/AutoregressionAlpha.py
Comment thread alpha/AutoRegression/autoregression.py Outdated
Comment thread alpha/AutoRegression/autoregression.py
Comment thread alpha/interface.py Outdated
Comment thread alpha/AutoregressionAlpha.py
@CYX22222003 CYX22222003 changed the title Add new alpha and alpha evaluation methods [Alpha] Add new alpha and alpha evaluation methods Mar 29, 2026
CYX22222003 and others added 3 commits April 7, 2026 20:09
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
CYX22222003 and others added 3 commits April 7, 2026 20:11
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…a instance

Agent-Logs-Url: https://github.com/mlsys-io/PortfolioBench/sessions/36ad2240-1e58-424c-a71e-18338280393a

Co-authored-by: CYX22222003 <138369841+CYX22222003@users.noreply.github.com>
@tjluyao tjluyao merged commit fca9fa9 into main Apr 8, 2026
5 checks passed
@tjluyao tjluyao deleted the cyx/feat2 branch April 8, 2026 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants