Skip to content

Fix multi-period annualization inference - #304

Merged
timkpaine merged 3 commits into
pmorissette:masterfrom
Jo2234:fix/infer-multiperiod-frequency
Aug 11, 2026
Merged

timkpaine merged 3 commits into
pmorissette:masterfrom
Jo2234:fix/infer-multiperiod-frequency

Conversation

@Jo2234

@Jo2234 Jo2234 commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • divide the annual observation count by compound frequency multipliers instead of multiplying
  • correct the existing 30min period inference regression assertion
  • verify the corrected inference flows through to annualized Sharpe calculations

For 30-minute data, infer_nperiods previously returned 10,886,400 periods per year instead of 12,096. That inflated annualized Sharpe and Sortino ratios by 30x.

Fixes #303.

Validation

  • python -m pytest -q -ra — 52 passed
  • ruff check ffn/core.py — passed
  • git diff --check — passed

AI assistance was used to identify the arithmetic inconsistency, draft the regression coverage, and run validation. The reproduction, one-line production fix, test expectations, and final diff were reviewed before publication.

@timkpaine
timkpaine merged commit ee5714a into pmorissette:master Aug 11, 2026
6 checks passed

This branch was previously deployed

1 inactive deployment
dev — ee2a5612 Deployed Aug 11, 2026 by timkpaine via build (3.10, ubuntu-latest, >=2.2, >=2) #47
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.

infer_nperiods multiplies multi-period frequencies instead of dividing

2 participants