Skip to content

feat: add econometrics research engine v1 - #1

Draft
guilhermeFin wants to merge 19 commits into
mainfrom
feature/econometrics-engine-v1
Draft

guilhermeFin wants to merge 19 commits into
mainfrom
feature/econometrics-engine-v1

Conversation

@guilhermeFin

Copy link
Copy Markdown
Owner

What this adds

A first-class econometrics layer for AlphaForge that complements the existing ML, walk-forward, backtesting, and research-integrity stack.

New research primitives

  • OLS with labelled coefficient output
  • Classical standard errors
  • Newey–West / HAC standard errors with Bartlett weights
  • Rolling trailing-window OLS for point-in-time coefficient/regime analysis
  • Fama–MacBeth cross-sectional regressions with classical or HAC inference on period premia
  • Explicit forward_returns() label construction helper
  • Immutable result objects with coefficients, uncertainty, confidence intervals, residuals/fits, sample metadata, and notebook-friendly summary frames

Design constraints

  • NumPy/Pandas/SciPy only; no new base dependency
  • Does not place trades or weaken existing AlphaForge guards
  • Does not duplicate the existing ML ladder (models.py / model_eval.py)
  • Does not duplicate walk-forward, purge/embargo, DSR/PSR, transaction-cost, or trial-ledger logic
  • Prediction timing remains explicit and auditable: Fama–MacBeth does not silently shift features; researchers construct forward-return labels intentionally

Tests

Adds coverage for:

  • recovery of known OLS coefficients
  • HAC vs classical inference
  • pandas alignment / missing rows
  • explicit forward-return timing
  • trailing-only rolling regressions
  • recovery of synthetic cross-sectional Fama–MacBeth premia
  • invalid cross-section configuration

Why

AlphaForge already has a strong research-integrity spine and ML model ladder. This PR fills the main missing piece for a combined Econometrics + AI/ML quantitative research laboratory: interpretable statistical inference that can be compared against nonlinear predictive models under the same downstream honesty framework.

Draft until CI is green and the public API is reviewed.

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.

1 participant