> For the complete documentation index, see [llms.txt](https://laurence-wilse-samson.gitbook.io/textbooks/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://laurence-wilse-samson.gitbook.io/textbooks/financial-economics-claims-prices-holders/appendices/appendix_a_empirical_methods.md).

# Appendix A: Empirical Methods in Finance

*Appendices — Financial Economics: Claims, Prices, and Holders*

***

## A.0 How to Read This Appendix

Chapter 1 promised that the finance-specific empirical machinery would be built here from scratch, and that a course adopting this book would not need a second one. This appendix keeps that promise, and the promise sets its rules.

**The self-containment rule.** A course prerequisite cannot live in a book the reader does not own. Everything Chapters 6, 7, 17, 19, 22 and 24 need in order to be *executable* — not merely intelligible — is developed here, worked, with an example that runs on data anyone can download. The companion *Empirical Methods* volume is referenced in a handful of places, and never for something you need in order to proceed: only for asymptotic theory, alternative estimators, and panel methods this book does not invoke. If a cross-reference in this appendix ever becomes load-bearing, it is a defect.

**What is assumed.** One statistics course at the level of multiple regression, and calculus through partial derivatives. Matrix notation is used and is explained where it appears. Nothing here requires measure theory, and nothing requires a prior course in econometrics. Readers who have had one will find §A.1 familiar and should start at §A.2, where the finance-specific material begins.

**Notation.** The symbols are `NOTATION.md`'s, unchanged. Excess returns are $$r\_i - r\_f$$ in net terms, factors are $$f\_k$$ with realization $$f\_{k,t}$$, loadings are $$\beta\_{i,k}$$, prices of risk are $$\lambda\_k$$, pricing errors are $$\alpha\_i$$. Hats mark estimates. The number of test assets is $$N$$, the number of factors $$K$$, the number of periods $$T$$. In §A.4 the abnormal return is $$AR\_{i,t}$$ and its cumulation $$CAR\_i(t\_1,t\_2)$$, both set in roman.

**The free-data-first rule.** Every worked example runs on a free source: Kenneth French's data library at Dartmouth, FRED, Robert Shiller's long-run file, the Federal Reserve's meeting calendar, or EDGAR. Where a licensed source (CRSP, Compustat, IBES) would let you do something better, that extension is marked ★ and is genuinely optional. Appendix B documents every source; this appendix documents what to do with them. Each section's worked example corresponds to a committed script under `code/appendix_a/`, so that a reader who wants the numbers rather than the argument can run them.

**A warning about the numbers printed here.** Where a table is labeled *Author's construction*, the data are invented so that the arithmetic can be checked by hand; the point is the procedure, not the magnitude. Where a magnitude is attributed to a published paper, it is that paper's. Where a table reports what a script on live data returns, the vintage is stated, and a reader running the same code on a later download will get numbers close to but not identical to these. Conflating the three is the most common way a methods appendix misleads.

***

## A.1 The Regression Baseline

Almost every empirical statement in Part II is a regression coefficient or a function of one. This section states what the coefficient is, what its standard error should be, and — the part that matters in finance and is usually skipped — why the standard error your software prints by default is wrong in most of the regressions this book runs.

### A.1.1 OLS in the notation this book uses

The workhorse is the **time-series regression** of one asset's excess return on the returns of $$K$$ factors:

$$
r\_{i,t} - r\_{f,t} = \alpha\_i + \sum\_{k=1}^{K} \beta\_{i,k} f\_{k,t} + \varepsilon\_{i,t}, \qquad t = 1,\dots,T
$$

Stack it. Let $$y$$ be the $$T \times 1$$ vector of asset $$i$$'s excess returns, and let $$X$$ be the $$T \times (K+1)$$ matrix whose first column is a column of ones and whose remaining columns are the factor returns. Write $$b = (\alpha\_i, \beta\_{i,1}, \dots, \beta\_{i,K})'$$ — a stacking device only, used so the algebra can be written once; the SDF coefficients $$b\_k$$ of §3.6, which reappear in §A.5.4, are a different object, always carry a factor subscript, and never appear in the same expression. Ordinary least squares chooses $$\hat b$$ to minimize the sum of squared residuals $$(y - Xb)'(y - Xb)$$; differentiating and setting the derivative to zero gives the **normal equations** $$X'X\hat b = X'y$$ and therefore

$$
\hat b = (X'X)^{-1}X'y, \qquad \hat\varepsilon = y - X\hat b
$$

The residuals are orthogonal to every regressor by construction, $$X'\hat\varepsilon = 0$$ — an algebraic fact about least squares, true whatever the data-generating process, and worth saying out loud because a good deal of confusion in empirical finance comes from reading it as an economic result. It says only that OLS has fitted whatever linear relation is in the sample.

Two objects carry all the economic content. The slope $$\hat\beta\_{i,k}$$ is the asset's **loading** on factor $$k$$ — in the single-factor case, $$\hat\beta\_i = \widehat{\mathrm{Cov}}(r\_i, f)/\widehat{\mathrm{Var}}(f)$$, exactly the object `NOTATION.md`'s core block defines. The intercept $$\hat\alpha\_i$$ is the **pricing error**: the average excess return the asset delivered that its factor exposures do not account for. When the factors are themselves traded excess returns, as they are throughout Chapter 6, $$\hat\alpha\_i$$ has a direct portfolio interpretation. It is the average return on a self-financing position that is long the asset and short $$\hat\beta\_{i,k}$$ dollars of each factor portfolio, financed at the riskless rate. A nonzero $$\hat\alpha\_i$$ is therefore a claim that a particular tradable portfolio made money on average — which is why "the model is rejected" and "there was a strategy" are the same sentence in this literature.

The residual variance is estimated by $$s^2 = \hat\varepsilon'\hat\varepsilon/(T-K-1)$$, dividing by the degrees of freedom rather than by $$T$$ so that the estimator is unbiased. The regression $$R^2$$ measures how much of the asset's return variation is *common*, which is not the same thing as how well the model *prices* the asset: a portfolio can have an $$R^2$$ of 0.95 and an economically enormous alpha, or an $$R^2$$ of 0.30 and no alpha at all. The quantity of interest throughout this book is the intercept, and $$R^2$$ tells you nothing about it.

**A worked regression.** Table A.1 gives twelve monthly observations, constructed so the arithmetic comes out clean.

**Table A.1: Twelve months of a portfolio and the market, in percent**

| Month                                         | 1    | 2     | 3    | 4    | 5     | 6    | 7     | 8     | 9    | 10    | 11   | 12   |
| --------------------------------------------- | ---- | ----- | ---- | ---- | ----- | ---- | ----- | ----- | ---- | ----- | ---- | ---- |
| Market excess return $$f\_t$$                 | 3.2  | −1.8  | 2.4  | 0.4  | −4.2  | 5.0  | 1.0   | −0.8  | 2.8  | −3.4  | 4.4  | 1.0  |
| Portfolio excess return $$r\_{i,t}-r\_{f,t}$$ | 2.58 | −1.57 | 3.66 | 1.76 | −5.53 | 4.25 | −0.75 | −2.42 | 4.52 | −3.01 | 6.36 | 2.85 |

*Source: Author's construction, built so that the fitted coefficients are exact round numbers.*

The means are $$\bar f = 0.8333$$ and $$\bar r = 1.0583$$. The cross-product and the sum of squared deviations are

$$
\sum\_t (f\_t - \bar f)(r\_t - \bar r) = 109.373, \qquad \sum\_t (f\_t - \bar f)^2 = 95.107
$$

so $$\hat\beta\_i = 109.373/95.107 = 1.15$$ and $$\hat\alpha\_i = \bar r - \hat\beta\_i \bar f = 1.0583 - 1.15(0.8333) = 0.10$$ percent per month. The residual standard deviation is $$s = 1.397$$ percent and $$R^2 = 0.866$$. An alpha of 0.10 percent per month is 1.2 percent per year, which sounds like a result; the next subsection is about whether it is one.

![Figure A.1: Anatomy of a return regression](https://846781005-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3EupdX99vVBoNySDtmxb%2Fuploads%2Fgit-blob-0836f7cab4e8dbbce45dc670d025caf61936f559%2Ffig_A_01_regression_anatomy.png?alt=media)

**Figure A.1: Anatomy of a return regression.** Table A.1's twelve months, with the fitted line through them and the residuals drawn as vertical segments. Three things the algebra says are visible here. The residuals sum to zero and are orthogonal to the regressor, which is why the fitted line passes through the point of means and why no rearrangement of the data could make them smaller — an algebraic property of least squares rather than a finding about markets. The slope is the loading: 1.15 dollars of market exposure per dollar invested. And the intercept is the whole of the economic content. It is 0.10 percent a month, and it is the average return on a self-financing position long the portfolio, short 1.15 of the market, financed at the riskless rate — a strategy, not a residual. The R-squared of 0.866 says the portfolio moves with the market, which is a different question and not the one being asked; a portfolio can have an R-squared of 0.95 and an enormous alpha. Whether this alpha is a result depends on its standard error, which is §A.1.2's subject and which twelve observations will not settle. *Source: Author's calculation from Table A.1.*

### A.1.2 Standard errors that matter in finance

Under the classical assumptions — residuals independent across $$t$$, with constant variance, and uncorrelated with the regressors — the variance of $$\hat b$$ is $$\sigma^2 (X'X)^{-1}$$, estimated by $$s^2 (X'X)^{-1}$$. This is what statistical software prints by default. In finance it is very often the wrong number, and it is wrong in the direction that flatters the researcher.

It fails for two reasons, and the modern treatment handles both with the same device. Write the estimator's sampling error as $$\hat b - b = (X'X)^{-1}X'\varepsilon$$. Its variance is

$$
\mathrm{Var}(\hat b) = (X'X)^{-1} \thinspace \underbrace{\mathrm{Var}(X'\varepsilon)}\_{\text{the "meat"}} \thinspace (X'X)^{-1}
$$

The two outer terms — the "bread" — are known. Everything difficult sits in the middle, and every estimator below is a different guess at it. This is the **sandwich** family, and the discipline it imposes is useful: the question is never "which standard error should I use?" but "what do I believe about the covariance structure of $$X'\varepsilon$$?"

**Heteroskedasticity.** If residual variance differs across observations but residuals are independent, the meat is $$\sum\_t x\_t x\_t' \sigma\_t^2$$, and White's (1980) insight is that it can be estimated by replacing $$\sigma\_t^2$$ with the squared residual $$\hat\varepsilon\_t^2$$:

$$
\widehat{\mathrm{Var}}\_{\text{White}}(\hat b) = (X'X)^{-1}\left(\sum \_{t=1}^{T} \hat\varepsilon\_t^2 \thinspace X\_t X\_t'\right)(X'X)^{-1}
$$

where $$X\_t$$ is the $$t$$-th row of $$X$$ written as a column. No individual $$\sigma\_t^2$$ is consistently estimated — one squared residual is a terrible estimate of one variance — but the *sum* is, which is all the formula needs. In small samples the estimator is biased downward, and the standard repair is to multiply by $$T/(T-K-1)$$, which software calls HC1.

**Autocorrelation.** Return residuals in finance are frequently correlated across time. Sometimes this is a fact about markets (illiquid assets, stale prices, slow information diffusion); far more often it is an artifact of the design, because the researcher has constructed overlapping observations. When residuals are autocorrelated, the meat picks up cross-products at nonzero lags, and Newey and West's (1987) estimator truncates the sum at lag $$L$$ and weights it:

$$
\hat S = \sum\_{j=-L}^{L}\left(1 - \frac{|j|}{L+1}\right)\sum\_{t}\hat\varepsilon\_t\hat\varepsilon\_{t-j}\thinspace X\_t X\_{t-j}'
$$

and then $$\widehat{\mathrm{Var}}\_{\mathrm{NW}}(\hat b) = (X'X)^{-1}\hat S (X'X)^{-1}$$. The inner sum runs over the periods for which both $$t$$ and $$t-j$$ are observed, and the $$j=0$$ term is White's estimator, so Newey-West nests it. The declining Bartlett weights $$1 - |j|/(L+1)$$ are not cosmetic: they guarantee that $$\hat S$$ is positive semi-definite, so the procedure cannot return a negative variance. They also mean that Newey-West systematically *under*-corrects, because it shrinks the very autocovariances it is trying to count. Section A.1.3 quantifies exactly how much.

**Choosing** $$L$$**.** The automatic rule built into most software is $$L = \lfloor 4(T/100)^{2/9}\rfloor$$, which is calibrated for generic, unknown, decaying serial correlation. It is the wrong rule whenever you know where the autocorrelation came from. **If your dependent variable is an** $$H$$**-period return built from overlapping windows, set** $$L \ge H-1$$ **and ignore the automatic rule.** With monthly data and ten-year overlapping returns, the automatic rule at $$T = 1272$$ returns $$L = 7$$; the correct floor is $$L = 119$$. That is not a refinement. It is the difference between a $$t$$-statistic of five and a $$t$$-statistic of one.

**Clustering.** The third failure is neither heteroskedasticity nor autocorrelation in a single series: it is *dependence across units that share something*. Firms in the same industry share shocks; events on the same calendar date share the day's market news; observations on the same firm in different years share the firm. Group the observations into $$G$$ clusters indexed by $$g$$, let $$X\_g$$ and $$\hat\varepsilon\_g$$ be the rows belonging to cluster $$g$$, and assume independence across clusters but nothing within them:

$$
\widehat{\mathrm{Var}}\_{\text{cluster}}(\hat b) = \frac{G}{G-1}\cdot\frac{T-1}{T-K-1}\cdot(X'X)^{-1}\left(\sum \_{g=1}^{G} X\_g'\hat\varepsilon\_g\hat\varepsilon\_g'X\_g\right)(X'X)^{-1}
$$

The leading finite-sample factor matters when $$G$$ is small, and — the point that is routinely missed — the estimator's asymptotics run in the *number of clusters*, not the number of observations. Fifty thousand firm-months clustered into eleven industries give eleven independent draws, and the resulting $$t$$-statistic belongs against a $$t$$ distribution with about ten degrees of freedom, not a normal. Petersen (2009) made this standard practice in finance; Cameron, Gelbach and Miller (2011) and Thompson (2011) extend it to two dimensions at once — firm and time — which is the right specification for most panel regressions in Chapters 12, 22 and 25, where a firm's residuals are correlated over time *and* all firms' residuals are correlated within a year.

Table A.2 puts the three on the Table A.1 regression. Twelve observations is far too few for a serial-correlation correction to be reliable, and the table is printed to show what the calculation looks like, not to be believed.

**Table A.2: Three standard errors for the same regression**

| Estimator                | $$\mathrm{se}(\hat\alpha\_i)$$ | $$t(\hat\alpha\_i)$$ | $$\mathrm{se}(\hat\beta\_i)$$ | $$t(\hat\beta\_i)$$ |
| ------------------------ | ------------------------------ | -------------------- | ----------------------------- | ------------------- |
| Conventional (classical) | 0.421                          | 0.24                 | 0.143                         | 8.03                |
| White, HC1               | 0.388                          | 0.26                 | 0.123                         | 9.35                |
| Newey-West, $$L=2$$      | 0.441                          | 0.23                 | 0.074                         | 15.59               |

*Source: Author's calculation from Table A.1. With twelve observations the Newey-West estimator has essentially no sampling properties worth defending; the row is illustrative of the arithmetic only.*

The lesson to carry forward is not that one row is right. It is that in this regression the alpha is indistinguishable from zero under every estimator, and the beta is significant under every estimator, so the choice does not matter here. The choice matters in exactly one circumstance — when the correction is large — and §A.1.3 is the case where it is.

### A.1.3 Overlapping observations, and the effective sample size

§7.4's long-horizon predictive regressions, and Chapter 7's data exercise Part A, run into the single most common inflation of statistical evidence in finance. Here is the mechanism, with the arithmetic the exercise asks for.

Suppose you regress the subsequent ten-year return on today's log CAPE, using monthly observations from 1900 to 2015. You have about $$T = 1272$$ usable months. But the ten-year return starting in January 1950 and the ten-year return starting in February 1950 share 119 of their 120 monthly returns. They are very nearly the same observation, counted twice.

Under the null hypothesis of no predictability, one-period returns are independent, and the $$H$$-period overlapping sum inherits a moving-average structure with autocorrelation exactly $$1 - j/H$$ at lag $$j < H$$. The variance of the sample mean of the overlapping series is then inflated relative to the naive formula by

$$
1 + 2\sum\_{j=1}^{H-1}\left(1 - \frac{j}{H}\right) = H
$$

Exactly $$H$$. With $$H = 120$$ months, the correct standard error is $$\sqrt{120} = 10.95$$ times the conventional one. A conventional $$t$$-statistic of 5.1 — the figure Chapter 7's Problem quotes from a plausible-looking analyst — becomes 0.47. The regression is not weak evidence of predictability; under the null it is no evidence at all.

Newey-West recovers most but not all of this, and the shortfall is worth knowing. With Bartlett weights and $$L = H - 1 = 119$$, the estimated inflation is $$1 + 2\sum\_{j=1}^{119}(1-j/120)^2 = 80.0$$, so the estimated standard error is $$\sqrt{80} = 8.94$$ times the conventional one — **82 percent of the truth**. Setting $$L = 1.5H$$ recovers 88 percent, and $$L = 2H$$ recovers 91 percent. Hansen and Hodrick's (1980) unweighted estimator at $$L = H-1$$ is exactly right in expectation but can return a negative variance, which is why the profession settled on the biased-but-safe option. The practical rule: use Newey-West with $$L$$ at least $$1.5H$$, and treat the resulting $$t$$-statistic as an upper bound on the evidence.

The complementary way to state the same thing is the **effective sample size**. With $$T$$ overlapping observations of an $$H$$-period return, the number of independent windows is roughly $$T/H$$: here $$1272/120 = 10.6$$, call it eleven decades. That is the number to use for degrees of freedom. And it produces a result that surprises people, so Table A.3 sets it out.

**Table A.3: What the overlap does to a ten-year forecast**

| Quantity                                            | Using $$n = 1272$$ months | Using $$n = 11$$ independent decades |
| --------------------------------------------------- | ------------------------- | ------------------------------------ |
| Degrees of freedom                                  | 1270                      | 9                                    |
| $$t$$ multiplier, 90 percent two-sided              | 1.646                     | 1.833                                |
| Half-width, confidence interval on the fitted mean  | 0.18 pp                   | 2.18 pp                              |
| Half-width, prediction interval for the next decade | 6.48 pp                   | 7.54 pp                              |

*Source: Author's calculation, assuming a residual standard deviation of 3.94 percentage points — the value implied by an unconditional standard deviation of 5.0 percentage points in ten-year annualized real returns and an* $$R^2$$ *of 0.38.*

Two things follow, and they point in opposite directions, which is why the exercise is instructive. The **confidence band around the fitted line** widens by a factor of twelve, which destroys the claim that the slope is precisely estimated. But the **prediction interval for the next decade** barely moves, from $$\pm 6.5$$ to $$\pm 7.5$$ percentage points, because a prediction interval is dominated by residual variance rather than by parameter uncertainty. So the honest statement about the next ten years was always going to be wide. What the overlap correction kills is not the forecast; it is the confidence that there is a relation worth forecasting from.

### A.1.4 Persistent regressors and the Stambaugh bias

The second problem with predictive regressions is a small-sample bias, and unlike the overlap problem it does not go away as the standard error is fixed. It is in the point estimate.

Write the predictive regression and the predictor's own dynamics:

$$
r\_{t+1} = a + \beta x\_t + \varepsilon\_{t+1}, \qquad x\_{t+1} = \mu + \phi x\_t + u\_{t+1}
$$

Here $$x\_t$$ is the predictor and $$\phi$$ its persistence, both in the sense of §7.4's starred box. Two facts collide. First, the OLS estimator of an autoregressive coefficient is biased downward in finite samples, with $$E\[\hat\phi - \phi] \approx -(1+3\phi)/T$$ — a bias that gets worse as the predictor gets more persistent. Second, when the predictor is a valuation ratio, its innovations $$u$$ are strongly *negatively* correlated with return innovations $$\varepsilon$$, because a good return raises the price and mechanically lowers the dividend-price ratio in the same instant. Stambaugh (1999) showed that the two combine into a bias in the predictive slope:

$$
E\[\hat\beta - \beta] = \frac{\mathrm{Cov}(\varepsilon, u)}{\mathrm{Var}(u)}\cdot E\[\hat\phi - \phi]
$$

The first factor is the coefficient from regressing return innovations on predictor innovations, and it is negative; the second is negative; so the product is positive. **The predictive slope is biased upward, and the conventional standard error is biased downward.** Both errors push in the direction of finding predictability.

Take the magnitudes §7.4 reports. Annual data, $$T = 100$$ years, $$\phi = 0.94$$, an annual return standard deviation of 18 percent, a standard deviation of dividend-price innovations of 15 percent, and a correlation between the two innovations of $$-0.90$$. Then the innovation-regression coefficient is $$(-0.90)(0.18)(0.15)/(0.15)^2 = -1.08$$ and $$E\[\hat\phi - \phi] = -(1 + 3 \times 0.94)/100 = -0.0382$$, so the bias in the slope is $$(-1.08)(-0.0382) = +0.041$$. Against Chapter 7's one-year return-forecasting slope of $$\beta\_r = 0.10$$, that is a bias of **41 percent of the point estimate**: the bias-adjusted slope is 0.059. The predictability does not vanish, but it is roughly halved by a correction that costs one line of arithmetic and is omitted from most published tables written before 2000.

The correction generalizes. Bootstrap procedures that impose the null and simulate the joint system, and the analytic adjustments in the subsequent literature, all deliver the same qualitative answer, and the qualitative answer is the one to remember: any regression of a return on a persistent, price-based predictor overstates its slope, and the overstatement grows with persistence and shrinks with sample length.

### A.1.5 Testing a set of restrictions: the GRS test

Chapter 6 says repeatedly that a factor model "is rejected." The statement has a precise meaning, and this is it.

Run the time-series regression of §A.1.1 separately for each of $$N$$ test assets on the same $$K$$ factors. Under the model, every intercept should be zero. You now have $$N$$ estimated intercepts, each individually noisy, and the question is whether they are *jointly* distinguishable from a vector of zeros. Testing them one at a time is exactly the multiple-testing error §6.4 is about; with $$N = 25$$ and a five percent threshold, one or two significant alphas are what you expect under the null.

Gibbons, Ross and Shanken (1989) supply the joint test. Collect the intercepts into $$\hat\alpha$$ ($$N \times 1$$), let $$\hat\Sigma\_\varepsilon$$ be the $$N \times N$$ covariance matrix of the regression residuals, let $$\hat\lambda$$ be the $$K$$-vector of sample factor means and $$\hat\Sigma\_f$$ their $$K \times K$$ covariance matrix. Then

$$
\mathrm{GRS} = \frac{T - N - K}{N}\cdot\frac{1}{1 + \hat\lambda'\hat\Sigma\_f^{-1}\hat\lambda}\cdot\hat\alpha'\hat\Sigma\_\varepsilon^{-1}\hat\alpha \sim F(N, T-N-K)
$$

under the null that all $$N$$ intercepts are zero, assuming normal, homoskedastic, serially uncorrelated residuals. It is an exact finite-sample $$F$$ test, not an asymptotic approximation, which is why it survived.

Every piece has a portfolio meaning, and this is the part worth internalizing. The quadratic form $$\hat\alpha'\hat\Sigma\_\varepsilon^{-1}\hat\alpha$$ is the **maximum squared Sharpe ratio obtainable from the pricing errors** — the Sharpe ratio of the best portfolio an investor could build out of the $$N$$ alphas, hedged of factor exposure. The denominator $$1 + \hat\lambda'\hat\Sigma\_f^{-1}\hat\lambda$$ contains the squared Sharpe ratio of the factors' own tangency portfolio. So GRS asks: *how much does adding the test assets improve the best available Sharpe ratio, relative to what the factors already offer?* A model is rejected when there is a lot of money left on the table.

Two conditions constrain the test, and both bind in practice. The residual covariance matrix must be invertible, which requires $$T > N$$ and in practice $$T$$ comfortably larger than $$N$$ — inverting a $$100 \times 100$$ residual covariance matrix estimated on 300 months produces an $$\hat\alpha'\hat\Sigma\_\varepsilon^{-1}\hat\alpha$$ that is mostly estimation noise, and the test over-rejects badly. And the residuals must be serially uncorrelated and homoskedastic, which monthly equity residuals roughly are and daily ones are not. The robust alternative is the GMM Wald statistic of §A.5, which drops both assumptions and pays for it in finite-sample accuracy.

### Worked example: the CAPM on the 25 size and book-to-market portfolios

**Data.** From Kenneth French's data library, download `25_Portfolios_5x5` (monthly, value-weighted returns) and `F-F_Research_Data_Factors` (monthly). Both are free, both are plain text inside a zip, and both begin in July 1926; use July 1963 onward, which is the sample the literature standardized on because Compustat book equity is thin before then.

**Procedure.** Subtract the risk-free rate `RF` from each of the 25 portfolio returns to get excess returns — French's factor file provides `RF`, and the portfolio file provides raw returns, so the alignment step is the one people get wrong. Drop any month coded $$-99.99$$, French's missing-value marker. Then run 25 separate time-series regressions of each portfolio's excess return on `Mkt-RF`, saving $$\hat\alpha\_i$$, its three standard errors, and the residual series. Assemble the residuals into a $$T \times 25$$ matrix and compute $$\hat\Sigma\_\varepsilon$$ as its sample covariance. Then apply the GRS formula with $$N = 25$$ and $$K = 1$$.

**What comes out.** Table A.4 works the statistic term by term at plausible values so the arithmetic is visible.

**Table A.4: The GRS test, ingredient by ingredient**

| Ingredient                                  | Symbol                                                | Value     |
| ------------------------------------------- | ----------------------------------------------------- | --------- |
| Months, July 1963 - December 2020           | $$T$$                                                 | 690       |
| Test assets                                 | $$N$$                                                 | 25        |
| Factors                                     | $$K$$                                                 | 1         |
| Monthly Sharpe ratio of the market          | $$\hat\lambda\_M/\hat\sigma\_M$$                      | 0.124     |
| Shanken-type denominator                    | $$1 + \hat\lambda'\hat\Sigma\_f^{-1}\hat\lambda$$     | 1.015     |
| Quadratic form in the alphas                | $$\hat\alpha'\hat\Sigma\_\varepsilon^{-1}\hat\alpha$$ | 0.115     |
| Degrees-of-freedom factor                   | $$(T-N-K)/N$$                                         | 26.56     |
| **GRS statistic**                           |                                                       | **3.01**  |
| Five percent critical value, $$F(25, 664)$$ |                                                       | 1.52      |
| $$p$$-value                                 |                                                       | 0.0000016 |

*Source: Author's calculation. The sample length, the number of test assets, the number of factors and the critical value are exact; the market Sharpe ratio and the quadratic form are set at values representative of the published literature on these test assets, and the committed script replaces them with the current vintage.*

Read the last three rows economically rather than statistically. The quadratic form of 0.115 implies that a portfolio built out of the CAPM's pricing errors on these 25 assets would have had a monthly Sharpe ratio of $$\sqrt{0.115} = 0.34$$, or about 1.17 annualized — roughly two and a half times the market's own 0.43. That is what "the CAPM is rejected" means. It does not mean the intercepts are large one at a time; several of them are not. It means that a mean-variance investor handed the 25 portfolios and the market would build something far better than the market, which is precisely what the CAPM says is impossible.

The five-factor model does better on these test assets and is also rejected, which is the standard result and the reason §6.4 treats factor models as compression devices. Rejection is the normal state of affairs in this literature; the interesting comparison is between GRS statistics, not between rejection and non-rejection.

**★ If you have WRDS.** Rebuild the 25 portfolios from CRSP and Compustat rather than downloading them, applying French's screens (ordinary common shares, NYSE breakpoints, June formation, a six-month accounting gap). Compare your alphas with French's. The differences — and there will be differences, in the third decimal and occasionally in the second — are a direct measurement of how much of a published result is construction choice rather than data.

***

## A.2 Portfolio Sorts, End to End

### A.2.1 What a sort estimates

A portfolio sort is a nonparametric estimator of the conditional expectation function $$E\[r\_i \mid c\_i]$$, evaluated at a small number of points. Rank the cross-section on the characteristic $$c\_i$$, cut the ranking into a handful of groups — deciles conventionally, quintiles commonly, terciles when the cross-section is thin — and the average return of a group estimates the conditional expectation of the return given membership in that group. That is all it is, and stating it that way makes its three advantages precise.

It **imposes no functional form**. A linear cross-sectional regression estimates one number and will find nothing if the true relation is flat over the middle eight deciles and steep in the tails — which is what several of the canonical relations look like. The sort finds it. It is **invariant to monotone transformations** of the characteristic, because only ranks enter, so a sort on book-to-market and a sort on log book-to-market give identical portfolios; that robustness to the outliers and skewness of accounting ratios is why nobody winsorizes before sorting. And it produces a **tradable portfolio** — a return series rather than a coefficient, so it can be confronted with transaction costs, capacity limits, factor-model alphas, and the crowding evidence of §6.8. A regression coefficient cannot be shorted.

Against these, one real cost: a sort discards the variation within each group, and the loss grows with the coarseness of the cut. That is the trade §A.6's methods exist to avoid.

### A.2.2 Breakpoints, and the microcap tilt

This is the most consequential construction choice in the entire literature and it looks like a technicality.

The US cross-section is extraordinarily skewed. Fama and French (2008) report that microcaps — firms below the 20th percentile of NYSE market capitalization — are roughly **60 percent of the number of listed firms and about 3 percent of aggregate market value**. Any procedure that treats stocks as equally informative observations is therefore, in economic terms, a study of three percent of the market.

Breakpoints determine how many of those firms land in your extreme portfolios. **NYSE breakpoints** compute the percentile cutoffs using only NYSE-listed stocks and then apply them to the whole universe; because NYSE firms are larger, this produces extreme portfolios containing relatively few microcaps. **All-stock breakpoints** compute the cutoffs on the entire universe, and because the universe is mostly microcaps, the cutoffs move and the extreme portfolios fill up with them. Weighting then compounds the choice: **value weighting** within a portfolio makes the largest name dominate, while **equal weighting** gives a $40 million firm the same influence as a $40 billion one.

§6.4 asserts that this is what separates Hou, Xue and Zhang's (2020) replication results from the original papers. Here it is demonstrated. Table A.5 is a twenty-stock universe, deliberately calibrated so that non-NYSE names are 60 percent of the count and 3 percent of the value — the real proportions.

**Table A.5: Twenty stocks, one characteristic**

| Stock | Exchange | Market cap ($m) | Book-to-market | Next-year return (%) |
| ----- | -------- | --------------- | -------------- | -------------------- |
| S01   | NYSE     | 40,000          | 0.35           | 8                    |
| S02   | NYSE     | 26,000          | 1.60           | 14                   |
| S03   | NYSE     | 18,000          | 0.55           | 6                    |
| S04   | NYSE     | 12,000          | 1.20           | 12                   |
| S05   | NYSE     | 9,000           | 0.80           | 9                    |
| S06   | NYSE     | 6,000           | 2.10           | 17                   |
| S07   | NYSE     | 4,000           | 0.45           | 5                    |
| S08   | NYSE     | 2,500           | 1.75           | 15                   |
| S09   | NASDAQ   | 900             | 0.30           | 4                    |
| S10   | NASDAQ   | 700             | 2.60           | 26                   |
| S11   | NASDAQ   | 500             | 0.70           | 7                    |
| S12   | NASDAQ   | 400             | 3.10           | 30                   |
| S13   | NASDAQ   | 300             | 0.50           | 3                    |
| S14   | NASDAQ   | 250             | 2.30           | 24                   |
| S15   | NASDAQ   | 200             | 0.95           | 10                   |
| S16   | NASDAQ   | 150             | 2.80           | 33                   |
| S17   | NASDAQ   | 120             | 0.40           | 1                    |
| S18   | NASDAQ   | 90              | 3.40           | 40                   |
| S19   | NASDAQ   | 60              | 1.05           | 11                   |
| S20   | NASDAQ   | 40              | 2.95           | 36                   |

*Source: Author's construction. NYSE names are 40 percent of the count and 96.9 percent of aggregate value; the value premium is built in and is deliberately larger among the small firms, which is the empirically documented pattern.*

Now form value-minus-growth spreads at the 30th and 70th percentiles, the Fama-French convention, under both breakpoint rules and both weighting schemes. The NYSE cutoffs are 0.575 and 1.560; the all-stock cutoffs are 0.655 and 2.160. That single shift is decisive, because it moves S02, S06 and S08 — three of the four largest value stocks — out of the value portfolio entirely.

**Table A.6: The same value premium, four ways**

| Breakpoints | Weighting | Value leg (%) | Growth leg (%) | Spread (pp) |
| ----------- | --------- | ------------- | -------------- | ----------- |
| NYSE        | Value     | 15.2          | 7.2            | **8.1**     |
| NYSE        | Equal     | 26.1          | 4.5            | 21.6        |
| All-stock   | Value     | 28.3          | 7.2            | 21.2        |
| All-stock   | Equal     | 31.5          | 4.5            | **27.0**    |

*Source: Author's calculation from Table A.5.*

The most conservative construction gives 8.1 percentage points; the most permissive gives 27.0, a factor of 3.3, from **identical data and an identical characteristic**. Nothing was mined and no specification was searched. The entire difference is where the cutoffs were computed and how the legs were weighted.

The rule that follows is Hou, Xue and Zhang's, and this book adopts it: **report the value-weighted, NYSE-breakpoint version as the headline, and report the others as robustness.** The justification is economic rather than statistical. The value-weighted NYSE-breakpoint spread is the return an investor with real money could plausibly have earned; the equal-weighted all-stock spread requires taking positions in firms whose entire market capitalization is smaller than the position. §6.4's finding that roughly 65 percent of 452 published anomalies fail under uniform value-weighted methodology is Table A.6 applied 452 times.

### A.2.3 The calendar: formation, holding, rebalancing

A sort is a dated procedure, and the dates encode assumptions about what was knowable when.

**The June convention.** Fama and French form portfolios at the end of June of year $$t$$ using book equity from the fiscal year ending in calendar year $$t-1$$ and market equity from December of $$t-1$$. The six-month gap between the December market value and the June formation is a deliberate assumption that annual accounting data are public within six months of fiscal year end. It is conservative — most 10-K filings arrive within 90 days — and it is the reason the convention has survived: it cannot produce a look-ahead bias, only a loss of power. Portfolios formed in June of $$t$$ are then held for twelve months, through June of $$t+1$$, and the sort is redone.

**The momentum exception.** Momentum rebalances monthly and sorts on the return from month $$t-12$$ to month $$t-2$$. The one-month gap is not fastidiousness. Short-horizon reversal — the tendency of last month's losers to bounce — is a distinct and strong effect driven largely by bid-ask bounce and liquidity provision (§11.3), so including month $$t-1$$ contaminates the momentum signal with its opposite. Reversal is also largely a microcap phenomenon and largely uncapturable after costs, so a momentum strategy that includes month $$t-1$$ reports a premium that cannot be earned.

**Unbalanced panels.** Real cross-sections are unbalanced: firms list, delist, merge, and go dark, so $$N\_t$$ changes every period and no asset is present throughout. This is a feature of the data, not a problem to be fixed, and the correct handling is to let the panel be unbalanced. Form each period's portfolios from the firms available *that period*; do not require a firm to survive the whole sample, which is the definition of survivorship bias. Do impose a minimum-history screen where the design requires an estimate — a momentum sort needs eleven months of past returns, a beta-sorted portfolio needs enough months to estimate a beta — and state the screen, because it silently excludes recent listings and therefore tilts the sample toward older firms. In the second-pass regressions of §A.3 the same principle applies: run each period's cross-sectional regression on whichever assets exist that period, with $$N\_t$$ varying, and take the time-series average of the coefficients. Nothing in the Fama-MacBeth standard error requires a balanced panel, which is one of its quiet advantages.

### A.2.4 Value against equal weighting, and the delisting correction

Value weighting estimates the return on the *aggregate portfolio* of stocks with that characteristic — a quantity with a claim on being the market's actual experience, and the only weighting consistent with the market-clearing logic of Chapter 2's holdings tables, since somebody must hold every share. Equal weighting estimates the return of the *average stock*, which is a different object and a legitimate one if the question is about the typical firm rather than the typical dollar.

Two mechanical hazards attach to equal weighting and neither is a matter of taste. First, equal weighting requires rebalancing back to equal weights every period, which manufactures a rebalancing return that is not available net of costs in illiquid names. Second, and more insidious, equal-weighted portfolio returns are upward-biased by **bid-ask bounce**: a stock's recorded closing price is a transaction that occurred at either the bid or the ask, so measured returns contain a negatively autocorrelated error, and averaging across stocks does not remove its effect on a portfolio's mean when weights are refreshed each period. Blume and Stambaugh (1983) showed the bias is proportional to the squared bid-ask spread and is therefore concentrated in exactly the microcaps equal weighting over-weights. Value weighting is essentially immune, because the large stocks that carry the weight have negligible spreads.

**The delisting correction.** A firm that leaves the sample did so for a reason, and the reason is correlated with its return. If a stock is simply dropped in the month it is delisted for performance, the sample omits a return that is often catastrophic — CRSP's delisting returns for performance-related deletions average roughly $$-30$$ percent. Shumway (1997) documented the bias and the standard correction: splice the delisting return onto the last partial-month return, and where the delisting return itself is missing, impute the average for that delisting code rather than treating the observation as absent. The effect is negligible for large-cap portfolios and material for the microcap corners, which is to say it is largest exactly where equal weighting has already put all the weight — so the two problems of this subsection compound rather than offset. A study that equal-weights and does not correct for delisting has made the same error twice.

### A.2.5 Double sorts

Characteristics are correlated — value stocks are smaller, profitable firms invest more — so a univariate sort is always partly a sort on something else. §6.3 states the two designs; what matters here is their failure modes.

An **independent** double sort assigns each stock to a group on each characteristic separately and takes intersections, so the cutoffs are common across the whole cross-section. Its defect is empty cells: in a $$5\times5$$ independent sort on size and book-to-market, the large-value and small-growth corners contain very few firms in some years, and their returns are correspondingly noisy. A **conditional** (sequential) sort splits on the first characteristic and forms second-characteristic groups within each bucket, so cells are balanced by construction. Its defect is interpretive: the second sort's cutoffs now vary across the first characteristic's groups, so "high book-to-market" means something different among small firms than among large ones.

Which to use depends on which characteristic is the control — conditional if the first characteristic is a nuisance to be neutralized, independent if it is itself of interest. Neither handles more than about three dimensions: a $$5\times5\times5$$ sort has 125 cells and, in a universe of three thousand firms, 24 firms per cell on average and fewer in the corners. That ceiling is the reason §A.6 exists.

### A.2.6 Reading the output

Report four things and refuse to report fewer.

The **long-short spread** — the top group's average return minus the bottom group's — with its $$t$$-statistic computed from the time series of monthly spread returns, not from the cross-section. The **alpha of the spread** against whatever model you are trying to beat, from a time-series regression of the spread on the factors, with the standard errors of §A.1.2. The **full ladder** of intermediate portfolios, because a monotone pattern across all ten deciles is far stronger evidence than a top-versus-bottom difference, which two outlying deciles can generate on their own; Patton and Timmermann (2010) give a formal monotonicity test, and simply printing the ladder catches most of what it catches. And the **turnover and the average market capitalization** of each leg, which is what converts a paper return into a claim about a strategy.

Then apply §6.4's hurdle. A spread with $$t = 2.3$$ is not a discovery in a literature that has run hundreds of these; Harvey, Liu and Zhu's working threshold of about 3.0 is the relevant bar, and Bonferroni at 316 published factors is 3.78.

### Worked example: the value premium, four ways, on French's files

**Data.** From Kenneth French's data library, download four monthly files: `F-F_Research_Data_Factors` (for `HML` and `RF`), `6_Portfolios_2x3`, `25_Portfolios_5x5`, and `Portfolios_Formed_on_BE-ME`. The last three each ship in two flavors, value-weighted and equal-weighted, in the same text file — the equal-weighted panel follows the value-weighted one after a header line, which is the parsing step that trips people up. Also download `BE-ME_Breakpoints`, which gives French's NYSE percentile cutoffs year by year and lets you see the construction directly.

**Procedure.** Build four versions of the same value spread and put them in one table.

1. From `6_Portfolios_2x3`, value-weighted: average the two value portfolios (`SMALL HiBM`, `BIG HiBM`), average the two growth portfolios (`SMALL LoBM`, `BIG LoBM`), and difference. This should reproduce `HML` from the factor file almost exactly; if it does not, your parsing is wrong, and this is the check that catches it.
2. The same computation from the equal-weighted panel of `6_Portfolios_2x3`.
3. From `25_Portfolios_5x5`, value-weighted: average the five highest-book-to-market portfolios across size quintiles, average the five lowest, and difference. This is a quintile cut rather than the 30/70 tercile cut, so the spread should be larger.
4. From `Portfolios_Formed_on_BE-ME`, the decile file: `Hi 10` minus `Lo 10`, value-weighted and then equal-weighted. This is the widest cut and the equal-weighted version is the microcap-tilted one.

Report all six numbers with their $$t$$-statistics and their annualized Sharpe ratios, over the full sample and over the post-2007 subsample that §6.2 flags as the value premium's long absence.

**What to expect.** The ordering will match Table A.6's logic: tercile cuts smaller than quintile cuts smaller than decile cuts, and equal-weighted larger than value-weighted at every cut, with the gap widening as the cut gets finer, because a finer cut puts more microcaps in the extreme portfolios. Write down, before you run it, which of the six numbers you would print if you had to print one — and then check whether the number you would have printed is the largest one.

![Figure A.2: A portfolio sort, end to end](https://846781005-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3EupdX99vVBoNySDtmxb%2Fuploads%2Fgit-blob-2fd781ca1e93dbee417c800e5c803e29b1d96afb%2Ffig_A_02_sort_ladder.png?alt=media)

**Figure A.2: A portfolio sort, end to end.** The two schedules the anomalies literature actually runs, on one page. The value convention above: book equity from the fiscal year ending in calendar year t−1, breakpoints computed from NYSE firms alone, portfolios formed in June of year t, and held value-weighted for twelve months without rebalancing. The six-month gap is the whole reason the formation date is June and not January — it guarantees that the accounting data were public when the portfolio was formed, and a sort that skips it is looking at information the market did not have. The momentum variant below: an eleven-month ranking period, a one-month skip, a one-month holding period, and a re-formation every month. Read the two together and the point is not that momentum is faster. It is that turnover, the share of the paper return that survives transaction costs, and the answer to "is this a strategy or a paper portfolio" are all determined by this diagram rather than by the sort itself. The one-month skip is the clearest case of a design choice with a price: it costs a month of signal and buys immunity to the short-run reversal that would otherwise sit inside the momentum portfolio and cut its measured return. *Source: Author's construction from Section A.2.*

**★ If you have WRDS.** Rebuild the sort from CRSP monthly returns and Compustat annual fundamentals, and produce the all-stock-breakpoint versions French does not publish. Then repeat with and without Shumway's delisting correction, and report the difference in the microcap decile. That difference is the single largest unforced measurement error in the anomalies literature.

***

## A.3 Fama-MacBeth, Worked in the Hatted Notation

### A.3.1 The problem the method solves

Suppose you have $$N$$ test assets over $$T$$ periods and want to estimate the prices of risk $$\lambda\_k$$ in $$E\[r\_i] - r\_f = \sum\_k \beta\_{i,k}\lambda\_k$$. The obvious approach is to pool all $$NT$$ observations and run one regression of excess returns on loadings. The obvious approach is catastrophically wrong, and the reason is worth a paragraph because it explains the entire design.

Returns in any given month are enormously cross-sectionally correlated. When the market falls four percent, almost every stock falls, so the residuals from a cross-sectional pricing regression in that month are nearly all negative together. A pooled OLS standard error assumes the $$NT$$ observations are independent draws; in fact there are closer to $$T$$ independent draws, each of size $$N$$. With $$N = 25$$ and a residual cross-correlation of even 0.3, the pooled standard error understates the truth by a factor of roughly $$\sqrt{1 + 24(0.3)} = 2.9$$, and with individual stocks and $$N$$ in the thousands the understatement runs to an order of magnitude. §6.3 says this in one sentence; the arithmetic behind it is the clustering formula of §A.1.2 with the cluster being the calendar month.

Fama and MacBeth (1973) sidestep the problem entirely rather than correcting for it. Estimate the cross-sectional relation *once per period*, then treat the resulting sequence of coefficient estimates as a sample of $$T$$ draws and use its time-series variation for inference. Cross-sectional correlation, however severe, is absorbed inside each period's estimate and never enters the standard error. The price is a different assumption — that the coefficients are not autocorrelated through time — which is far more palatable, and testable.

### A.3.2 First pass: the loadings

For each test asset $$i$$, run the time-series regression of §A.1.1 on the $$K$$ factors and keep the slopes $$\hat\beta\_{i,k}$$. Two design choices follow.

**Full-sample or rolling?** Estimating $$\hat\beta\_{i,k}$$ on the whole sample and then using it in every period's second pass is a *description*: it asks whether assets that were high-beta over the full period earned more on average. It uses future information in the loadings, so it is not a trading strategy and must not be presented as one. Estimating $$\hat\beta\_{i,k}$$ on a rolling prior window — sixty months is conventional, with a minimum of twenty-four — is *implementable*: everything entering the period-$$t$$ cross-section was knowable at $$t-1$$. Rolling betas are noisier, which matters for §A.3.4's attenuation, and they let loadings drift, which is either realism or noise depending on the asset.

The honest practice is to report both and say which question each answers. Chapter 19's data exercise, which sends the reader here, asks whether an intermediary factor prices the cross-section — a descriptive question, so full-sample betas are appropriate, with the rolling version as a robustness check.

**Test assets that are portfolios.** If the test assets are portfolios, they must be *reformed* on the same schedule as the sort that created them, and the first-pass regression is run on the portfolio's return series, not on the returns of a fixed set of firms. A "portfolio" in this literature is a rule, not a basket.

### A.3.3 Second pass: the cross-sectional regressions

In each period $$t$$, run a cross-sectional regression of that period's excess returns on the first-pass loadings:

$$
r\_{i,t} - r\_{f,t} = \hat\alpha\_t + \sum\_{k=1}^{K}\hat\lambda\_{k,t}\hat\beta\_{i,k} + u\_{i,t}, \qquad i = 1,\dots,N\_t
$$

The regression has $$N\_t$$ observations and $$K+1$$ parameters, and $$N\_t$$ may vary across periods without difficulty, which is how the unbalanced panels of §A.2.3 are handled. You now have $$T$$ estimates of the intercept and $$T$$ estimates of each price of risk. These are the hatted, dated objects `NOTATION.md` registers for §6.3.

The estimates of interest are the time-series means, and the standard errors come from the time-series standard deviations:

$$
\hat\lambda\_k = \frac{1}{T}\sum\_{t=1}^{T}\hat\lambda\_{k,t}, \qquad \mathrm{se}(\hat\lambda\_k) = \frac{s(\hat\lambda\_{k,t})}{\sqrt{T}}
$$

and identically for $$\hat\alpha$$. That is the whole procedure. Chapter 6's Problem 2 works it by hand on a four-asset, five-month panel and is worth doing before reading further, because everything below is a correction to this baseline rather than a change to it.

Two extensions belong here. If the $$\hat\lambda\_{k,t}$$ series is autocorrelated — check it, do not assume — replace $$s(\cdot)/\sqrt{T}$$ with a Newey-West standard error on the series of coefficients, with $$L$$ chosen by §A.1.2's rule. And if the model is stated with an intercept restriction, test $$\hat\alpha = 0$$ with the same machinery: under a model in which the factors are traded excess returns, the intercept should be zero and $$\hat\lambda\_k$$ should equal the factor's own average return, and both restrictions are testable with the $$t$$-statistics you already have.

![Figure A.3: The two passes](https://846781005-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3EupdX99vVBoNySDtmxb%2Fuploads%2Fgit-blob-6f259e9b7726c5e992f9e4e77990fae28c4b93ba%2Ffig_A_03_fama_macbeth.png?alt=media)

**Figure A.3: The two passes.** The procedure in one picture, with the shape of each pass's output made explicit. The first pass runs one time-series regression per asset over the whole sample and produces a matrix of loadings, one row per asset and one column per factor. The second pass runs one cross-sectional regression per period across all assets and produces a time series of prices of risk, one series per factor. The estimate of interest is the time-series mean of that series, and — this is the step that makes the method work — its standard error comes from the time-series standard deviation, not from any single cross-section. That is why Fama-MacBeth survives the cross-sectional correlation in returns that would make a pooled panel regression's standard errors meaningless: whatever is common to all assets in a given month moves that month's coefficient, and the dispersion across months prices it. What the picture also makes visible is the problem §A.3.4 corrects: the right-hand column of panel (a) is an *estimate*, and panel (b) then uses it as though it were data. *Source: Author's construction from Section A.3.*

### A.3.4 Errors in variables, and the Shanken correction

Here is the correction §6.3 explicitly defers to this appendix. It comes in two parts that are routinely confused: a bias in the estimate, and an understatement of its standard error. They have different causes, different magnitudes, and different fixes.

**Part one: attenuation.** The regressors in the second pass are not the true loadings $$\beta\_{i,k}$$; they are estimates $$\hat\beta\_{i,k} = \beta\_{i,k} + \eta\_{i,k}$$ carrying sampling error. This is the classical errors-in-variables problem, and its classical consequence is that the slope is biased toward zero:

$$
\mathrm{plim}\thinspace\hat\lambda\_k = \lambda\_k \cdot \frac{\mathrm{Var}(\beta\_{i,k})}{\mathrm{Var}(\beta\_{i,k}) + \mathrm{Var}(\eta\_{i,k})}
$$

The attenuation factor is the ratio of true cross-sectional dispersion in loadings to total observed dispersion. It is near one when loadings genuinely differ a lot across test assets and are estimated precisely, and near zero when they do not and are not.

The magnitudes decide the design. The standard error of a beta estimated over $$T$$ months is approximately $$\sigma\_{\varepsilon,i}/(\sigma\_f\sqrt{T})$$, where $$\sigma\_{\varepsilon,i}$$ is the asset's idiosyncratic volatility and $$\sigma\_f$$ the factor's. Table A.7 evaluates it at monthly magnitudes: a market volatility of 4.5 percent, an individual stock's idiosyncratic volatility of 10 percent, a diversified portfolio's of 1.5 percent.

**Table A.7: How much the price of risk attenuates**

| Test assets       | Estimation window | $$\mathrm{se}(\hat\beta)$$ | Cross-sectional $$\mathrm{Var}(\beta)$$ | Attenuation factor | $$\hat\lambda$$ shrinks by |
| ----------------- | ----------------- | -------------------------- | --------------------------------------- | ------------------ | -------------------------- |
| Individual stocks | 60 months         | 0.287                      | 0.25                                    | 0.752              | 25 percent                 |
| 25 portfolios     | 60 months         | 0.043                      | 0.04                                    | 0.956              | 4 percent                  |
| 25 portfolios     | 360 months        | 0.018                      | 0.04                                    | 0.992              | 1 percent                  |

*Source: Author's calculation, at a monthly factor volatility of 4.5 percent, idiosyncratic volatility of 10 percent for individual stocks and 1.5 percent for portfolios, and cross-sectional standard deviations of true beta of 0.5 and 0.2 respectively.*

This is the quantitative case for using portfolios as test assets, and it is a strong one: the attenuation falls from a quarter to a rounding error. The intercept moves in the opposite direction, mechanically, because the fitted cross-sectional line must pass through the point of means. If the true monthly price of market risk is 0.60 percent and average beta is 1.0, a 25 percent attenuation drives $$\hat\lambda\_M$$ to 0.45 and pushes $$\hat\alpha$$ from zero to $$0.60 - 0.45 = 0.15$$ percent per month. **A flattened security market line with a positive intercept is exactly what errors in variables produces**, which is why §4.9's empirical finding cannot be read off the raw regression without this correction — and why, once the correction is applied and the line is still flat, the finding survives and needs an economic explanation.

**Part two: the Shanken correction to standard errors.** Even with the bias set aside, the Fama-MacBeth standard error $$s(\hat\lambda\_{k,t})/\sqrt{T}$$ is too small, because it treats the first-pass $$\hat\beta$$ as if it were known. Shanken (1992) derived the adjustment. Let $$\hat\lambda$$ be the $$K$$-vector of estimated risk prices and $$\hat\Sigma\_f$$ the covariance matrix of the factors, the same objects §A.1.5 used. Then the corrected covariance matrix of the risk-price estimates is the Fama-MacBeth one multiplied by

$$
1 + \hat\lambda'\hat\Sigma\_f^{-1}\hat\lambda
$$

so that the corrected standard errors are $$\sqrt{1 + \hat\lambda'\hat\Sigma\_f^{-1}\hat\lambda}$$ times the uncorrected ones. (The intercept's variance takes a slightly different adjustment; the multiplicative form above is the one that matters in practice and is what is reported.)

The multiplier has a clean reading: $$\hat\lambda'\hat\Sigma\_f^{-1}\hat\lambda$$ is the **squared Sharpe ratio of the factors' tangency portfolio**, at the data frequency. The correction is therefore large when the factors are individually or jointly very profitable relative to their volatility, and small otherwise — which in monthly data means small, and in annual data means less small.

**Table A.8: The Shanken multiplier at three Sharpe ratios**

| Setting                   | Factor tangency Sharpe ratio | $$1 + \hat\lambda'\hat\Sigma\_f^{-1}\hat\lambda$$ | Standard errors inflated by |
| ------------------------- | ---------------------------- | ------------------------------------------------- | --------------------------- |
| Market alone, monthly     | 0.124                        | 1.015                                             | 0.8 percent                 |
| Market, SMB, HML, monthly | 0.200                        | 1.040                                             | 2.0 percent                 |
| Market alone, annual      | 0.300                        | 1.090                                             | 4.4 percent                 |

*Source: Author's calculation.*

Report the correction anyway. Two reasons. It is one line of code and its omission is a mark of carelessness that referees notice. And it becomes non-trivial precisely in the settings where a paper's claim is strongest — a proposed factor with a high in-sample Sharpe ratio inflates its own standard error, which is a small piece of automatic discipline in a literature that could use more of it. What the table should also settle is a common misreading: the Shanken correction is *not* the fix for the attenuation of Table A.7. That fix is to use precisely estimated betas, or an instrumental-variables or grouping estimator, or to abandon the two-pass design for the GMM of §A.5.

### A.3.5 Test assets, and the cost of choosing them well

The argument for portfolios is Table A.7. The argument against them took the profession thirty years to accept and is now decisive.

Sorting assets into portfolios on a characteristic destroys cross-sectional spread in *every other dimension* while preserving it in the sorted one. The 25 size and book-to-market portfolios have a very strong three-factor structure by construction: their average returns lie almost exactly on a two-dimensional surface, so any candidate factor whose loadings happen to line up with size or book-to-market will produce a high cross-sectional $$R^2$$ and a significant $$\hat\lambda$$. Lewellen, Nagel and Shanken (2010) made the point brutally by showing that factors constructed from macroeconomic noise — series with no plausible pricing content — clear the usual hurdles on these test assets. The tight factor structure that makes the betas precise is the same tight factor structure that makes the test uninformative.

Three partial remedies, none complete. **Expand the test assets** beyond the 25 to industry portfolios, bond portfolios, and sorts unrelated to the factor under test — a factor that prices size and book-to-market portfolios and nothing else has been shown to span two dimensions, not to be a discount factor. **Report the GRS or GMM test** rather than the cross-sectional $$R^2$$, which ignores the covariance structure the formal test accounts for. And **impose the theoretically correct restriction** where one exists: if the factor is a traded excess return then $$\lambda\_k$$ must equal $$E\[f\_k]$$, so testing whether $$\hat\lambda\_k = \bar f\_k$$ is a far more demanding exercise than testing whether $$\hat\lambda\_k > 0$$, and estimating $$\lambda\_k$$ freely throws away the model's sharpest prediction.

The same machinery applies to any characteristic a chapter proposes. §11.5's question — whether exposure to market-wide liquidity shocks is priced — is answered with exactly this apparatus: build a traded liquidity factor, estimate loadings on it in the first pass, and ask whether its price of risk is positive in the second, on test assets that were *not* sorted on liquidity. The last clause is the whole difficulty.

### A.3.6 Reporting

Report $$\hat\lambda\_k$$ with its Fama-MacBeth $$t$$-statistic and its Shanken-corrected $$t$$-statistic side by side; the intercept $$\hat\alpha$$ with its $$t$$-statistic, since the model says it is zero; and the **cross-sectional** $$R^2$$, defined on the time-series average returns:

$$
R^2\_{\mathrm{CS}} = 1 - \frac{\mathrm{Var}\_i\left(\bar r\_i - r\_f - \sum\_k \hat\beta \_{i,k}\hat\lambda\_k\right)}{\mathrm{Var}\_i\left(\bar r\_i - r\_f\right)}
$$

where $$\mathrm{Var}\_i$$ is the cross-sectional variance across the $$N$$ test assets. Note what it is not: it is not the second-pass regressions' average $$R^2$$, and it is not comparable across papers that use different test assets. A cross-sectional $$R^2$$ of 0.75 on the 25 size and book-to-market portfolios is unimpressive, for the reason §A.3.5 gives; the same number on forty portfolios spanning several sort dimensions is a result.

Finally, print the **pricing-error plot**: realized average excess return on the vertical axis, model-predicted average excess return on the horizontal, one point per test asset, with the 45-degree line drawn. Under a model that works, the points sit on the line. Under a model that does not, the *pattern* of departures is diagnostic in a way the $$R^2$$ is not — a set of points parallel to but above the line is a constant pricing error, meaning a missing intercept; points fanning out with predicted return is a slope problem, meaning the price of risk is wrong. That is what Chapter 19's fig\_19\_09 is showing when it puts the CAPM, the three-factor model, and each intermediary factor in four panels: the question is not which panel has the highest $$R^2$$ but which panel's errors have no structure left in them.

### Worked example: the two-pass procedure on French's 25 portfolios

This is the exercise Chapter 19's data exercise Part C step 4 sends the reader here for, and it is the same one §6.3 defers.

**Data.** `25_Portfolios_5x5` (monthly, value-weighted) and `F-F_Research_Data_Factors` from French's library, July 1963 onward. For the Chapter 19 version, add an intermediary factor: the He-Kelly-Manela capital-ratio factor from the authors' public data page, or a leverage factor built by hand from the Financial Accounts (Z.1) table L.130, as Chapter 19's exercise specifies.

**Procedure, in eight steps.**

1. Convert the 25 portfolio returns to excess returns using `RF`. Verify the sample runs to the same last month in both files; French updates them on different schedules and a one-month misalignment silently shifts every beta.
2. First pass: regress each of the 25 excess return series on `Mkt-RF`, `SMB` and `HML` over the full sample, saving the $$25 \times 3$$ matrix of $$\hat\beta\_{i,k}$$.
3. Second pass: for each month $$t$$, regress the 25 excess returns on a constant and the three columns of $$\hat\beta$$. Save $$\hat\alpha\_t$$ and the three $$\hat\lambda\_{k,t}$$.
4. Average each series over $$t$$; compute $$s(\cdot)/\sqrt{T}$$; form $$t$$-statistics.
5. Compute $$\hat\Sigma\_f$$, the $$3\times3$$ covariance matrix of the monthly factor returns, and the Shanken multiplier $$1 + \hat\lambda'\hat\Sigma\_f^{-1}\hat\lambda$$. Multiply the three standard errors by its square root and recompute the $$t$$-statistics.
6. Compare each $$\hat\lambda\_k$$ with the factor's own sample mean $$\bar f\_k$$. Under a model in which the factors are traded, these should coincide; the gap and its standard error are the sharper test.
7. Compute $$R^2\_{\mathrm{CS}}$$ from the formula above, and draw the pricing-error plot.
8. Repeat steps 2-7 with rolling sixty-month betas, and report how much of the answer survives.

**What to expect, and how to read it.** The market's price of risk will come out small and often insignificant, sometimes negative — this is the flat security market line of §4.7 in cross-sectional form, and §A.3.4 has just explained one mechanical reason for part of it. The intercept will be positive. HML's price of risk will be positive and reasonably well determined. The Shanken correction will move the $$t$$-statistics by around two percent, which will feel anticlimactic after the fuss; that is the correct lesson, and the reason to have computed Table A.8 rather than repeating a folk belief that the correction is decisive. The correction is *necessary and small*, which is a perfectly respectable thing for a correction to be.

**★ If you have WRDS.** Run the same two-pass procedure on individual stocks rather than portfolios, with rolling sixty-month betas, and compare $$\hat\lambda\_M$$ with the portfolio-based estimate. The gap is Table A.7's attenuation, measured rather than assumed. Then repeat with the instrumental-variables fix — use betas estimated on odd months to instrument for betas estimated on even months, which breaks the correlation between the measurement error and the regressor — and report how much of the gap closes.

***

## A.4 Event Studies

### A.4.1 Why a short window dodges the joint hypothesis

§7.3 states the argument in one sentence and this section supplies the arithmetic behind it, because the arithmetic is what makes the method defensible.

A test of market efficiency is always a joint test of efficiency and a model of expected returns, so a rejection can always be blamed on the model. The event-study response is not to solve the problem but to shrink it until it cannot matter. Take an annual expected equity return of ten percent. Over one trading day, with 252 days in a year, that is $$10/252 = 0.040$$ percent — **four basis points**. Now consider the entire range of disagreement about the right benchmark. A market model with $$\hat\beta = 1.2$$ instead of $$0.8$$ moves the expected daily return from 3.2 to 4.8 basis points. A five-factor model instead of the CAPM moves it by less. The entire span of plausible expected-return models is contained in about two basis points per day.

Against that, the abnormal return in Chapter 7's Table 7.2 worked window is 5.42 percent on the announcement day. The ratio of the finding to the maximum benchmark disagreement is roughly **340 to one**. The joint hypothesis has not disappeared — it never disappears — but it has been reduced to a rounding error, and that is why the method exported itself out of finance into law, accounting, antitrust and regulatory economics, where the question "did this announcement move the price" needs an answer that does not depend on a contested asset-pricing model.

The corollary is the one to hold onto: **the argument's force is entirely proportional to the shortness of the window.** Over three days the benchmark disagreement is five basis points against a finding of several percent, and the method is still sound. Over three years — roughly 756 trading days — the same daily disagreement compounds to about twelve percentage points, against long-horizon findings that are themselves of that order, and the method has inverted. Section A.4.6 is about what to do then.

### A.4.2 Windows

Four intervals, defined relative to the event date $$t = 0$$.

The **estimation window** is where the benchmark model's parameters are fitted. Conventionally 250 trading days — one year — for daily data, sometimes as few as 120, and 60 months for monthly data. It must be long enough to estimate $$\hat\alpha\_i$$ and $$\hat\beta\_i$$ with tolerable precision and short enough that the parameters have not drifted. It must **exclude the event window**, or the event's own return contaminates the benchmark and mechanically shrinks the abnormal return you are trying to measure.

The **gap** separates the estimation window from the event window, conventionally 10 to 30 trading days. Its purpose is to keep pre-event information leakage — the rumor, the unusual volume, the run-up — out of the parameter estimates.

The **event window** is where abnormal returns are cumulated. Its length is a substantive assumption about when the market could have learned the news, not a technical parameter, and it should be defended in the text. A window of $$(-1, +1)$$ around an earnings announcement covers the possibility that the news arrived after the previous close and was absorbed by the next open. A window of $$(0, +1)$$ assumes cleaner timing. A window of $$(-20, +1)$$ is an assertion that the information leaked for a month, and needs a reason. **Choosing the window after seeing the returns is the event-study version of the multiple-testing problem**, and it is why pre-registration of the window, or reporting several windows including the ones that do not work, is the standard a careful reader applies.

The **post-event window** is where drift is measured — $$(+2, +60)$$ for post-earnings-announcement drift, longer for the index-inclusion question of §17.4. It is a separate object from the event window and should never be silently merged into it.

![Figure A.4: Event-study timing](https://846781005-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3EupdX99vVBoNySDtmxb%2Fuploads%2Fgit-blob-f41c3d4a42ae297fe8225953570d8f789b052b8f%2Ffig_A_04_event_window.png?alt=media)

**Figure A.4: Event-study timing.** Panel (a) is the design: an estimation window long enough to fit the benchmark, a gap so that anticipation of the event cannot contaminate the fit, the event window that is actually tested, and a post-event window where benchmark misspecification returns with force because small errors in the expected return compound over months. Almost every methodological argument in this literature is an argument about where those four boundaries go. Panel (b) is the problem that most often invalidates a published standard error. Three firms announcing on the same calendar date do not supply three independent abnormal returns, because all three contain whatever the market did that day; treating them as independent understates the standard error by a factor that grows with the number of firms in the cluster. There are two honest fixes, and both cost something. Cluster on the event date, which is cheap and assumes the within-date correlation is the only dependence. Or form a calendar-time portfolio of all firms currently inside their event window and test its alpha, which is the more defensible design and which reduces a sample of thousands of events to a single monthly return series. *Source: Author's construction from Section A.4.*

### A.4.3 The benchmark

Three choices, in increasing order of ambition.

**Market-adjusted returns** set $$AR\_{i,t} = R\_{i,t} - R\_{M,t}$$, imposing $$\alpha\_i = 0$$ and $$\beta\_i = 1$$ without estimating anything. Requiring no estimation window is its advantage when the firm has no return history — a fresh IPO, which is exactly Chapter 12's setting.

**The market model** is the workhorse: fit $$R\_{i,t} = \alpha\_i + \beta\_i R\_{M,t} + \varepsilon\_{i,t}$$ on the estimation window and set

$$
AR\_{i,t} = R\_{i,t} - \left(\hat\alpha\_i + \hat\beta\_i R\_{M,t}\right)
$$

which is §7.3's definition, unchanged. A multi-factor version substitutes the three- or five-factor model.

**Characteristic matching** pairs each event firm with a control firm or portfolio of the same size, book-to-market and momentum, and takes the difference. It is the most defensible over long horizons because it does not require a linear factor model to be correctly specified — only that firms with the same characteristics have the same expected return.

Over a three-day window the three give nearly identical answers, as §A.4.1's arithmetic guarantees; over a three-year window they can give opposite signs. **The choice matters exactly when the window is long, and the honest presentation reports all three whenever it matters.**

### A.4.4 Abnormal returns, cumulation, and aggregation

For each event $$i$$ and each day $$t$$ in the event window, compute $$AR\_{i,t}$$. Cumulate across the window:

$$
CAR\_i(t\_1,t\_2) = \sum\_{t=t\_1}^{t\_2} AR\_{i,t}
$$

Cumulating by summing simple returns rather than compounding is deliberate: over a few days the difference is third-order, and the sum has a linear variance formula that the product does not. Over long horizons the choice becomes substantive, which is §A.4.6's subject.

Then average across the $$N$$ events:

$$
\overline{CAR}(t\_1,t\_2) = \frac{1}{N}\sum\_{i=1}^{N} CAR\_i(t\_1,t\_2)
$$

Idiosyncratic noise falls at rate $$1/\sqrt{N}$$, which is what makes the method work: a single firm's 5.42 percent abnormal return is unremarkable, and the same average across two thousand firms is a fact about the world. Plot the average cumulative abnormal return day by day across the whole window, including the pre-event days, because the *shape* is diagnostic. A flat line before the event and a jump at zero is clean disclosure. A steady climb into the event is leakage or anticipation. A jump at zero followed by continued drift is Chapter 7's post-earnings-announcement drift, and the drift portion is the anomaly, not the jump.

### A.4.5 Standard errors, and the clustering problem

Three corrections, in increasing order of importance. §7.3 promises all three here.

**Correction one: estimation error in the benchmark.** The abnormal return uses $$\hat\alpha\_i$$ and $$\hat\beta\_i$$, which are estimates, so $$AR\_{i,t}$$ contains their sampling error in addition to the true residual. With an estimation window of $$L\_1$$ days, an event window of $$L\_2$$ days, and residual standard deviation $$\sigma\_i$$:

$$
\mathrm{Var}\big(CAR\_i(t\_1,t\_2)\big) = \sigma\_i^2\left\[L\_2 + \frac{L\_2^2}{L\_1} + \frac{\left(\sum\_{t=t\_1}^{t\_2}(R\_{M,t}-\bar R\_M)\right)^2}{L\_1\hat\sigma\_M^2}\right]
$$

The first term is the naive one. The second is the cost of estimating $$\hat\alpha\_i$$; the third is the cost of estimating $$\hat\beta\_i$$, and it grows when the market itself moved unusually during the event window, because that is when a beta error does the most damage. Evaluate at $$\sigma\_i = 1.8$$ percent, $$L\_1 = 250$$, $$L\_2 = 3$$, a market that ran three percentage points above its mean over the window, and a daily market volatility of 1.1 percent: the bracket is $$3 + 0.036 + 0.030 = 3.066$$ against a naive 3.000, so the standard error is 3.15 percent instead of 3.12 — an increase of **1.1 percent**. The correction is real, it is standard, and for a short window with a long estimation window it is negligible. It stops being negligible when $$L\_2/L\_1$$ is not small: at $$L\_2 = 60$$ against $$L\_1 = 250$$ the inflation is 11 percent, and a long-horizon study that ignores it is understating its standard errors by more than a tenth.

**Correction two: cross-sectional versus time-series variance.** The formula above builds the variance of $$\overline{CAR}$$ out of estimation-window residual variances. The alternative is to compute the sample variance of the $$N$$ realized $$CAR\_i$$ values directly and divide by $$N$$. The two differ, and the difference is informative. If the event itself raises return volatility — and most corporate events do, since the announcement resolves uncertainty — then estimation-window variance understates event-window variance and the time-series estimator over-rejects. Brown and Warner (1985) documented this and the standard fix is to use the cross-sectional estimator, or the larger of the two, whenever event-induced variance is plausible. That is nearly always.

**Correction three: event-date clustering, which is the one that decides papers.** Both estimators above assume the $$N$$ events are independent. They are not independent when they share a calendar date, because on that date every event firm's residual contains the same market-wide surprise. This is the clustering problem of §A.1.2, and in event studies it is devastating rather than merely important.

Let $$\bar\rho$$ be the average pairwise correlation of abnormal returns across the clustered events. Then

$$
\mathrm{Var}\big(\overline{CAR}\big) = \frac{\sigma\_{CAR}^2}{N}\Big\[1 + (N-1)\bar\rho\Big], \qquad N\_{\text{eff}} = \frac{N}{1+(N-1)\bar\rho}
$$

Table A.9 evaluates it. The setting is 100 events with $$\sigma\_{CAR} = 3.15$$ percent and a mean $$\overline{CAR}$$ of 1.2 percent — a respectable result by the standards of the literature.

**Table A.9: What event-date clustering does to a significant result**

| Average cross-correlation $$\bar\rho$$ | Variance inflation | $$\mathrm{se}(\overline{CAR})$$ | $$t$$ | Effective number of events |
| -------------------------------------- | ------------------ | ------------------------------- | ----- | -------------------------- |
| 0 (events spread across dates)         | 1.00               | 0.315%                          | 3.81  | 100.0                      |
| 0.05                                   | 5.95               | 0.769%                          | 1.56  | 16.8                       |
| 0.15 (all events on one date)          | 15.85              | 1.255%                          | 0.96  | 6.3                        |

*Source: Author's calculation.*

A $$t$$-statistic of 3.81 becomes 0.96. One hundred events sharing a calendar date carry the statistical content of six independent ones. This is not a subtle correction, and it is the reason the following designs are structurally suspect: regulatory events, where every affected firm reacts on the announcement day; index reconstitution, where all additions share an effective date, which is precisely §12.9's and §17.4's setting; and industry shocks. The available responses are to cluster the standard errors on the event date, which is the formula above; to use a **calendar-time portfolio**, forming a portfolio of all firms currently in an event window and running one time-series regression on its return, which handles cross-correlation automatically because the portfolio return already aggregates it; or to build the test around within-date cross-sectional *variation*, comparing firms with large and small treatment intensity on the same date, which differences out the common shock.

### A.4.6 Long-horizon event studies

Everything above degrades as the window lengthens, and it degrades faster than intuition suggests. Three problems compound.

**The benchmark returns with force.** Section A.4.1's protection was proportional to window shortness. Over five years, a benchmark misspecified by two percentage points a year generates ten percentage points of spurious abnormal return — larger than most published long-horizon effects. §12.4's long-run underperformance of new issues is the canonical battleground, and Fama's (1998) verdict is that most of the long-horizon anomalies literature is measuring benchmark error.

**Buy-and-hold returns are badly behaved.** The natural long-horizon statistic is the **buy-and-hold abnormal return**,

$$
\mathrm{BHAR}\_i = \prod \_{t=1}^{H}(1+R \_{i,t}) - \prod \_{t=1}^{H}(1+R \_{\text{bench},t})
$$

and compounding makes its distribution severely right-skewed: a firm can gain 400 percent and can only lose 100. The sample mean is then pulled by a handful of survivors and the $$t$$-statistic is badly sized. Barber and Lyon (1997) and Lyon, Barber and Tsai (1999) document the problem and propose skewness-adjusted and bootstrapped tests, which help. The deeper issue is that the sampling distribution is not close to normal at any sample size a corporate-finance study can attain.

**Overlapping events induce cross-correlation.** With a five-year window, firms doing an event in 2019 and 2021 share three years of calendar time and therefore share market shocks. The clustering problem of §A.4.5 now applies to nearly every pair of events in the sample, and $$N\_{\text{eff}}$$ collapses.

The **calendar-time portfolio** approach, associated with Fama (1998) and implemented carefully by Mitchell and Stafford (2000), addresses all three at once. In each calendar month, form a portfolio of every firm that had the event within the past $$H$$ months; take that portfolio's return; run one time-series regression of the resulting monthly series on the factor model; and read the abnormal performance off the intercept. Cross-correlation is inside the portfolio and therefore inside the residual variance, where it belongs. The number of observations is the number of calendar months, honestly. The cost is a loss of power — the portfolio's composition changes over time and event months with few firms are noisy — and a weighting decision: value-weighting the calendar-time portfolio asks whether the *aggregate* wealth effect was abnormal, equal-weighting asks whether the typical event firm's was, and the two routinely disagree, with equal-weighted results substantially stronger. Report both. Chapter 12's data exercise asks for exactly this, in six specifications, and then asks which one you would print.

### Worked example: an event study on free data

**The data problem, stated honestly.** The ideal free event study would combine a public event set with daily security-level returns. Public event sets are easy — S\&P publishes index-change press releases, EDGAR carries every 8-K and Schedule 13D with a timestamp, the Federal Reserve publishes its meeting calendar years in advance. Free daily *security-level* returns with a reliable adjustment for splits and dividends are the missing piece; the sources that offer them do not offer them stably enough to anchor a textbook exercise. **So the baseline example substitutes an aggregate event study for a firm-level one**, and states the substitution rather than hiding it.

**The design.** Estimate the market's abnormal return on the day before scheduled FOMC announcements. This is Lucca and Moench's (2015) **pre-FOMC announcement drift**, and it is a genuine, replicable, and slightly scandalous result: over 1994 to 2011 US equities earned an average excess return on the order of 49 basis points in the 24 hours preceding a scheduled FOMC announcement. At eight meetings a year that is roughly 3.9 percentage points, a large share of the realized equity premium over the period, earned on days when by construction no monetary news has yet been released.

**Data.** Daily `F-F_Research_Data_Factors_daily` from French's library, which gives `Mkt-RF` and `RF` from July 1926. FOMC meeting dates from the Federal Reserve's public calendar, which lists scheduled meetings back to the 1930s and marks unscheduled ones. Both free, both stable.

**Procedure, in seven steps.**

1. Build the event list: scheduled FOMC announcement dates from 1994 onward, when the Committee began announcing decisions on a fixed schedule. Drop unscheduled meetings — they are news events of a different kind, and including them confounds the design.
2. For each event, define day 0 as the announcement date and the event window as $$(-1, 0)$$.
3. Benchmark: the market-adjusted approach is unavailable, since the market *is* the asset. Use the unconditional mean instead — estimate $$\hat\mu$$, the average daily `Mkt-RF`, over a 250-day estimation window ending 30 days before the event, and set $$AR\_t = (\text{Mkt-RF})\_t - \hat\mu$$.
4. Compute $$CAR\_i(-1,0)$$ for each meeting and average across meetings.
5. Standard errors, three ways: the estimation-window formula with the $$L\_2/L\_1$$ correction; the cross-sectional standard deviation of the $$CAR\_i$$; and a clustered version treating each calendar year as a cluster, since the eight meetings in a year share a policy regime. Report all three.
6. Placebo test: repeat the entire procedure on the same weekdays in weeks with no scheduled meeting. If the pre-FOMC window is special, the placebo should return nothing. **This step is not optional** — it is what separates an event study from a data-mining exercise, and it costs four lines of code.
7. Split the sample at 2011, the end of Lucca and Moench's window, and report both halves. §6.4's post-publication decay and Chapter 7's efficiency-as-a-margin reading both predict a weaker effect after publication; whether your data agree is the interesting part, and either answer is worth writing down.

**What the exercise teaches.** Every mechanical piece of §§A.4.2 to A.4.5 appears: the estimation window and gap in step 3, the window choice in step 2, the three standard errors in step 5, the clustering in step 5's third variant, and the placebo in step 6. What it cannot teach is cross-sectional aggregation across firms, since there is one asset. That gap is the reason for the starred extension.

**★ If you have WRDS.** Run the firm-level version. Take S\&P 500 additions from the index provider's announcement releases, merge them onto CRSP daily returns, and compute $$\overline{CAR}$$ over the announcement-to-effective window and over $$(+1, +60)$$, by decade. Cluster on the effective date, because additions bunch on quarterly rebalance dates and Table A.9 is about exactly this design. Then split the modern sample by whether the added firm was already held by broad total-market indices at a similar weight, which is §17.4's migration argument. This is Chapter 12's data exercise item 13 and Chapter 17's unresolved question, and the clustering correction is what decides whether the modern inclusion effect is small or merely imprecisely measured. The same design, with 13D filings from EDGAR in place of index additions, is Chapter 24's activism exercise; with merger announcements, it is Chapter 22's.

***

## A.5 GMM, in Sketch

This section is a bridge, not a course. Its purpose is to let a reader recognize what a GMM estimate is when Chapters 5 and 20 refer to one, and to see why the framework is the natural home for the pricing equation. The *Empirical Methods* volume develops it properly; nothing in this book's body requires more than what follows.

### A.5.1 The pricing equation is a moment condition

Chapter 3's central equation is $$1 = E\[m R\_i]$$ for every asset $$i$$, or equivalently $$E\[m R\_i - 1] = 0$$. That is a statement that the expectation of a particular function of the data and the parameters equals zero — which is exactly the object generalized method of moments estimates. No auxiliary regression, no distributional assumption, no linearization: the theory delivers the estimating equation directly.

Let $$\theta$$ be the parameter vector — under power utility, $$\theta = (\delta, \gamma)$$, the discount factor and risk aversion of `NOTATION.md`'s core block — and let $$m\_{t+1}(\theta) = \delta (c\_{t+1}/c\_t)^{-\gamma}$$. For $$N$$ assets, define the $$N$$-vector of per-period pricing errors and its sample mean:

$$
\mathrm{pe}\_t(\theta) = \Big\[m \_{t+1}(\theta)R \_{i,t+1} - 1\Big] \_{i=1}^{N}, \qquad g\_T(\theta) = \frac{1}{T}\sum \_{t=1}^{T}\mathrm{pe}\_t(\theta)
$$

The vector $$g\_T$$ always carries the sample-size subscript and an argument, which is what separates it on the page from the core block's log consumption growth $$g$$; the two never appear in the same expression.

Conditioning information enters by multiplying each moment by an **instrument** — any variable in the date-$$t$$ information set $$\Omega\_t$$ of §7.1, such as a lagged dividend-price ratio or a lagged consumption growth rate. Since $$E\[m\_{t+1}R\_{i,t+1} - 1 \mid \Omega\_t] = 0$$, the product of the pricing error with any such variable also has expectation zero. So $$N$$ assets crossed with a handful of instruments generate many moment conditions from the same two or three parameters, which is where the overidentification of §A.5.2 comes from.

### A.5.2 The estimator, the weighting matrix, and the J-test

Three equations.

$$
\hat\theta = \arg\min\_\theta g\_T(\theta)' W g\_T(\theta)
$$

$$
W^{\text{opt}} = S^{-1}, \qquad S = \sum\_{j=-\infty}^{\infty}E\Big\[\mathrm{pe}\_t(\theta)\mathrm{pe} \_{t-j}(\theta)'\Big]
$$

$$
\mathrm{J} = T \cdot g\_T(\hat\theta)' \hat S^{-1} g\_T(\hat\theta) \sim \chi^2\big(\text{number of moments} - \text{number of parameters}\big)
$$

The first line says: choose parameters that make the pricing errors as small as possible, in a metric $$W$$. The second says the statistically efficient metric weights each moment by the inverse of its long-run covariance matrix, so that precisely measured moments count for more — and $$\hat S$$ is estimated by the Newey-West formula of §A.1.2, which is where that machinery reappears. The third is **Hansen's (1982) test of the overidentifying restrictions**: if there are more moments than parameters, the model cannot set every pricing error to zero, and the weighted sum of the remaining errors has a known distribution under the null that the model is true. The statistic is set in roman, in the manner of the book's other computed statistics, which separates it from §6.4's $$J$$, the number of hypothesis tests run against one dataset.

When moments and parameters are equal in number the system is **just identified**, $$g\_T(\hat\theta) = 0$$ exactly, and $$\mathrm{J}$$ is identically zero with zero degrees of freedom — there is nothing to test. Overidentification is what buys a test, and it is bought by adding assets or instruments.

### A.5.3 What GMM buys, and what it costs

It buys three things. It handles **nonlinear** models — a power-utility discount factor is nonlinear in $$\gamma$$, and no regression can estimate it. It requires **no distributional assumption**, only that the moments exist and a central limit theorem applies, which is why the GRS test's normality assumption can be dropped. And it delivers a **specification test for free**, in the $$\mathrm{J}$$-statistic, which is more than most estimators offer.

It costs three things. The estimates are consistent but can be badly biased at the sample sizes finance actually has, particularly with the efficient weighting matrix, which is estimated from the same data. The $$\mathrm{J}$$-test has a perverse property that every user should know: **a model with imprecise moments is harder to reject**, because $$\hat S^{-1}$$ down-weights noisy moments, so a bad model tested on noisy data can pass. And the results depend on the weighting matrix, so two papers estimating the same model can disagree because they weighted differently. The standard defense is to report the estimate under a fixed, pre-specified weighting matrix — the identity, or the second-moment matrix of returns, which Hansen and Jagannathan proposed precisely so the metric would not be chosen by the data — alongside the efficient one.

### A.5.4 The relationship to Fama-MacBeth

They coincide more than they differ. A linear factor model's SDF is $$m = a - \sum\_k b\_k f\_k$$ (§3.6's notation), and the moment conditions $$E\[mR\_i - 1] = 0$$ are linear in $$b$$. Estimating $$b$$ by GMM with a particular weighting matrix reproduces the two-pass cross-sectional regression's estimates exactly, and the GMM standard errors then *automatically* include the Shanken correction of §A.3.4 — because GMM knows that the betas were estimated, and accounts for it in the same asymptotic calculation rather than as a bolt-on. The mapping between $$\hat b$$ and $$\hat\lambda$$ is a linear transformation involving the factor covariance matrix.

This is the useful way to think about §A.3.4: the Shanken correction is not an ad hoc patch but the two-pass estimator's version of a term GMM produces on its own. Cochrane (2005) develops the equivalence in full, and it is the one place in this appendix where a reader who wants the general statement should go to a source beyond it.

### Worked example: the consumption model by GMM

**Data, all free.** Real personal consumption expenditures on nondurable goods and services from FRED (`PCNDGC96` and `PCESVC96`), divided by population (`POP`) to get per-capita real consumption, at annual frequency. One caution that Appendix B states in general and that bites here: chained-dollar series are not additive, because the chain weights differ across categories, so adding the two series is an approximation. Where BEA publishes a nondurables-plus-services aggregate, use it, and state in your source line which construction you used. Real returns on the S\&P composite and on the long rate from Robert Shiller's `ie_data` file, annual, from 1871. Align on the calendar year and use the timing convention Chapter 5's Box on the national accounts sets out — consumption is a flow over the year and the return is a point-to-point change, and the mismatch is a real assumption, not a technicality.

**Procedure.** Two assets: the real equity return and the real riskless return. Two instruments: a constant and the lagged dividend-price ratio. Four moments, two parameters $$(\delta, \gamma)$$, so two overidentifying restrictions and $$\mathrm{J} \sim \chi^2(2)$$, with a five percent critical value of 5.99. Minimize $$g\_T(\theta)'Wg\_T(\theta)$$ first with $$W = I$$, then iterate to the efficient weighting matrix with a Newey-West $$\hat S$$ at one or two lags, and report both.

**What to expect, and what it means.** The estimate of $$\gamma$$ will be very large — in the range §5.3's calibration implies, tens rather than single digits — and its standard error will be larger still, wide enough to contain both economically sensible values and absurd ones. The $$\mathrm{J}$$-statistic will often fail to reject. **Do not read that as the model passing.** A test that cannot reject a model whose point estimate of risk aversion is fifty is a test with no power, and §A.5.3 explained exactly why: the moments are imprecise, so the efficient weighting matrix discounts them. The right report is the point estimate, the standard error, the $$\mathrm{J}$$-statistic, *and* the observation that the confidence interval is uninformative — which is the equity premium puzzle stated in the language of a formal estimator rather than of a calibration. Chapter 5 reaches the same destination by arithmetic; this exercise shows that the destination does not depend on the route.

***

## A.6 Machine Learning Mechanics for §6.5

### A.6.1 The problem being solved

§6.5 reports that flexible methods beat linear ones at forecasting the cross-section of returns. This section supplies the mechanics, and it begins with the feature of the problem that makes finance different from every other application of these tools.

The signal-to-noise ratio is extraordinarily low. A monthly $$R^2$$ of 0.4 percent is a *good* result here; in the applications machine learning was developed for — image recognition, language, credit scoring — an $$R^2$$ of 0.4 percent would indicate that something had gone wrong. The binding constraint is therefore not model capacity but **overfitting**, and every technique below is a device for spending degrees of freedom carefully.

The effective sample is also much smaller than it looks. Thirty thousand stocks over 720 months is 21.6 million observations, but the cross-section is dominated by a handful of common factors, so the number of *independent* observations is closer to the number of months. This is §A.1.2's clustering problem in its most severe form, and it is why the protocol of §A.6.5, rather than the choice of algorithm, is the substance of this section.

### A.6.2 Penalized regression

Start from OLS and add a penalty on the size of the coefficients. Standardize the predictors first — this matters, because a penalty on raw coefficients penalizes variables measured in small units more — and let $$j$$ index them. The three estimators are:

$$
\hat b\_{\text{ridge}} = \arg\min\_b \left\lbrace (y-Xb)'(y-Xb) + \varphi\sum\_{j} b\_j^2 \right\rbrace = (X'X + \varphi I)^{-1}X'y
$$

$$
\hat b\_{\text{lasso}} = \arg\min\_b \left\lbrace (y-Xb)'(y-Xb) + \varphi\sum\_{j} |b\_j| \right\rbrace
$$

$$
\hat b\_{\text{enet}} = \arg\min\_b \left\lbrace (y-Xb)'(y-Xb) + \varphi\Big\[\varrho\sum\_j |b\_j| + (1-\varrho)\sum\_j b\_j^2\Big] \right\rbrace
$$

The penalty parameter is written $$\varphi$$ and the elastic net's mixing weight $$\varrho$$, because $$\lambda$$ is this book's price of risk and $$\rho$$ its correlation coefficient; the literature's $$\lambda$$ for the penalty is one of the more unfortunate notational collisions in the field. Ridge has a closed form and lasso does not, which is a computational detail. The economically meaningful difference is in what each does to a coefficient. When the regressors are orthonormal, both have explicit solutions that make the contrast vivid: ridge multiplies every OLS coefficient by $$1/(1+\varphi)$$, and lasso applies a **soft threshold**, subtracting a constant from the magnitude of each coefficient and setting to zero any coefficient smaller than the threshold.

**Table A.10: What shrinkage does to two coefficients**

| Estimator              | Large coefficient | Small coefficient |
| ---------------------- | ----------------- | ----------------- |
| OLS                    | 0.80              | 0.15              |
| Ridge, $$\varphi = 1$$ | 0.40              | 0.075             |
| Lasso, threshold 0.20  | 0.60              | 0.00              |

*Source: Author's calculation, orthonormal regressors.*

Ridge shrinks everything proportionally and keeps everything; lasso shrinks everything by a constant and discards what does not survive, which makes it a **selection** device as well as a shrinkage device. Elastic net interpolates, and its practical advantage is with correlated predictors: lasso confronted with three nearly identical characteristics picks one arbitrarily and zeroes the others, which makes its variable selection unstable across samples, while elastic net spreads the weight.

Which to prefer is an empirical question with a clear answer in this setting. Kozak, Nagel and Santosh (2020) estimate an SDF from a large set of characteristic portfolios and find that heavy shrinkage toward the leading principal components works well out of sample while sparse models do badly — **there is no near-sparse stochastic discount factor hiding in the data**. That is an argument for ridge-like shrinkage over lasso-like selection, and, as §6.5's starred section says, it is uncomfortable for anyone who wanted the factor zoo to collapse to five animals.

The interpretation is Bayesian and worth stating plainly: a ridge estimate is exactly the posterior mean under a normal prior centered at zero, with $$\varphi$$ inversely proportional to the prior variance. Choosing a penalty is therefore choosing how strongly you believe, before seeing the data, that most characteristics do not predict returns. Given §6.4's evidence on the factor zoo, believing that strongly is not conservatism. It is calibration.

### A.6.3 Trees, forests, and neural networks

**A regression tree** partitions the predictor space by repeated binary splits, choosing at each step the variable and threshold that most reduce the sum of squared errors, and predicts the mean of the training observations in each terminal region. Its appeal here is that it captures **interactions** automatically: a split on momentum inside a branch already split on market capitalization *is* the statement that momentum works differently in small stocks, with no interaction term specified in advance. Its defect is instability — a single tree deep enough to be useful is fitted to noise. **Random forests** average many trees, each grown on a bootstrap resample with each split chosen from a random subset of predictors; averaging reduces variance, and restricting the candidate predictors decorrelates the trees, which is what makes the averaging effective. **Gradient boosting** instead grows shallow trees sequentially, each fitted to the residuals of the ensemble so far, and typically outperforms forests here at the cost of greater hyperparameter sensitivity.

**Neural networks** at the depth Gu, Kelly and Xiu (2020) use are modest by contemporary standards: three to five hidden layers, a few dozen units per layer, rectified-linear activations, trained with stochastic gradient descent and heavy regularization — weight decay, dropout, early stopping, and ensembling across random initializations. Performance *peaks* at three to five layers and deteriorates beyond, which is not a failure of implementation but the expected consequence of §A.6.1's signal-to-noise ratio: deeper networks have more capacity to fit noise, and there is mostly noise.

### A.6.4 IPCA

Instrumented principal components analysis (Kelly, Pruitt and Su 2019) deserves separate treatment because it answers a different question from all of the above. The prediction methods ask what forecasts returns; IPCA asks whether characteristics are proxies for **covariances**, as the APT of §6.1 requires, or predict returns directly, in which case something other than risk is at work.

The model puts the characteristics into the loadings rather than into expected returns:

$$
r\_{i,t+1} = \beta\_{i,t}' f\_{t+1} + \varepsilon\_{i,t+1}, \qquad \beta\_{i,t} = c\_{i,t}'\Gamma
$$

where $$c\_{i,t}$$ is the vector of asset $$i$$'s observable characteristics at $$t$$ — `NOTATION.md`'s symbol, unchanged — the latent factors $$f\_{t+1}$$ are estimated along with everything else, and $$\Gamma$$ is the matrix mapping characteristics into loadings. Estimation alternates between solving for $$\Gamma$$ given the factors and for the factors given $$\Gamma$$, which is why the method is called instrumented principal components: it is a principal-components problem in which the loadings are constrained to be linear in observables.

The test is then sharp, and it is the sharpest available on the characteristics-versus-covariances question. Fit the restricted model above. Then fit an unrestricted version that adds a term $$c\_{i,t}'\Gamma\_\alpha$$ to the right-hand side, letting the characteristics move expected returns directly rather than only through the loadings, and test whether $$\Gamma\_\alpha$$ is jointly zero. Under the APT it must be: characteristics are permitted to determine exposures and nothing else. Kelly, Pruitt and Su find that around five latent factors with characteristic-driven loadings absorb most of the cross-section and that the residual direct characteristic effects are largely insignificant. Characteristics are covariances, on this evidence — with factors nobody has named.

### A.6.5 The protocol, which is the section's real content

Everything above is available in a library. The protocol is not, and it is what separates the Gu-Kelly-Xiu results from the factor zoo of §6.4.

**Split the sample chronologically into three consecutive blocks.** A **training** window, where parameters are fitted at a given hyperparameter setting. A **validation** window, immediately after it, where hyperparameters are chosen by comparing fitted models. A **test** window, immediately after that, which is touched exactly once, to report performance. Then roll all three forward — by a year, conventionally — refit, and repeat. Ordinary $$k$$-fold cross-validation, which shuffles observations at random into folds, is **wrong here** and not by a small margin: shuffling puts future observations in the training set, and in a series with common factors that is a direct information leak.

**Six rules, each of which corresponds to a way real studies have gone wrong.**

1. **No look-ahead in the characteristics.** A characteristic used to forecast the return from $$t$$ to $$t+1$$ must have been publicly available at $$t$$. Accounting variables need the reporting lag of §A.2.3; index membership must be recorded as of the date it took effect rather than backfilled from a current constituent list; anything whose value depends on a later restatement is disqualified.
2. **Hyperparameters are chosen in the validation window only.** The penalty $$\varphi$$, the tree depth, the number of layers — all selected by validation-window performance, never by test-window performance. Choosing a hyperparameter because it did well on the test set converts the test set into a training set, silently.
3. **Standardize using training-window moments only.** Computing the mean and standard deviation of a predictor over the full sample and using them to standardize the training data leaks the future into the past. This is the most common leak in practice because it feels like preprocessing rather than estimation.
4. **The universe must be point-in-time.** Building the stock universe from firms that exist at the end of the sample is survivorship bias, and it is worth more than most published alphas.
5. **Report the whole rolling path, not the best window.** A method that works in three of ten rolling test windows and is reported on the average is a different claim from one that works in nine.
6. **State the number of specifications tried.** This is §6.4's discipline applied to oneself. The protocol does not solve the multiple-testing problem — the researcher has seen the out-of-sample period in every previous paper, and the profession has collectively mined it — but it converts an unfalsifiable claim into a measurable one.

**Define** $$R^2\_{\mathrm{OOS}}$$ **on the test window, and state its benchmark.** Two definitions circulate and they are not comparable. For **aggregate** return predictability, the benchmark is the historical mean, following Goyal and Welch (2008):

$$
R^2\_{\mathrm{OOS}} = 1 - \frac{\sum\_t (r\_{t+1} - \hat r\_{t+1})^2}{\sum\_t (r\_{t+1} - \bar r\_t)^2}
$$

where $$\bar r\_t$$ uses only data through $$t$$. For the **cross-section of individual stocks**, Gu, Kelly and Xiu use zero rather than the historical mean in the denominator, on the ground that an individual stock's historical mean return is so noisy that it makes an artificially easy benchmark. Zero is the more demanding choice, and comparing a cross-sectional $$R^2\_{\mathrm{OOS}}$$ against an aggregate one without noting the difference is a category error.

### A.6.6 How to read an out-of-sample $$R^2$$ of one percent

§6.5 asserts that 0.4 percent is not trivially small. Here is why, in two calculations.

**The cross-sectional calculation.** Suppose monthly individual stock returns have a standard deviation of 12 percent and a forecast achieves $$R^2\_{\mathrm{OOS}} = 0.4$$ percent. Then the standard deviation of the fitted values is $$\sigma\_{\hat r} = 0.12\sqrt{0.004} = 0.76$$ percent per month. Sort on the forecast and form decile portfolios: for a normally distributed signal, the mean of the top decile is 1.755 standard deviations above the mean and the bottom decile symmetrically below, so the expected long-short decile spread is $$2 \times 1.755 \times 0.76 = 2.7$$ percent per month before costs. A tiny $$R^2$$ and a very large portfolio return are the same number, because the sort concentrates the whole signal into the tails.

Two immediate qualifications, both of which §6.8 would insist on. That calculation is equal-weighted and equal weighting puts the money in microcaps, so the value-weighted spread is much smaller — Gu, Kelly and Xiu report annualized Sharpe ratios near 1.3 on the value-weighted version, roughly double what linear methods deliver. And the strategy's turnover is high, so realized returns net of the transaction costs of Chapter 11 are a fraction of the gross figure.

**The market-timing calculation.** For aggregate returns, Campbell and Thompson (2008) supply the translation. An investor with mean-variance preferences who times the market on a forecast with out-of-sample $$R^2$$ raises the squared Sharpe ratio from $$\mathrm{SR}^2$$ to $$(\mathrm{SR}^2 + R^2)/(1-R^2)$$. At a monthly Sharpe ratio of 0.12 — roughly the historical US equity figure — and $$R^2\_{\mathrm{OOS}} = 0.5$$ percent, the Sharpe ratio rises to 0.140, an increase of **16 percent**. A number that rounds to zero in a regression table is a sixth of the risk-adjusted performance of the entire equity market.

Both calculations are gross of costs, gross of the capacity constraint of §6.8, and computed on a signal assumed stable. All three qualifications cut the same way, which is why the correct reading of a one percent out-of-sample $$R^2$$ is neither "trivial" nor "a money machine" but "economically large and operationally difficult" — the standing condition of every result in Part II.

### Worked example: OLS, ridge, and lasso on French's portfolios, with and without a leak

**Data.** `25_Portfolios_5x5` (monthly, value-weighted) and `F-F_Research_Data_Factors` from French's library. Deliberately small, so the exercise runs in seconds and the protocol is the object of attention rather than the computation.

**Predictors.** For each of the 25 portfolios in month $$t$$: its own returns in months $$t-1$$ through $$t-12$$; its rolling estimates of the three factor loadings, computed on data through $$t$$ only; and the market's own returns in months $$t-1$$ through $$t-12$$. Twenty-seven predictors, standardized. Target: the portfolio's excess return in month $$t+1$$.

**Procedure.**

1. Split chronologically: train on months 1 to $$T\_1$$, validate on $$T\_1+1$$ to $$T\_2$$, test on $$T\_2+1$$ to $$T\_2+12$$. Use eighteen years, six years, and one year, and roll forward annually.
2. In each training window, fit OLS, ridge over a grid of $$\varphi$$, and lasso over a grid of $$\varphi$$.
3. Select $$\varphi$$ for each by mean squared error on the validation window. Do not look at the test window.
4. Refit at the selected $$\varphi$$ on training plus validation combined, then forecast the test window.
5. Accumulate squared errors across all rolling test windows and report $$R^2\_{\mathrm{OOS}}$$ for each of the three methods, using both benchmark conventions of §A.6.5 and labeling which is which.

**Then break it, deliberately, three ways, and report what each break buys.**

* **Leak the standardization**: compute predictor means and standard deviations over the *full* sample rather than the training window, and rerun.
* **Leak the hyperparameter**: choose $$\varphi$$ by test-window performance rather than validation-window performance, and rerun.
* **Leak the ordering**: replace the chronological split with shuffled five-fold cross-validation, and rerun.

**What to expect.** Unregularized OLS with twenty-seven correlated predictors and a short training window will produce a *negative* $$R^2\_{\mathrm{OOS}}$$ — worse than forecasting zero — which is §6.5's first result reproduced at toy scale. Ridge and lasso will land near zero and sometimes slightly above. Each of the three leaks will improve the reported $$R^2\_{\mathrm{OOS}}$$, and the shuffled cross-validation will improve it most, by a margin comparable to the entire honest signal. **That margin is the exercise.** It is the size of the result a researcher can obtain from a protocol error, in a setting where the true signal is known to be near zero, and it is the reason §A.6.5 is the longest subsection of §A.6 and the shortest to state: the protocol is the finding.

**★ If you have WRDS.** Rerun on individual stocks with a realistic characteristic panel — the open-source characteristic libraries built from CRSP and Compustat are the practical route — and compare the ranking of methods with Gu, Kelly and Xiu's. Then add transaction costs at Chapter 11's estimates and report how much of the long-short decile spread survives. The gap between the gross and net numbers is where §6.8's capacity argument lives.

***

## Further Reading

For depth beyond course use, and never for a prerequisite: Cochrane's *Asset Pricing* (2005) for the GMM treatment and the equivalence of §A.5.4; Campbell, Lo and MacKinlay's *The Econometrics of Financial Markets* (1997) for the event-study and predictive-regression material at greater length; MacKinlay (1997) and Kothari and Warner (2007) as event-study surveys; Lewellen, Nagel and Shanken (2010) on what cross-sectional tests do and do not establish; Harvey, Liu and Zhu (2016) on the multiple-testing correction; and Gu, Kelly and Xiu (2020) for the machine-learning comparison whose protocol §A.6.5 codifies. The companion *Empirical Methods* volume treats asymptotic theory, alternative estimators, and the panel methods this book does not use.
