Paper A v13 rev9.2: firm-key unification + canonical-number reconciliation (rev9.1 review R1-R6)
Resolve the Firm C/D "two-snapshot" inconsistency from the co-author rev9.1 review. Root cause was NOT stale data but two live firm-assignment keys (assigned_accountant-> registry firm vs the excel_firm column) used inconsistently across tables; standardize on the registry key, which the headline Table IV/II-b already use. Sole difference = 379 signatures with excel_firm=C but registry firm=D; A and B identical under both keys. Numbers (all DB-verified, registry key, n=150,442): - Table II-c Firm C/D recomputed (was mixing keys within firm C across periods, which manufactured the spurious "third value" 38,934); now C 22,449+16,164=38,613, D 9,945+7,188=17,133, all four firms reconcile. - Table VI C/D counts + S III-B prose + Fig 3/6 captions -> 150,442. - S V-B HC-rate text -> Firm C 21.6->26.7%, Firm D 22.0->28.0%. Note on R4: the reviewer (PDF-only) asked to change S IV-C to 26.5/28.5 to match Table II-c; DB verification showed the reverse - S IV-C's 26.7/28.0 are correct and Table II-c was the stale outlier, so II-c was aligned to S IV-C (data-correct, opposite to the literal instruction). Accountant counts (R2 reviewer "179>171 impossible" = false positive; three distinct, all-reproducible universes): Table I + S III-B -> 457 (>=2 sig, owns the 150,442 signatures); Table III documented as the 437 with >=10 signatures (K=3 GMM subset, reproduces A=82.5/B=0.0/C=1.0/D=1.9% exactly); bootstrap 179/280 unchanged (accountant_id key, correct and invariant to the A-vs-BCD contrast). R3 (corpus scope): S III-B reworded - corpus = all retrievable reports, Big-4 as the primary analysis sample (removes the "corpus = four firms" vs "non-Big-4 in robustness" contradiction); per-firm counts now explicitly labelled A/B/C/D. R5 (spelling): unify to American (artefact->artifact x11, centred->centered, behaviour->behavior, analyse(d)->analyze(d), favours->favors). R6: delete non-standard "(+)" marker in S IV-C. Figures regenerated under the registry key: make_fig3_density.py and make_fig6_sensitivity.py switched to the assigned_accountant join (fig3/fig6 n=150,442); fig4/fig5 refreshed. FE/LOYO/bootstrap re-validated exactly (ORs 0.116/0.061/0.070, LOYO 53.1-54.9pp, full 53.7pp). Add CANONICAL_NUMBERS_rev9.1.md with full provenance, the analyzable/GMM definitions, and the firm-key root cause. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K35dXhb9XEM1mnYz6SSHpU
This commit is contained in:
@@ -15,11 +15,11 @@ BIG4 = ('勤業眾信聯合', '資誠聯合', '安侯建業聯合', '安永聯
|
||||
con = sqlite3.connect(DB)
|
||||
cur = con.cursor()
|
||||
cur.execute(f"""
|
||||
SELECT max_similarity_to_same_accountant, min_dhash_independent
|
||||
FROM signatures
|
||||
WHERE is_valid=1 AND max_similarity_to_same_accountant IS NOT NULL
|
||||
AND min_dhash_independent IS NOT NULL
|
||||
AND excel_firm IN ({','.join(['?']*4)})
|
||||
SELECT s.max_similarity_to_same_accountant, s.min_dhash_independent
|
||||
FROM signatures s JOIN accountants a ON s.assigned_accountant=a.name
|
||||
WHERE s.max_similarity_to_same_accountant IS NOT NULL
|
||||
AND s.min_dhash_independent IS NOT NULL
|
||||
AND a.firm IN ({','.join(['?']*4)})
|
||||
""", BIG4)
|
||||
rows = cur.fetchall()
|
||||
con.close()
|
||||
|
||||
@@ -14,10 +14,11 @@ DB = "/Volumes/NV2/PDF-Processing/signature-analysis/signature_analysis.db"
|
||||
BIG4 = ('勤業眾信聯合', '資誠聯合', '安侯建業聯合', '安永聯合')
|
||||
|
||||
con = sqlite3.connect(DB); cur = con.cursor()
|
||||
cur.execute(f"""SELECT CASE WHEN excel_firm='勤業眾信聯合' THEN 1 ELSE 0 END isA,
|
||||
max_similarity_to_same_accountant c, min_dhash_independent d
|
||||
FROM signatures WHERE is_valid=1 AND excel_firm IN ({','.join('?'*4)})
|
||||
AND max_similarity_to_same_accountant IS NOT NULL AND min_dhash_independent IS NOT NULL""", BIG4)
|
||||
cur.execute(f"""SELECT CASE WHEN a.firm='勤業眾信聯合' THEN 1 ELSE 0 END isA,
|
||||
s.max_similarity_to_same_accountant c, s.min_dhash_independent d
|
||||
FROM signatures s JOIN accountants a ON s.assigned_accountant=a.name
|
||||
WHERE a.firm IN ({','.join('?'*4)})
|
||||
AND s.max_similarity_to_same_accountant IS NOT NULL AND s.min_dhash_independent IS NOT NULL""", BIG4)
|
||||
rows = cur.fetchall(); con.close()
|
||||
isA = np.array([r[0] for r in rows], bool)
|
||||
c = np.array([r[1] for r in rows]); d = np.array([r[2] for r in rows])
|
||||
|
||||
Reference in New Issue
Block a user