Bootstrapping Backtest Confidence Bands
Variance ratio by block length: does SPY variance scale like independent draws?ranking ·
2026-08-14 · 7×3
One position, one year at a time: SPY annualized Sharpe by calendar yeartable ·
2026-08-14 · 14×5
Measured Sharpe dispersion across non-overlapping SPY windows, 2006 to 2025table ·
2026-08-14 · 5×6
Lag-one autocorrelation: signed returns against absolute returns, 2016 to 2025ranking ·
2026-08-14 · 6×4
Pairs Trading and Cointegration Explained
Weekly z score of the KO/PEP spread, hedge ratio fitted on 2023 onlyseries ·
2026-08-13 · 105×2
Where the KO/PEP spread sat twenty sessions later, by starting z score (2019-2025)ranking ·
2026-08-13 · 6×4
Daily-return correlation vs price-level correlation, five familiar pairs (2024-2025)ranking ·
2026-08-13 · 5×3
Hedge ratio refitted each calendar year, two sector pairsranking ·
2026-08-13 · 7×3
Variance ratio by block length: does SPY variance scale like independent draws?
Variance ratio by block length: does SPY variance scale like independent draws?
| block_length | block_count | variance_ratio |
|---|---|---|
| 2 sessions | 2515 | 0.844 |
| 3 sessions | 1676 | 0.918 |
| 5 sessions | 1005 | 0.809 |
| 10 sessions | 502 | 0.848 |
| 21 sessions | 238 | 0.646 |
| 42 sessions | 118 | 0.632 |
| 63 sessions | 78 | 0.584 |
the exact SQL behind every number
WITH daily AS
(
SELECT
date,
toFloat64(close) / nullIf(lagInFrame(toFloat64(close), 1)
OVER (ORDER BY date ROWS BETWEEN 1 PRECEDING AND CURRENT ROW), 0) - 1 AS ret
FROM global_markets.stocks_daily_aggs
WHERE ticker = 'SPY'
AND date >= '2005-12-01'
AND date < '2026-01-01'
),
indexed AS
(
SELECT
ret,
row_number() OVER (ORDER BY date) AS i
FROM daily
WHERE date >= '2006-01-01'
AND ret IS NOT NULL
),
base AS
(
SELECT varSamp(ret) AS var_1d FROM indexed
),
blocks AS
(
SELECT
k,
intDiv(i, k) AS blk,
count() AS n,
sum(ret) AS block_ret
FROM indexed
CROSS JOIN (SELECT arrayJoin([2, 3, 5, 10, 21, 42, 63]) AS k) AS ks
GROUP BY k, blk
HAVING n = k
)
SELECT
concat(toString(k), ' sessions') AS block_length,
count() AS block_count,
round(varSamp(block_ret) / (k * any(var_1d)), 3) AS variance_ratio
FROM blocks
CROSS JOIN base
GROUP BY k
ORDER BY k
More from this analysisBootstrapping Backtest Confidence Bands
Lag-one autocorrelation: signed returns against absolute returns, 2016 to 2025
ranking 6×4
→
One position, one year at a time: SPY annualized Sharpe by calendar year
table 14×5
→
Measured Sharpe dispersion across non-overlapping SPY windows, 2006 to 2025
table 5×6
→
Hedge ratio refitted each calendar year, two sector pairs
ranking 7×3
→
See all 2,173 queries →