Skip to content

Add c15/c16: Granger event controls + non-overlapping anticipation test - #3

Merged
Murad Farzulla (studiofarzulla) merged 1 commit into
mainfrom
add-c15-c16
Aug 4, 2026
Merged

Murad Farzulla (studiofarzulla) merged 1 commit into
mainfrom
add-c15-c16

Conversation

@studiofarzulla

Copy link
Copy Markdown
Collaborator

Adds the two referee-prompted robustness scripts backing the updated manuscript text (c1–c16 pipeline), with their results CSVs and FINDINGs. Both verified to regenerate committed outputs from a clean clone (py3.13; agreement to float noise). Prerequisite for the preprint's updated code-availability statement.

🤖 Generated with Claude Code

…w anticipation test

Referee-prompted robustness runs backing the updated manuscript text:
c15 re-tests the weekly sentiment->volatility lead with the 50 classified
events as exogenous VAR controls (7/7 FDR survivors robust); c16 replaces
the widening-window anticipation sweep with symmetric non-overlapping
[-10,-4] pre-window dummies (infra unanticipated, reg modestly anticipated,
asymmetry attenuates but remains directional and non-significant).
Scripts verified to regenerate committed CSVs from a clean clone (py3.13,
float-noise-level agreement).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 4, 2026 13:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds two robustness-analysis steps (C15 and C16) to the existing c1–c16 pipeline, including the scripts needed to reproduce the analyses plus their committed outputs (CSVs) and accompanying FINDING write-ups for the revised manuscript.

Changes:

  • Add C15 script to re-run weekly sentiment→volatility Granger tests with weekly event-dummy controls (TOTAL and SPLIT specs) and export per-pair + summary CSVs.
  • Add C16 script to estimate a four-window GJR-GARCH-X specification with non-overlapping pre-event dummies ([-10,-4]) alongside the main [-3,+3] event windows, exporting per-asset + cross-asset summary CSVs.
  • Add results artifacts and FINDING markdowns documenting both robustness exercises.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
results/c16-nonoverlap-pre-summary.csv Cross-asset summary output for the non-overlapping pre-window robustness check.
results/c16-nonoverlap-pre-per-asset.csv Per-asset coefficient output for the C16 four-window specification.
results/c16-nonoverlap-pre-FINDING.md Narrative/interpretation of the C16 non-overlap anticipation test.
results/c15-granger-event-dummies.csv Per (asset, sentiment) p-values/lags for uncontrolled vs event-controlled weekly Granger tests.
results/c15-granger-event-dummies-summary.csv Tallies summarizing significance/FDR retention under event controls.
results/c15-event-dummy-FINDING.md Narrative/interpretation of the C15 event-dummy control test.
code/c16_nonoverlap_pre_dummy.py Implements the C16 four-window GJR-GARCH-X re-estimation and summary exports.
code/c15_granger_event_dummies.py Implements the C15 conditional Granger tests with contemporaneous + lagged weekly event controls and FDR reporting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +71 to +93
ev = pd.read_csv(DATA_DIR / "events.csv")
ev["date"] = pd.to_datetime(ev["date"])
wk = pd.DatetimeIndex(week_index)
edges = list(wk) + [wk.max() + pd.Timedelta(days=7)]
ev_all = np.zeros(len(wk))
ev_infra = np.zeros(len(wk))
ev_reg = np.zeros(len(wk))
for _, row in ev.iterrows():
d = row["date"]
# locate the containing week
for i in range(len(wk)):
if edges[i] <= d < edges[i + 1]:
ev_all[i] += 1
if str(row["type"]).lower().startswith("infra"):
ev_infra[i] += 1
elif str(row["type"]).lower().startswith("reg"):
ev_reg[i] += 1
break
out = pd.DataFrame(
{"ev_all": ev_all, "ev_infra": ev_infra, "ev_reg": ev_reg},
index=week_index,
)
return out
Comment on lines +115 to +139
df = pd.DataFrame(rows)
df.to_csv(OUT_DIR / "c16-nonoverlap-pre-per-asset.csv", index=False)

# cross-asset means + naive one-sample t-tests (descriptive)
def summ(col):
v = df[col].values.astype(float)
t, pv = stats.ttest_1samp(v, 0.0)
return np.nanmean(v), np.nanmedian(v), float(t), float(pv)

summary_rows = []
for col, lab in [("d_infra_event", "infra event [-3,+3]"),
("d_reg_event", "reg event [-3,+3]"),
("d_infra_pre", "infra pre [-10,-4]"),
("d_reg_pre", "reg pre [-10,-4]")]:
m, md, t, pv = summ(col)
summary_rows.append({"coefficient": lab, "cross_asset_mean": m,
"median": md, "naive_t_vs0": t, "naive_p_vs0": pv})
sm = pd.DataFrame(summary_rows)
ev_mult = (df["d_infra_event"].mean() / df["d_reg_event"].mean()
if df["d_reg_event"].mean() != 0 else np.nan)
sm_extra = pd.DataFrame([{"coefficient": "event-window multiplier (infra/reg)",
"cross_asset_mean": ev_mult, "median": np.nan,
"naive_t_vs0": np.nan, "naive_p_vs0": np.nan}])
sm = pd.concat([sm, sm_extra], ignore_index=True)
sm.to_csv(OUT_DIR / "c16-nonoverlap-pre-summary.csv", index=False)
@studiofarzulla
Murad Farzulla (studiofarzulla) merged commit 61f8d25 into main Aug 4, 2026
1 check passed
@studiofarzulla
Murad Farzulla (studiofarzulla) deleted the add-c15-c16 branch August 4, 2026 16:21
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.

2 participants