Quant Memo
Core

Hypothesis Testing

The Neyman–Pearson framework for deciding between hypotheses under uncertainty, type I and II errors, power, the most-powerful-test lemma, and the likelihood-ratio test that generalizes it.

Prerequisites: Maximum Likelihood Estimation (MLE), The Central Limit Theorem

A hypothesis test is a decision rule under uncertainty: given noisy data, decide whether to reject a default claim. For a quant this is the machinery that separates a real edge from a lucky backtest, is this strategy's Sharpe genuinely positive, is this factor loading real, does this series have a unit root? The Neyman–Pearson framework makes the decision, and its accounting of the two ways you can be wrong is the part most people get sloppy about and desks pay for.

The setup: null, alternative, and two errors

State a null hypothesis H0H_0 (the skeptical default, "no edge," μ=0\mu = 0) and an alternative H1H_1. A test is a rule that maps the data to {reject, don't reject} H0H_0, defined by a rejection region. Because the data are random, two errors are possible:

H0H_0 trueH1H_1 true
Reject H0H_0Type I error (α\alpha)correct
Don't rejectcorrectType II error (β\beta)

The type I error rate (size, significance level) is α=P(reject H0H0)\alpha = \mathbb{P}(\text{reject } H_0 \mid H_0), a false discovery. The type II error rate is β=P(don’t rejectH1)\beta = \mathbb{P}(\text{don't reject} \mid H_1), a missed discovery. The power is 1β=P(rejectH1)1 - \beta = \mathbb{P}(\text{reject} \mid H_1), the probability of catching a real effect. The Neyman–Pearson philosophy is asymmetric: fix α\alpha at a tolerable level (say 5%), then find the test that maximizes power.

Constructing a test statistic

The standard recipe: form a test statistic TT whose distribution under H0H_0 is known, and reject when TT lands in the tail. For a sample mean with known variance, the zz-statistic

z=xˉμ0σ/n d N(0,1)under H0:μ=μ0,z = \frac{\bar x - \mu_0}{\sigma/\sqrt{n}} \ \xrightarrow{d}\ \mathcal{N}(0,1) \quad \text{under } H_0: \mu = \mu_0,

by the The Central Limit Theorem. A two-sided test at level α\alpha rejects when z>z1α/2|z| > z_{1-\alpha/2} (e.g. 1.961.96 for α=0.05\alpha = 0.05). When σ\sigma is estimated, TT follows a tn1t_{n-1} distribution. The rejection threshold is the critical value; comparing TT to it is mechanically identical to comparing a p-value to α\alpha.

The Neyman–Pearson lemma

For a simple null H0:θ=θ0H_0: \theta = \theta_0 against a simple alternative H1:θ=θ1H_1: \theta = \theta_1, which test is most powerful at level α\alpha? The Neyman–Pearson lemma answers definitively: the most powerful test rejects when the likelihood ratio exceeds a threshold,

Λ=L(θ1)L(θ0)>k,\Lambda = \frac{L(\theta_1)}{L(\theta_0)} > k,

with kk chosen so the size is exactly α\alpha. The intuition is exactly right, reject in favor of θ1\theta_1 precisely where the data are relatively more probable under θ1\theta_1 than under θ0\theta_0, and rank observations by that ratio. Every optimal test in classical statistics is, at bottom, a likelihood-ratio comparison.

The likelihood-ratio, Wald, and score tests

Real hypotheses are usually composite (e.g. H0:μ0H_0: \mu \le 0, or nested models). The generalized likelihood-ratio test uses

λ=supθΘ0L(θ)supθΘL(θ),\lambda = \frac{\sup_{\theta \in \Theta_0} L(\theta)}{\sup_{\theta \in \Theta} L(\theta)},

the ratio of the best fit under the null to the best fit overall. Wilks' theorem gives its asymptotic null distribution: 2logλdχq2-2\log\lambda \xrightarrow{d} \chi^2_q, where qq is the number of restrictions. This is the standard way to test whether adding parameters (an extra factor, a GARCH term) significantly improves fit. Two asymptotically equivalent cousins complete the "holy trinity":

  • Wald test, estimate the unrestricted model and check whether the restriction is far from satisfied, scaled by the estimate's covariance: W=(Rθ^r)[Var]1(Rθ^r)W = (R\hat\theta - r)^\top [\operatorname{Var}]^{-1}(R\hat\theta - r). The ordinary tt- and FF-statistics are Wald tests.
  • Score (Lagrange multiplier) test, estimate only the restricted model and check whether the score is far from zero there. Cheap when the restricted model is easy to fit; the standard ARCH and Breusch–Pagan tests are LM tests.

All three agree asymptotically but can differ in finite samples; Wald is sensitive to how the restriction is parameterized, LR is invariant.

Worked example: is a strategy's Sharpe positive?

A strategy returns a mean rˉ\bar r with sample volatility σ^\hat\sigma over nn periods. Test H0:μ=0H_0: \mu = 0 against H1:μ>0H_1: \mu > 0. The tt-statistic is t=rˉ/(σ^/n)=SR^nt = \bar r /(\hat\sigma/\sqrt n) = \widehat{\text{SR}}\cdot\sqrt{n}, the tt-stat is just the annualized-appropriately Sharpe times the root of the sample size. With a Sharpe of 0.50.5 (annual) over 4 years, t0.5×2=1.0t \approx 0.5 \times 2 = 1.0: not close to the 1.651.65 one-sided threshold. To get t=1.65t = 1.65 at Sharpe 0.50.5 you need about 11 years. This computation is why claims of "significant" edge from short backtests deserve suspicion, the power to detect realistic Sharpes is low, and the multiple-testing inflation of α\alpha (below) makes the false-discovery problem worse.

Failure modes in financial data

  • Autocorrelation destroys the null distribution. The t=SR^nt = \widehat{\text{SR}}\sqrt n formula assumes i.i.d. returns; serial correlation and overlapping windows make the true standard error larger, so naive tt-stats over-reject. Use HAC (Newey–West) standard errors. See Autocorrelation and Serial Correlation.
  • Low power is the norm. Real edges are small and data are short; most honest tests of trading signals are badly underpowered, so "failed to reject" almost never means "no effect."
  • Non-standard distributions under the null. Testing on the boundary (a variance =0= 0, a unit root) breaks the usual χ2\chi^2/normal asymptotics, Dickey–Fuller statistics have their own tables precisely for this reason. See Unit Roots and the ADF Test.
  • Data snooping. Choosing the hypothesis after seeing the data, or testing thousands of signals, invalidates the fixed-α\alpha guarantee entirely. This is the single biggest inferential danger in quant research. See p-values and Multiple Testing and Overfitting.

In interviews

Define type I and type II errors precisely and without hesitating, swapping them is an instant tell. Explain that you fix α\alpha and then maximize power, and be able to state the Neyman–Pearson lemma (most powerful test is a likelihood-ratio threshold). Know the trinity, LR, Wald, score, and one distinguishing fact each (Wald needs only the unrestricted fit, score needs only the restricted fit, LR needs both and is parameterization-invariant). The killer applied question is "your backtest shows t=2.1t = 2.1, are you convinced?" and the graduate answer names autocorrelation-inflated standard errors and multiple testing before celebrating.

Related concepts

Practice in interviews

Further reading

  • Casella & Berger, Statistical Inference (Ch. 8)
  • Lehmann & Romano, Testing Statistical Hypotheses
  • Greene, Econometric Analysis (Ch. 5)
ShareTwitterLinkedIn