T-82: M1.4a — Pure signal analyzer math in @stock-bot/calculations: per-date IC / rank-IC, Newey-West t-stat, quantile spreads, turnover and pre/post-2023 recency gate (no I/O)
This commit is contained in:
parent
306d324b8d
commit
659cd042f6
6 changed files with 2169 additions and 1 deletions
|
|
@ -54,7 +54,11 @@ const risk = returnStatistics(returns);
|
|||
fields in `performanceAnalysis` remain compatibility heuristics, not optimizers.
|
||||
Canonical Deflated Sharpe Ratio (`deflatedSharpeRatio`, `effectiveIndependentTrials`,
|
||||
`trialMoments`, `normalCdf`, `inverseNormalCdf`, `passesDsrGate`, `DSR_VALIDATION_GATE`)
|
||||
is exported from both `./analytics` and the root entry.
|
||||
and cross-sectional Signal Analysis (`analyzeSignalPanel`, `crossSectionIc`,
|
||||
`neweyWestMeanTest`, `defaultNeweyWestLag`, `summarizeIcSeries`, `evaluateRecencyGate`,
|
||||
`SignalAnalysisError`, `DEFAULT_MIN_CROSS_SECTION`, `DEFAULT_QUANTILE_COUNT`,
|
||||
`RECENCY_SPLIT_DATE`, `RECENCY_MIN_RATIO`) are exported from both `./analytics` and
|
||||
the root entry.
|
||||
|
||||
## Benchmark
|
||||
|
||||
|
|
@ -68,6 +72,19 @@ bun run libs/calculations/scripts/benchmark-deflated-sharpe.ts
|
|||
Observed locally on Bun 1.2.16 (2 runs, seed `20260401`): `150.18 ms` (`830,660 pairs/s`)
|
||||
and `159.79 ms` (`780,707 pairs/s`), `meanCorrelation = 0.071187`, `nHat = 464.4776`.
|
||||
|
||||
Run the fixed-seed Signal Analysis benchmark (`5,040` dates × `3,000` names,
|
||||
`15,120,000` observations, covering full `analyzeSignalPanel` with IC, Newey-West HAC,
|
||||
quintile spreads, turnover, and recency gate):
|
||||
|
||||
```sh
|
||||
bun run libs/calculations/scripts/benchmark-signal-analysis.ts
|
||||
```
|
||||
|
||||
Observed locally on Bun 1.2.16 (2 runs, seed `20260402`): `1,664.54 ms`
|
||||
(`3,028 dates/s`, `9,083,609 observations/s`) and `1,659.80 ms` (`3,037 dates/s`,
|
||||
`9,109,520 observations/s`), `meanRankIc = 0.057294`, `rankIcTStat = 218.5078`,
|
||||
`spreadMean = 0.003369`, `recencyGatePassed = true`.
|
||||
|
||||
The root entry exports the supported returns, indicators and market-data helpers.
|
||||
Use subpaths to avoid loading unrelated math. Shared domain types remain owned by
|
||||
`@stock-bot/types`; HTTP/date/proxy helpers remain in `@stock-bot/utils`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue