
Replication script for the Pearl Quest research note
"The Size Factor Measured Three Different Things in 2026".

Every numeric claim in the published note is recomputed here from the CSV files
shipped alongside it. Run:

    pip install pandas numpy statsmodels
    python verify.py

Each check prints the claim as published, the recomputed value, and PASS or FAIL.
A FAIL means the note disagrees with the data and the note is wrong.

Data provenance
---------------
px_adj.csv       IWM, SPY, RSP adjusted daily closes          Alpha Vantage TIME_SERIES_DAILY_ADJUSTED
segments.csv     IJR, IWO, IWN, IJH adjusted daily closes     Alpha Vantage, same endpoint
style_px.csv     IVW IVE IJK IJJ IJT IJS IWF IWD adj closes   Alpha Vantage, same endpoint
panel_tips.csv   the above plus DFII10 real yield and         FRED (St. Louis Fed) series
                 T10YIE breakeven, with daily changes         DFII10 and T10YIE
rolling126.csv   rolling 126-day size betas, precomputed      derived from panel_tips.csv

"Adjusted" means dividend- and split-adjusted, so returns are total returns.
All returns are cumulative log returns in percent unless stated otherwise.

Loaded: px_adj (6769, 3), segments (6626, 4), style_px (824, 8), panel_tips (5849, 13)
Rates panel runs 2003-05-01 to 2026-09-30, 5,849 daily observations

========================================================================================================
METHOD  --  the decomposition is an identity, not a model
========================================================================================================
  SPY and RSP hold the same 500 companies and differ only in weighting, so
  (IWM - SPY) = (IWM - RSP) + (RSP - SPY) holds exactly by construction.
  If the residual below is not zero, the arithmetic in the note is wrong.

  Q1:  total   +5.39  =  size   +0.31  +  concentration   +5.08   residual +0.0000000000
  Q2:  total   +5.34  =  size   +8.72  +  concentration   -3.38   residual +0.0000000000
  Q3:  total   -9.89  =  size   -5.66  +  concentration   -4.23   residual +0.0000000000

========================================================================================================
FINDING ONE  --  the spread measured three different things
========================================================================================================

  Q1 2026-01 to 2026-03
  Q1  IWM return                                         published    0.9200%   computed    0.9213%   PASS
  Q1  RSP return                                         published    0.6100%   computed    0.6102%   PASS
  Q1  SPY return                                         published   -4.4700%   computed   -4.4650%   PASS
  Q1  IWM minus SPY                                      published    5.3900%   computed    5.3863%   PASS
  Q1  size component (IWM - RSP)                         published    0.3100%   computed    0.3111%   PASS
  Q1  concentration component (RSP - SPY)                published    5.0800%   computed    5.0752%   PASS

  Q2 2026-04 to 2026-06
  Q2  IWM return                                         published   19.4200%   computed   19.4209%   PASS
  Q2  RSP return                                         published   10.7000%   computed   10.6990%   PASS
  Q2  SPY return                                         published   14.0800%   computed   14.0808%   PASS
  Q2  IWM minus SPY                                      published    5.3400%   computed    5.3401%   PASS
  Q2  size component (IWM - RSP)                         published    8.7200%   computed    8.7219%   PASS
  Q2  concentration component (RSP - SPY)                published   -3.3800%   computed   -3.3817%   PASS

  Q3 2026-07 to 2026-09
  Q3  IWM return                                         published   -7.5400%   computed   -7.5428%   PASS
  Q3  RSP return                                         published   -1.8800%   computed   -1.8846%   PASS
  Q3  SPY return                                         published    2.3500%   computed    2.3492%   PASS
  Q3  IWM minus SPY                                      published   -9.8900%   computed   -9.8920%   PASS
  Q3  size component (IWM - RSP)                         published   -5.6600%   computed   -5.6582%   PASS
  Q3  concentration component (RSP - SPY)                published   -4.2300%   computed   -4.2339%   PASS

========================================================================================================
FINDING TWO  --  the rate relationship inverted twice
========================================================================================================
  Daily size spread (IWM - RSP) regressed on same-day changes in the
  10-year TIPS real yield (DFII10) and the 10-year breakeven (T10YIE).
  Coefficients are percent of relative return per basis point.


  2003-2021
  2003-2021  real-yield beta                             published    0.0075   computed    0.0075   PASS
  2003-2021  real-yield t-statistic                      published    4.3300   computed    4.3334   PASS
  2003-2021  breakeven beta                              published    0.0127   computed    0.0127   PASS
  2003-2021  breakeven t-statistic                       published    5.0000   computed    5.0020   PASS
  2003-2021  observations                                published 4666.0000   computed 4666.0000   PASS
  2003-2021  real-yield t, Newey-West                    published    2.7200   computed    2.7256   PASS
  2003-2021  breakeven t, Newey-West                     published    3.2500   computed    3.2526   PASS

  2022-2025
  2022-2025  real-yield beta                             published   -0.0092   computed   -0.0092   PASS
  2022-2025  real-yield t-statistic                      published   -2.7300   computed   -2.7279   PASS
  2022-2025  breakeven beta                              published    0.0134   computed    0.0134   PASS
  2022-2025  breakeven t-statistic                       published    2.2000   computed    2.1969   PASS
  2022-2025  observations                                published  996.0000   computed  996.0000   PASS
  2022-2025  real-yield t, Newey-West                    published   -2.3200   computed   -2.3235   PASS
  2022-2025  breakeven t, Newey-West                     published    1.7600   computed    1.7601   PASS

  2026
  2026  real-yield beta                                  published   -0.0393   computed   -0.0393   PASS
  2026  real-yield t-statistic                           published   -2.8600   computed   -2.8600   PASS
  2026  breakeven beta                                   published   -0.0496   computed   -0.0496   PASS
  2026  breakeven t-statistic                            published   -2.0500   computed   -2.0454   PASS
  2026  observations                                     published  187.0000   computed  187.0000   PASS
  2026  real-yield t, Newey-West                         published   -2.6000   computed   -2.6215   PASS
  2026  breakeven t, Newey-West                          published   -1.8100   computed   -1.8231   PASS

  Full-sample nominal relationship, quoted in the appendix.
  full sample  nominal beta                              published    0.0049   computed    0.0049   PASS
  full sample  nominal t-statistic                       published    3.5500   computed    3.5553   PASS
  full sample  R-squared                                 published    0.0020   computed    0.0022   PASS
  This is the figure that falsified the earlier working claim that rates
  drive the size effect in general. Positive sign, negligible magnitude.

  Level context.
  10Y real yield, latest                                 published    2.9300%   computed    2.9300%   PASS
  10Y breakeven, latest                                  published    2.3600%   computed    2.3600%   PASS
  real yield percentile since 2003                       published   99.7000   computed   99.7264   PASS
  2003-2021 average real yield                           published    0.8400%   computed    0.8397%   PASS

========================================================================================================
FINDING THREE  --  duration is a verified mechanism, not the quarter's cause
========================================================================================================
  Part A. Q3 2026 returns by segment, the ordering shown in the note.

  SPY  cap-weighted S&P 500                              published    2.3500%   computed    2.3492%   PASS
  RSP  equal-weighted S&P 500                            published   -1.8800%   computed   -1.8846%   PASS
  IWN  Russell 2000 Value                                published   -5.0500%   computed   -5.0527%   PASS
  IJH  S&P MidCap 400                                    published   -6.6200%   computed   -6.6182%   PASS
  IWM  Russell 2000                                      published   -7.5400%   computed   -7.5428%   PASS
  IJR  S&P SmallCap 600                                  published   -8.2700%   computed   -8.2725%   PASS
  IWO  Russell 2000 Growth                               published   -9.7700%   computed   -9.7658%   PASS

  Part B. The duration test. Growth minus value at four points on the
  size spectrum. Growth and value indices are built by S&P and FTSE Russell
  from constituent valuation multiples, so this IS the multiple sort.
  Under a constant-growth dividend discount model equity duration is
  (1+r)/(r-g) and the P/E multiple is 1/(r-g), so duration is roughly
  proportional to the multiple and growth is the long-duration leg.

  Q3 real yield change                                   published   68.0000 bp   computed   68.0000 bp   PASS
  Q3 breakeven change                                    published   13.0000 bp   computed   13.0000 bp   PASS


  Russell 1000  (IWF minus IWD)
  Russell 1000  2026 real-yield beta                     published   -0.0482   computed   -0.0482   PASS
  Russell 1000  2026 t-statistic                         published   -2.4900   computed   -2.4864   PASS
  Russell 1000  2026 t, Newey-West                       published   -2.9500   computed   -2.9764   PASS
  Russell 1000  Q3 predicted from rates                  published   -2.9600%   computed   -2.9589%   PASS
  Russell 1000  Q3 realized                              published   -1.6500%   computed   -1.6453%   PASS

  S&P 500  (IVW minus IVE)
  S&P 500  2026 real-yield beta                          published   -0.0654   computed   -0.0654   PASS
  S&P 500  2026 t-statistic                              published   -3.3400   computed   -3.3411   PASS
  S&P 500  2026 t, Newey-West                            published   -3.9400   computed   -3.9684   PASS
  S&P 500  Q3 predicted from rates                       published   -4.1600%   computed   -4.1607%   PASS
  S&P 500  Q3 realized                                   published    2.5400%   computed    2.5406%   PASS

  S&P MidCap 400  (IJK minus IJJ)
  S&P MidCap 400  2026 real-yield beta                   published   -0.0314   computed   -0.0314   PASS
  S&P MidCap 400  2026 t-statistic                       published   -2.2600   computed   -2.2571   PASS
  S&P MidCap 400  2026 t, Newey-West                     published   -2.1400   computed   -2.1543   PASS
  S&P MidCap 400  Q3 predicted from rates                published   -2.4600%   computed   -2.4560%   PASS
  S&P MidCap 400  Q3 realized                            published   -0.1600%   computed   -0.1551%   PASS

  S&P SmallCap 600  (IJT minus IJS)
  S&P SmallCap 600  2026 real-yield beta                 published   -0.0287   computed   -0.0287   PASS
  S&P SmallCap 600  2026 t-statistic                     published   -2.8000   computed   -2.7970   PASS
  S&P SmallCap 600  2026 t, Newey-West                   published   -2.5300   computed   -2.5456   PASS
  S&P SmallCap 600  Q3 predicted from rates              published   -2.4000%   computed   -2.3989%   PASS
  S&P SmallCap 600  Q3 realized                          published   -4.5100%   computed   -4.5100%   PASS

  Part C. The same four spreads before 2026, to show the sign flipped.
  Every one was significantly POSITIVE over 2023-2025 and is significantly
  NEGATIVE in 2026. That is the inversion, confirmed four independent ways.

  Russell 1000         2023-2025 real beta +0.0195 (t +2.64)  positive   PASS
  S&P 500              2023-2025 real beta +0.0196 (t +2.77)  positive   PASS
  S&P MidCap 400       2023-2025 real beta +0.0125 (t +3.58)  positive   PASS
  S&P SmallCap 600     2023-2025 real beta +0.0159 (t +4.66)  positive   PASS

  Part D. The conclusion this supports, stated so it can be checked:
  the rate channel inverted at EVERY size, which is what duration predicts,
  AND the realized Q3 ordering contradicts duration at large cap, where
  growth beat value by 2.5 points against a predicted 4.2 point loss.
  Both statements must hold. If either check above failed, the note is wrong.

========================================================================================================
APPENDIX  --  supplementary results quoted in the note
========================================================================================================
  rolling 126d windows, count                            published 5723.0000   computed 5723.0000   PASS
  rolling beta mean                                      published    0.0079   computed    0.0079   PASS
  share of windows negative (%)                          published   26.9000   computed   26.9439   PASS
  share significantly negative (%)                       published    6.3000   computed    6.4127   PASS

  Regime split on the 126-day stock-bond correlation.
  growth-regime share of days (%)                        published   76.0000   computed   76.2865   PASS
  growth regime  size beta                               published    0.0076   computed    0.0076   PASS
  growth regime  t-statistic                             published    4.8700   computed    4.8737   PASS
  inflation regime  size beta                            published   -0.0077   computed   -0.0077   PASS
  inflation regime  t-statistic                          published   -2.5200   computed   -2.5103   PASS
  growth regime  t, Newey-West                           published    3.1300   computed    3.1351   PASS
  inflation regime  t, Newey-West                        published   -1.9600   computed   -1.9598   PASS

========================================================================================================
SUMMARY
========================================================================================================
  90 of 90 checks passed.

  Every figure in the note reproduces from the shipped data.

  What this script does NOT verify, because it cannot:
    - that Alpha Vantage's adjusted closes and FRED's yields are themselves correct
    - the macro narrative (Fed decision, oil prices, CPI), which comes from
      FOMC materials, EIA and BLS and is cited in the note rather than computed
    - the interpretation. The numbers constrain the story; they do not write it.

