Skip to content

Commit 41f3d8e

Browse files
Merge pull request #6 from zariffromlatif/claude/laughing-gates-gmc4fm
Paper: SSRN-ready typeset PDF, author details, no revision history
2 parents f7b011f + 378c038 commit 41f3d8e

7 files changed

Lines changed: 163 additions & 37 deletions

File tree

‎.gitignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,6 @@ RELEASE_CHECKLIST.md
5050
invoice_template.html
5151
AI Business Idea Generation.pdf
5252
*.pdf
53+
54+
# The typeset working paper is a deliverable, not a build artifact.
55+
!docs/working_paper/detection_timing_backtest_2026-07.pdf

‎docs/working_paper/README.md‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
# Working Paper
22

33
**Detection-Timing Backtest of a Deterministic Downside-Risk Screen Across Three Modern Financial Crises**
4-
Zarif Latif. Revision 2, October 2026 (first version July 2026).
4+
Md. Zarif Latif (BRAC University). Working paper, October 2026.
55

6-
Revision 2's headline finding: the pipeline flagged all 9 affected names before their formal resolution dates, but **no first flag came before the first headline reporting the stock already falling** (Section 4.5). The paper presents the system as fast, auditable triage, not anticipation.
6+
Headline finding: the pipeline flagged all 9 affected names before their formal resolution dates, but **no first flag came before the first headline reporting the stock already falling** (Section 4.5). The paper presents the system as fast, auditable triage, not anticipation.
77

88
## Files
99

1010
- `detection_timing_backtest_2026-07.md` — the paper. Renders on GitHub, Substack, arXiv-style preprint sites. **This is the primary artifact.**
11+
- `detection_timing_backtest_2026-07.pdf` — the typeset PDF (the version posted on SSRN).
1112
- `detection_timing_backtest_2026-07.html` — self-contained HTML. Open in any browser. Save-as-PDF via browser print dialog for a shareable attachment.
1213

1314
## Rebuild the HTML
1415

1516
```bash
16-
python scripts/render_working_paper.py
17+
python scripts/render_working_paper.py # HTML only
18+
python scripts/render_working_paper.py --pdf # HTML + typeset PDF (WeasyPrint)
1719
```
1820

1921
The HTML has all CSS inlined and no external assets, so a single file emailed / posted anywhere renders correctly on any modern browser.
@@ -49,6 +51,6 @@ pytest aetherius/tests/test_market_reaction_check.py -v
4951

5052
## Posting as a preprint
5153

52-
- **SSRN** (ssrn.com, free): good fit under Financial Economics → Risk Management. Upload a PDF made from the HTML (browser print → Save as PDF). No affiliation is required.
54+
- **SSRN** (ssrn.com, free): good fit under Financial Economics → Risk Management. Upload `detection_timing_backtest_2026-07.pdf` (build it with `python scripts/render_working_paper.py --pdf`).
5355
- **arXiv q-fin.RM / q-fin.CP**: a first-time submitter usually needs an endorsement from an existing arXiv author in that category. Ask a professor or a researcher whose work you cite.
5456
- In the abstract, keep the Revision 2 framing: triage at the market reaction, not anticipation.

‎docs/working_paper/detection_timing_backtest_2026-07.html‎

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8">
5-
<title>Detection-Timing Backtest of a Systematic Downside-Risk Screen Across Three Modern Financial Crises</title>
5+
<title>Detection-Timing Backtest of a Deterministic Downside-Risk Screen Across Three Modern Financial Crises</title>
66
<style>
77
:root { color-scheme: light dark; }
88
body {
@@ -38,20 +38,17 @@
3838
</head>
3939
<body>
4040
<h1 id="detection-timing-backtest-of-a-deterministic-downside-risk-screen-across-three-modern-financial-crises">Detection-Timing Backtest of a Deterministic Downside-Risk Screen Across Three Modern Financial Crises</h1>
41-
<p><strong>A working paper. Revision 2.1, October 2026 (first version July 2026).</strong></p>
42-
<p><strong>Author:</strong> Zarif Latif, independent researcher · zarif@aetheriusresearch.tech</p>
43-
<p><strong>Keywords:</strong> risk screening, event study, entity resolution, textual analysis, GDELT, SEC EDGAR, bank failures, backtesting</p>
44-
<p><strong>JEL codes:</strong> G14, G17, G21</p>
45-
<blockquote>
46-
<p><strong>What changed in Revision 2.</strong> Revision 1 reported that the pipeline flagged all nine affected names "before the realized event date," with a median lead of about 2.5 days. That is true, but the realized event date was the <em>formal resolution</em> (receivership, insolvency filing, Chapter 11), not the market's reaction. Revision 2 adds a test of timing against the first headline reporting each stock already falling (Section 4.5). Measured that way, <strong>no first flag came before the market reaction.</strong> Revision 2 also adds confidence intervals, states the hindsight selection of events and watchlists, documents two known false-positive classes, removes commercial framing, and describes a pre-registered live forward test (Section 8). Every number in this revision is reproduced by pinned tests.</p>
47-
<p><strong>What changed in Revision 2.1.</strong> A pre-publication check found that <strong>no control name appears in any of the three corpora</strong>, so the "0 false positives on controls" result was never actually tested. Text in Revisions 1 and 2 describing control headlines was wrong and has been removed. Section 4.6 explains what happened. Revision 2.1 also adds related work and references, and discloses that the Section 4.5 price-reaction pattern was written after the headlines had been read.</p>
48-
</blockquote>
49-
<hr />
41+
<p><strong>Md. Zarif Latif</strong><br />
42+
Undergraduate Student, BRAC University, Dhaka, Bangladesh<br />
43+
md.zarif.latif@g.bracu.ac.bd</p>
44+
<p>Working paper · October 2026</p>
5045
<h2 id="abstract">Abstract</h2>
5146
<p>We replay a deterministic entity-mapping and severity-scoring pipeline against real news headlines from three well-studied financial crises: the March 2023 U.S. regional-bank contagion, the June 2020 Wirecard AG accounting fraud and the November 2022 FTX collapse. For each affected name we report detection timing and how it compares with the market's own reaction.</p>
5247
<p>On 161 archived observations from GDELT DOC 2.0, the pipeline flagged <strong>all 9 affected names</strong> at "elevated" or "high" severity before each name's formal resolution date, with a median lead of 2.48 days. With only nine names, the 95% confidence interval for recall is 66–100%. The study's three control names never appear in the corpus, so it provides <strong>no evidence about false positives</strong>.</p>
5348
<p>The more important finding is about timing. In all 9 detections, the first flag arrived <strong>at the same time as, not before,</strong> the first headline reporting that the stock was already falling. In 8 of 9 it <em>was</em> that headline. The pipeline is therefore evidence of fast, auditable <strong>triage</strong> of a market reaction already underway. It is not evidence of anticipating the market. We describe the pipeline, the corpus and the ground truth, discuss the limitations, and describe a pre-registered live forward test started on 2026-10-16. All code and data are Apache-2.0 licensed and reproducible.</p>
5449
<p><strong>This is detection-timing evidence on frozen historical windows. It is not a return forecast, a trading signal, or a causal claim.</strong></p>
50+
<p><strong>Keywords:</strong> risk screening, event study, entity resolution, textual analysis, GDELT, SEC EDGAR, bank failures, backtesting</p>
51+
<p><strong>JEL codes:</strong> G14, G17, G21</p>
5552
<hr />
5653
<h2 id="1-motivation">1. Motivation</h2>
5754
<p>Concentrated public-equity books, such as those of search funds, small family offices, litigation-finance analysts and small credit shops, carry large single-name risk. Professional surveillance products are priced and configured for large institutional teams.</p>
@@ -89,7 +86,7 @@ <h3 id="23-severity-scoring">2.3 Severity scoring</h3>
8986
</ul>
9087
<p><code>severity_label()</code> bins risk into <code>low</code>, <code>moderate</code>, <code>elevated</code> or <code>high</code>. Every weight is a constant, and there are no learned parameters.</p>
9188
<h3 id="24-adverse-language-gate">2.4 Adverse-language gate</h3>
92-
<p><code>adverse_severity(raw_text)</code> (same module) counts matches against a fixed list of about 40 downside terms (<code>loss</code>, <code>plunge</code>, <code>withdrawals</code>, <code>deposit run</code>, <code>receivership</code>, <code>collapse</code>, <code>funding pressure</code>, <code>distress</code>, <code>insolven…</code>, …) and maps the count to an event-severity score. An observation is a <strong>shippable flag</strong> only when its severity label is <code>elevated</code> or <code>high</code> <strong>and</strong> at least one adverse term is present. Unit tests show the gate holding a benign direct mention below shippable severity (for example, "Microsoft expands Copilot across product suite"). The backtest corpora contain no such case for the controls (Section 4.6). Since Revision 2, the live API, the backtest and the forward test all import this single implementation.</p>
89+
<p><code>adverse_severity(raw_text)</code> (same module) counts matches against a fixed list of about 40 downside terms (<code>loss</code>, <code>plunge</code>, <code>withdrawals</code>, <code>deposit run</code>, <code>receivership</code>, <code>collapse</code>, <code>funding pressure</code>, <code>distress</code>, <code>insolven…</code>, …) and maps the count to an event-severity score. An observation is a <strong>shippable flag</strong> only when its severity label is <code>elevated</code> or <code>high</code> <strong>and</strong> at least one adverse term is present. Unit tests show the gate holding a benign direct mention below shippable severity (for example, "Microsoft expands Copilot across product suite"). The backtest corpora contain no such case for the controls (Section 4.6). The live API, the backtest and the forward test all import this single implementation.</p>
9390
<h3 id="25-backtest-harness">2.5 Backtest harness</h3>
9491
<p><code>simulations/backtest/run_backtest.py</code> replays each event's <code>observations.jsonl</code> in chronological order against its <code>watchlist.json</code> and <code>ground_truth.json</code>, records the first shippable flag per name, and computes:</p>
9592
<ul>
@@ -371,10 +368,10 @@ <h3 id="45-timing-relative-to-the-market-reaction">4.5 Timing relative to the ma
371368
</tbody>
372369
</table>
373370
<p><strong>No first flag came before the market reaction.</strong> The pipeline flagged each name at the moment the press reported its shares falling. This is expected given how it works: adverse-language scoring of headlines fires most strongly on headlines <em>about</em> a sell-off.</p>
374-
<p>That is still useful for a small team. Out of hundreds of headlines, the names that need attention today were surfaced within the same news cycle, with an auditable reason. But it is <strong>triage, not anticipation</strong>, and Revision 1's framing of "lead time" overstated what the evidence supports.</p>
371+
<p>That is still useful for a small team. Out of hundreds of headlines, the names that need attention today were surfaced within the same news cycle, with an auditable reason. But it is <strong>triage, not anticipation</strong>, and lead time measured to formal resolution overstates what the evidence supports.</p>
375372
<h3 id="46-the-control-test-was-not-exercised">4.6 The control test was not exercised</h3>
376373
<p>Each fixture includes one control name (MSFT twice, DTE once) that the pipeline should not flag. None did, but none could have: <strong>no observation in any corpus maps to a control name.</strong> The fixture builder did query GDELT for each control ("Microsoft Corporation", "Deutsche Telekom"), and GDELT returned articles. GDELT matches article bodies, but the pipeline stores and scores headlines only, and none of those headlines names the control. <code>market_reaction_check.py</code> prints this coverage, and a test (<code>test_controls_never_appear_in_the_frozen_corpora</code>) pins it so the paper must be updated if a fixture is ever rebuilt.</p>
377-
<p>Revisions 1 and 2 reported "0 false positives on 3 controls" as evidence of specificity, and described control headlines that do not exist in the data. Both were errors. This study therefore says nothing about how often the screen fires on companies that turned out fine. The same fact makes the 100% mapping precision uninformative. Measuring false positives is the purpose of the forward test (Section 8).</p>
374+
<p>Earlier project materials (the repository README and website) presented "0 false positives on 3 controls" as evidence of specificity; that claim is withdrawn. This study therefore says nothing about how often the screen fires on companies that turned out fine. The same fact makes the 100% mapping precision uninformative. Measuring false positives is the purpose of the forward test (Section 8).</p>
378375
<hr />
379376
<h2 id="5-limitations">5. Limitations</h2>
380377
<h3 id="51-what-this-measures-and-what-it-does-not">5.1 What this measures and what it does not</h3>
@@ -533,7 +530,7 @@ <h2 id="appendix-c-primary-sources">Appendix C — Primary sources</h2>
533530
<h2 id="appendix-d-reproducibility">Appendix D — Reproducibility</h2>
534531
<ul>
535532
<li><strong>License:</strong> Apache-2.0.</li>
536-
<li><strong>Tests:</strong> the full suite (122 tests at Revision 2.1) pins the backtest metrics, the Section 4.5 timing result, the Section 4.6 control coverage, and the parity between live and backtest scoring.</li>
533+
<li><strong>Tests:</strong> the full suite (122 tests at the time of writing) pins the backtest metrics, the Section 4.5 timing result, the Section 4.6 control coverage, and the parity between live and backtest scoring.</li>
537534
<li><strong>Determinism:</strong> scoring weights are constants with no learned parameters, and reruns are bit-identical.</li>
538535
<li><strong>Rebuild:</strong> corpora can be regenerated from GDELT DOC 2.0 with <code>simulations/backtest/build_fixture.py</code>.</li>
539536
</ul>

0 commit comments

Comments
 (0)