- Date: 2026-11-17
- Status: Agreed 2026-11-25 (proposed by Areej)
- Agreed by: Mahad (2026-11-25), for the team
Context
The streaming vs batch comparison (task #9) needs the batch CARs (the “answer key”, task #8) in a known format. The report needs significance tests that hold up even though all retailers share the same event dates. Decision 0004 fixed the study settings; this decision fixes the outputs.Decision
batch_event_carhas exactly the columns ofstream_event_car, computed bysrc/eventstudy/car.pyfromclean/master.parquetwith the settings incommon.study. Same keys (ticker,event_type,event_date), events fromexpand_events, day 0 the first trading day on or after the event date, one market model per window fitted on days −125..−6. Attention z-scores follow the stream’s rule. The comparison expects equal values. Checked on 2026-11-17: all 600 windows match the streaming logic (streaming.signals.update) to about 1e-15.- The batch code is written independently of
src/streaming/signals.py(numpy on whole arrays instead of day-by-day state), so agreement checks both. - Significance (
src/eventstudy/stats.py, tablesbatch_car_summaryandbatch_car_trend):- the main test and the confidence intervals use standard errors clustered by event date (day 0), because the 10 retailers’ CARs on the same date are not independent
- also reported: the t-test, the Wilcoxon signed-rank test and a BMP-style test on
car_z(without BMP’s prediction-error correction) - online vs store: the difference of group means per event date, tested across dates
- trend: the mean CAR of each event date regressed on its year
allevent types: windows with the same ticker and day 0 (US Thanksgiving and Black Friday) count once- the confidence level is
common.study.CONFIDENCE(95%)
- Outputs go to
data/results/(gitignored); each file has a.jsonnext to it with the code version that made it.
Alternatives considered
- Only the t-test: it treats 100 Black Friday windows as 100 independent results when there are really 10 event dates, so p-values come out too small. On our data, Prime Day’s p-value is 0.014 under the plain t-test but 0.054 clustered.
- A smaller batch output (CAR only): simpler, but the comparison could then not check alpha, beta,
n_daysor the attention columns.
Consequences
- Mahad: task #9 can join
data/results/batch_event_car.parquetto the stream’sevent_caronticker, event_type, event_dateand expect zero difference. Runpython3 src/eventstudy/car.pyfirst (about 2 seconds). - Report: quote
p_clusteredand the clustered confidence intervals as the main result, and staten_eventsandn_tickersin every table. scipyis added torequirements.txt.