Skip to content

fix: compute Roll spread from covariance within the current window #84

Closed

Description

@stefan-jansen

Engineer 0.1.6 calculates Roll spread by averaging products demeaned with different trailing means. That is not the serial covariance of the current window and delays usable output.

Through roll_spread_estimator('close', period=4), use closes [100,101,100,101,100,101,100,101,102,101]. Compare each valid window against 2sqrt(max(-(mean(changelagged_change)-mean(change)*mean(lagged_change)),0)). Base a441fb4 disagrees; b6ad633 agrees. Lookback metadata must match the corrected warm-up.

The public-expression test_roll_spread_matches_window_covariance fails on the base and passes on the focused fix. Microstructure plus registry-lookback suites pass 133 tests. This splits the confirmed covariance defect from #69 and #71. Output and warm-up change and require a patch release. Cursor Agent source-fix authorship is retained. Codex assisted reproduction, metadata verification, review, checks, and submission preparation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions