Quant Memo
Advanced

The Wild Bootstrap

A bootstrap variant built for regression with heteroskedastic errors — instead of resampling rows, it keeps every observation's x fixed and randomly flips the sign (or scale) of each residual, preserving each point's own error variance.

Prerequisites: Bootstrap and Resampling, The Classical Linear Regression Assumptions

You've run a regression of trade cost against order size, and the residuals clearly fan out — small orders have tight, predictable costs, large orders have wild, unpredictable costs. This is heteroskedasticity, and it breaks the usual bootstrap trick of resampling whole rows of data: shuffling rows around mixes up which residual variance belongs with which order size, destroying exactly the pattern you're trying to preserve. The wild bootstrap fixes this by never actually resampling observations at all — it keeps every xix_i and every residual's magnitude exactly where it was, and only randomizes the residual's sign.

An analogy: shaking a tree, not swapping branches

Imagine a tree where each branch has a different amount of natural sway — thick low branches barely move, thin high branches whip around wildly. To simulate "what if the wind blew differently today," you wouldn't swap a thick branch's motion onto a thin branch's position — that would misrepresent how much each branch can actually move. Instead you'd let each branch keep its own natural range of motion and just randomize which direction, left or right, it happens to sway on a given gust. The wild bootstrap does exactly this to regression residuals: each residual keeps its own magnitude (its own "amount of sway," tied to its original observation's variance) and only its sign gets randomly flipped.

The idea, one symbol at a time

Given a fitted regression yi=β^xi+e^iy_i = \hat{\beta}' x_i + \hat{e}_i with residuals e^i\hat{e}_i, the wild bootstrap generates a pseudo-dataset by

yi=β^xi+e^ivi,y_i^* = \hat{\beta}' x_i + \hat{e}_i \cdot v_i,

where viv_i is drawn independently for each observation ii from a simple two-point distribution — most commonly the Rademacher distribution, vi=+1v_i = +1 or 1-1 each with probability 1/21/2. In plain English: keep the fitted line and every xix_i exactly as they were, and for each observation randomly either keep its residual as-is or flip its sign — never swap a residual from one observation onto another observation's xix_i. Refitting the regression on many such pseudo-datasets yiy_i^* and collecting the resulting coefficient estimates β^\hat{\beta}^* builds a distribution that reflects each observation's own error variance, because e^ivi\hat{e}_i \cdot v_i always has exactly the magnitude of e^i\hat{e}_i, whatever the sign — unlike resampling rows, which could easily place a small-order residual next to a large-order xix_i or vice versa.

Worked example 1: three points by hand

Suppose a tiny regression with 3 residuals: e^1=0.5\hat{e}_1 = 0.5 (small order, small residual), e^2=3.0\hat{e}_2 = -3.0 (large order, large residual), e^3=2.8\hat{e}_3 = 2.8 (large order, large residual). One wild bootstrap draw might sample v=(+1,1,+1)v = (+1, -1, +1), giving pseudo-residuals (0.5,3.0,2.8)(0.5, 3.0, 2.8) — note e^2(1)=3.0×1=3.0\hat{e}_2 \cdot (-1) = -3.0 \times -1 = 3.0. A different draw might give v=(1,+1,1)v=(-1,+1,-1), giving (0.5,3.0,2.8)(-0.5, -3.0, -2.8). In both cases, observation 1's contribution stays small and observations 2 and 3's stay large — a naive row-resampling bootstrap could instead draw observation 1 three times, producing three small residuals and completely losing the fact that large orders carry more uncertainty.

Worked example 2: comparing standard errors

Suppose the standard OLS formula (assuming constant residual variance) gives a standard error of 0.400.40 for the order-size coefficient, but the data is known to be heteroskedastic. Running B=1,000B=1{,}000 wild bootstrap replications, refitting the regression each time and recording β^\hat{\beta}^*, might produce a spread with standard deviation 0.630.63 — noticeably wider than the naive OLS standard error, correctly reflecting the extra uncertainty contributed by the large, volatile residuals at high order sizes that the constant-variance formula ignored. Using the naive 0.400.40 instead of the wild-bootstrap-based 0.630.63 would make the coefficient's confidence interval look artificially tight, potentially leading you to treat a noisy estimate as more precise than it really is.

fitted line small e, fixed large e, sign flips large e, sign flips
Each residual's magnitude stays tied to its own x position; only the sign is randomized each bootstrap draw, preserving the fan-shaped variance pattern instead of scrambling it.
naive OLS se=0.40 wild bootstrap se=0.63
The wild bootstrap's spread of refitted coefficients is wider than the naive constant-variance formula, correctly reflecting the heteroskedastic residual structure the formula ignores.

What this means in practice

The wild bootstrap is the standard fix whenever you need bootstrap standard errors or confidence intervals for a regression with residuals that clearly change in variance across the range of the data — common in market-impact regressions, cost models, and anywhere order size or trade size varies widely. It's also the preferred approach in small-sample or few-cluster settings (clustered wild bootstrap) where standard cluster-robust formulas are known to be unreliable.

The wild bootstrap resamples regression residuals in place by randomly flipping their sign (keeping every observation's x and its own residual magnitude fixed), rather than resampling whole rows — this preserves heteroskedastic error structure that a naive row-resampling bootstrap would scramble.

The wild bootstrap fixes heteroskedasticity but does nothing about autocorrelation between residuals — if your regression residuals are also serially correlated (common in time series regressions with overlapping windows or persistent trading signals), sign-flipping each residual independently still assumes they're independent across observations, which a purely heteroskedasticity-focused fix does not address. A block or cluster wild bootstrap is needed when both problems are present at once.

Related concepts

Practice in interviews

Further reading

  • Wu, 'Jackknife, Bootstrap and Other Resampling Methods in Regression Analysis', Annals of Statistics
  • MacKinnon, 'Wild Cluster Bootstrap Confidence Intervals'
ShareTwitterLinkedIn