T-83: M1.4b — Pure event-study math in @stock-bot/calculations: abnormal-return fan (AAR/CAAR) around events, date-clustered Newey-West t-stat and pre/post-2023 split (no I/O)
This commit is contained in:
parent
ff0c5574a4
commit
1a2396916e
5 changed files with 2398 additions and 2 deletions
|
|
@ -57,8 +57,11 @@ const risk = returnStatistics(returns);
|
|||
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.
|
||||
`RECENCY_SPLIT_DATE`, `RECENCY_MIN_RATIO`), plus pure Event-Study math (`eventDayIndex`,
|
||||
`eventStudy`, `EventStudyError`, `DEFAULT_EVENT_PRE_DAYS`, `DEFAULT_EVENT_POST_DAYS`,
|
||||
`DEFAULT_EVENT_MIN_EVENTS`) with date-clustered Newey-West significance, R-7 CAR
|
||||
percentile fans, and a sign-preserving post-2023 recency gate, are exported from both
|
||||
`./analytics` and the root entry.
|
||||
|
||||
## Benchmark
|
||||
|
||||
|
|
@ -85,6 +88,20 @@ Observed locally on Bun 1.2.16 (2 runs, seed `20260402`): `1,779.96 ms`
|
|||
`8,353,819 observations/s`), `meanRankIc = 0.057294`, `rankIcTStat = 218.5078`,
|
||||
`spreadMean = 0.003369`, `recencyGatePassed = true`.
|
||||
|
||||
Run the fixed-seed Event Study benchmark (`2,000` entities × `5,040` sessions,
|
||||
`200,000` events, window `-10..+20`, covering full `eventStudy` with benchmark-adjusted
|
||||
AAR/CAAR, R-7 CAR percentile fans, date-clustered Newey-West HAC, and recency gate):
|
||||
|
||||
```sh
|
||||
bun run test:calculations
|
||||
```
|
||||
|
||||
Observed locally on Bun 1.2.16 (2026-11-28, seed `20260404`):
|
||||
|
||||
```text
|
||||
[event-study benchmark] events=200000 window=-10..+20 elapsedMs=608.09 events/s=328896
|
||||
```
|
||||
|
||||
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