f/reports/adj_consistency/check.md
Greg Pomerantz 5e5a10d725 Fix Yahoo total-distribution double count (1,957 syms)
Yahoo's dividend endpoint returns the fund's TOTAL per-share distribution
(dividend + capital gain) for many share classes while the capitalGains
endpoint returns the cap-gain portion separately; summing both double-counted
cap gains and broke pre/post-tax comparability (after-tax engine could beat
the adj-based pre-tax return: impossible).

Add _fix_total_distributions to the bundle-assembly invariants
(layout-agnostic, survives re-downloads): on same-date div>capg events, the
exact Yahoo-adj implied distribution (d = P - Q*A_{t-1}/A_t) must match the
div-file amount (not the sum) on >=3 dates before rewriting div -= capg.
Self-validating: genuine separate same-date distributions are untouched.
Rewrote 17,900 cells on 1,957 symbols.

Pool check (scripts/check_adj_consistency.py): all 14 symbols now
TR(close+events) == TR(adj) to 0.01pt and post < pre with plausible drags.

Tests: rewrite case, no-rewrite case, idempotency (tests/test_data.py).
2026-09-01 16:23:03 -04:00

1.8 KiB

Adj/event consistency check (window from 2016-01-01)

TR(sim) = pre-tax reinvestment of raw Close + declared dividend/capitalGain events. Must match TR(adj) if Yahoo's adj factor was built from the same history. POST>PRE = post-tax engine would beat pre-tax: impossible, data broken.

sym flag price-only TR(adj) TR(sim) decl yield gap
bntx 35.15% 35.40% 35.40% 1.74% -0.00%
pmaix 3.05% 9.46% 9.46% 64.11% -0.00%
slg -6.29% -0.70% -0.70% 52.61% -0.00%
atesx 4.68% 8.28% 8.28% 30.81% -0.00%
cosix -0.38% 3.88% 3.88% 44.09% +0.00%
egrax 2.53% 6.26% 6.26% 38.84% -0.00%
pfe -0.75% 3.84% 3.84% 45.61% -0.00%
qspnx 0.06% 7.19% 7.19% 68.93% +0.00%
svarx 1.95% 6.98% 6.98% 51.38% +0.00%
cvsix 2.52% 4.67% 4.67% 21.78% +0.00%
flcsx 9.84% 15.75% 15.75% 58.07% -0.00%
menkx 0.58% 3.65% 3.65% 11.96% +0.00%
flpsx 0.21% 11.39% 11.39% 111.47% -0.00%
spy 13.40% 15.23% 15.23% 15.74% -0.00%

details

  • bntx: div 2.11 capg 0.00;
  • pmaix: div 7.28 capg 0.00; same-date 0
  • slg: div 38.81 capg 0.00;
  • atesx: div 0.18 capg 3.88; same-date 0
  • cosix: div 9.48 capg 0.68; same-date 3 (exact 0, div>cap 0)
  • egrax: div 4.00 capg 0.00; same-date 0
  • pfe: div 15.94 capg 0.00;
  • qspnx: div 5.93 capg 0.00; same-date 0
  • svarx: div 9.46 capg 2.45; same-date 7 (exact 0, div>cap 4)
  • cvsix: div 3.08 capg 0.00; same-date 0
  • flcsx: div 8.54 capg 14.82; same-date 20 (exact 1, div>cap 3)
  • menkx: div 1.35 capg 0.00;
  • flpsx: div 8.12 capg 45.49; same-date 20 (exact 0, div>cap 1)
  • spy: div 62.47 capg 0.00;