The Factor Zoo
Hundreds of factors have been published with t-statistics above two. How many of them are real?
Toss two hundred coins twenty times each and a few will look biased. The published factors were found the same way, by many researchers testing many ideas on one history. The part raises the hurdle properly: family-wise error and false discovery rates, replication studies with open data, the decay of returns after publication, shrinkage of t-statistics toward what they would be without selection. Then it asks the constructive question, how to compress hundreds of characteristics into a few priced components, with shrinkage of the cross-section, principal components and instrumented PCA.
What you need. Parts 6 and 24.
What you will be able to do
Undergraduate
- Explain why testing many factors raises the bar for each, and compute a Bonferroni threshold.
- Describe publication bias and post-publication decay.
Master's
- Control the false discovery rate with Benjamini-Hochberg and estimate the share of true nulls; shrink a cross-section of t-statistics by empirical Bayes.
- Extract latent factors with PCA, RP-PCA and IPCA and compare models out of sample.
PhD
- Prove that Benjamini-Hochberg controls the FDR under independence; derive Storey's estimator and the local false discovery rate; state the weak-factor problem.
Industry
- Read a factor paper as an allocator would: what was tried, what was reported, what survives costs.
Contents
Each chapter has a home level. Choose a track to see what to read and watch: Undergraduate 15 min · Master's 38 min · PhD 54 min · Industry 20 min.
- 0Two hundred coinsUndergraduate3 min
- 1Hundreds of factors, and a rising hurdleUndergraduate4 min
- 2Multiple testing: FWER and FDRUndergraduate5 min
- 3Replication and open-source asset pricingMaster's4 min
- 4Decay, shrinkage and publication biasMaster's4 min
- 5Data-mined against peer-reviewedMaster's3 min
- 6Shrinking the cross-sectionPhD4 min
- 7Taming the zooPhD3 min
- 8Weak factorsPhD3 min
- 9PCA, RP-PCA and IPCAMaster's4 min
- 10Comparing modelsMaster's4 min
- 11Registration and holdout accountingIndustry2 min
- 12Rule 25: the SDF modelIndustry2 min
- For the researcher: how many anomalies are real?PhD6 min
- Recap, desk questions, problemsAll tracks4 min
Also on this page: Lecture · Key results · Try it · Lab · Problems · Reading · 中文 · Build the film.
Lecture
The text of each chapter is the film's narration, as it is spoken, so you can read along or revise without the film. The pictures are in the film. A dashed box stands for a number the film computes when it is rendered (hover over it to see what is computed); the README's figures for each chapter, where it lists them, follow the chapter's text.
Two hundred coinsUndergraduate3 min
The factor zoo: hundreds of published return predictors, and the statistical assumptions needed to distinguish evidence from selection.
Two hundred trading strategies, each with twenty years of monthly returns, and every one of them pure noise: the true premium is exactly zero. Sort them by their t-statistic. About one in forty clears the textbook hurdle of two by chance alone, and the best has a t-statistic near three. Published as the only strategy its author tried, it would look like a discovery. Finance has tested far more than two hundred.
Why does this happen in practice? The file drawer: the strategies that failed are not written up, so a reader sees the winner and none of the losers it was chosen from. And the garden of forking paths: even a single idea has many versions, which months, which stocks, which weights, which lag, and each choice is a test, made quietly. The cure is a count: report how many were tried, and judge the best against the best of that many noise strategies.
This public collection reconstructs published stock-return predictors. Its cumulative count grows past two hundred by 2016. Cochrane called the expanding literature a zoo. Inclusion in this published collection is already selection; neither a reported significant result nor its reproduction establishes a persistent premium. The count omits unpublished searches, and the modern release is not a historical data vintage.
The tools came from statistics first: Sture Holm's step-down procedure in 1979, Yoav Benjamini and Yosef Hochberg's false discovery rate in 1995, Halbert White's reality check for data snooping in 2000. Finance caught up as the zoo grew: Cochrane named it in 2011, and Campbell Harvey, Yan Liu and Heqing Zhu argued in 2016 that a new factor should need a t-statistic above three. Then came shrinkage and selection methods built for many factors at once, the replication studies, and open-source data that anyone can check.
The plan: the best of many noisy strategies; familywise and false-discovery corrections with their assumptions; replication, publication and decay; shrinkage and factor selection; weak identification and principal components; conditional mean-variance model comparisons; and what a registered fresh test would need to establish. This review does not open or score the sealed experiment.
In the House, the research desk adds its first statistical model of returns: a discount factor that loads on the whole zoo at once, shrunk toward caution, and kept honest by counting every trial. By the end of the part it will be registered, and opened on the sealed years, like the factors of Part twenty-four.
1Hundreds of factors, and a rising hurdleUndergraduate4 min
The arithmetic of searching, and the hurdle it implies. Start with independent standard-normal Z variables. Their maximum has cumulative probability Phi c raised to n exactly. This is a normal reference model, not an exact formula for the finite-sample Student-t draws in the later simulation. For large n the expected normal maximum grows roughly as the square root of two log n, with material finite-n corrections. Typical mean maxima are near one point five for ten, two point five for one hundred and three point two for one thousand. The asymptotic expression is not an accurate small-search formula, and dependence changes the maximum's distribution.
Put a number on it. A t-statistic of two point nine, on its own, has a one-sided p-value of about two in a thousand. But if it is the best of n tries, the right question is how likely the best of n is to reach two point nine: one minus the chance that all n fall short. For two hundred independent tries, about thirty-one percent. The impressive result is what noise produces about one time in three. The same number on the page means completely different things depending on a count the page does not show.
A fixed diagnostic illustrates base rates. Suppose one hypothesis in ten is non-null, and power at the chosen threshold is one half. With a five-percent null rejection probability, the positive predictive value is about fifty-three percent. If the null rejection probability falls to roughly three in a thousand and power were still one half, it would approach ninety-five percent. In a real test, raising the threshold also reduces power. Neither this assumed base rate nor fixed power is estimated from the zoo, so this arithmetic cannot calibrate a universal t threshold.
Simulated, with twenty years of monthly data each. With ten tries the best noise strategy has a t near one and a half; with fifty, above two; with two hundred, near two point eight, or three if you are willing to flip the sign of a losing strategy and call it a short. The shaded band shows the luck around that: with two hundred tries, a best t-statistic of three and a half happens one time in twenty.
Count each predictor published so far as one member of a declared family. Under valid standard-normal null calibration, the two-sided Bonferroni hurdle rises as that count grows. The union-bound guarantee permits arbitrary dependence; it does not fix invalid p-values. The count in this collection omits unpublished choices, and dependence-aware or selective procedures need their own assumptions. These are illustrative normal critical values, not certified finite-sample Student-t thresholds for the observed returns.
Harvey, Liu and Zhu estimated the scale of the published and unpublished search. Their count of three hundred and sixteen published factors by 2012 motivated a hurdle above three under their modelling choices. It is not a universal calibrated threshold for every signal. Bonferroni does not require independent tests: with valid marginal p-values it controls any family error under arbitrary dependence. Correlation can make it conservative. False discovery control answers a different question and has its own assumptions. Harvey's presidential address also emphasised incentives that reward significant results and repeated search.
Here is the zoo against those hurdles. Each predictor's t-statistic in the sample its own paper used, rebuilt from the data. Eighty-seven percent clear two; fifty-eight percent clear three. A t of three is not a high bar for the zoo, because the zoo was assembled by clearing bars: we see the papers that found something. The question for the rest of this part is how much of that something survives.
You test two hundred strategies and report the best, with a t-statistic of two point nine. What is its p-value, honestly computed, and what would you need to know to compute it?
2Multiple testing: FWER and FDRUndergraduate5 min
Three corrections for many tests, and what each one promises. The familywise error rate is the probability of at least one false rejection in a fixed family. Bonferroni tests each hypothesis at alpha divided by the family size. Valid marginal null p-values and the union bound give control under arbitrary dependence. For two hundred and twelve hypotheses the five-percent two-sided normal critical value is about three point seven. The return-based p-values shown later use naive iid mean t statistics and normal tails, so this algebra does not certify their empirical error rate under serial dependence or publication selection.
Holm's step-down procedure retains family-error control. Sort the p-values; compare the smallest with alpha over m, then alpha over m minus one, stopping at the first failure. For a fixed family and valid marginal p-values it works under arbitrary dependence and rejects every hypothesis that ordinary Bonferroni rejects, possibly more. Neither procedure repairs invalid p-values or an undisclosed search.
Benjamini and Hochberg control the false discovery rate: the expected false share, with the share defined as zero when there are no discoveries. This is an expectation over repeated samples, not a bound on every realised false share or on a portfolio's loss. Sort the p-values and reject through the last crossing of the rising line. The guarantee needs valid null p-values and independence or the specific positive-regression-dependence condition called PRDS. Arbitrary correlation, publication selection or invalid time-series p-values do not automatically satisfy it.
The two error rates, in one table. Of m tests, some have no true premium and some do. We declare R of them significant; V of those are false discoveries. The familywise error rate is the chance that V is at least one. The false discovery rate is the expected value of V over R: the share of what we declare that is wrong. With hundreds of tests and many true effects, the first is almost impossible to keep small without discarding nearly everything; the second is not.
By hand, on five p-values. Bonferroni tests each at one percent: two pass. Holm tests the smallest at one percent, the next at one and a quarter, the third at one and two thirds, the fourth at two and a half: three pass, and the fourth fails at zero point zero three. Benjamini and Hochberg compare the k-th smallest with k percent: the fourth, at three percent, is under its four percent line, so four are rejected. The looser the goal, the more discoveries, and the more of them may be false.
The chart retains the smallest eighty post-publication p-values, with their full observed range. They use next-calendar-year returns through 2020 and the published direction. The selected published collection and modern data reconstruction remain. Under these approximate normal p-values the BH last crossing is the twenty-fourth, and Bonferroni admits seven. The normal calibration and dependence requirements are not certified by placing the observations after a publication date. The first-eighty view is labelled; all two hundred and eight p-values enter the saved procedure.
The counts are descriptive. In original paper windows, one hundred and eighty-five of two hundred and twelve pass nominal tests, and BH keeps one hundred and eighty-four. These observations inherit discovery and publication selection. In the next-year post-publication windows through 2020, the saved one-sided procedure gives fifty-nine raw crossings, twenty-four BH rejections and seven Bonferroni rejections among two hundred and eight. These are not certified fresh discoveries under arbitrary return dependence or modern selection. Shorter samples, changing effects and power also matter; nonrejection does not establish that a predictor is false.
A dependence-aware bootstrap requires its own design and assumptions. Common-time resampling preserves contemporaneous cross-strategy dependence; block or other time-series schemes may be needed for serial dependence. Recentering can impose a null for the chosen statistic. Reality-check and step-down methods use maxima, appropriate studentisation and valid resampling approximations. Their finite-sample guarantee is not automatic, and the resulting critical value need not always be below Bonferroni's. This chapter describes those methods; it does not execute a corrected market bootstrap or substitute a new inference result.
Choose q before viewing discoveries, for a declared statistical objective. Under valid assumptions, five-percent FDR bounds the expected false-rejection fraction across repetitions. Multiplying a realised twenty-four discoveries by point zero five is not a conditional expected error count guaranteed by that theorem. A looser q changes the error objective and discoveries, but no q alone controls economic losses, common exposures, tail events or funding risk. A diversified-looking list can still share the same risks. Statistical discovery and portfolio construction require distinct decisions.
Three habits. Choose a stated error objective for a fixed family: FWER or FDR answers different statistical questions, and neither directly controls economic loss. Dependence-aware resampling needs valid time-series design and regularity; it is not automatically safer or less conservative. Retain the search family, variants and inherited selection. The local ledger helps document declared choices but is not a complete count of all unpublished research.
You have a hundred candidate signals and will trade the ten best, equally weighted. Which error rate should you control, and at what level?
3Replication and open-source asset pricingMaster's4 min
Does the zoo replicate? Two famous answers that disagree, and the open data that lets anyone check.
In 2020 Kewei Hou, Chen Xue and Lu Zhang rebuilt four hundred and fifty-two anomalies with one common recipe: breakpoints from the New York Stock Exchange, so that tiny stocks do not dominate, and value weights. Sixty-five percent failed to reach a t-statistic of two, almost all of the anomalies based on trading frictions among them. With a hurdle of two point eight, eighty-two percent failed. A replication crisis, it seemed, like psychology's.
Andrew Chen and Tom Zimmermann answered differently. They published open-source code and data for more than two hundred predictors, each rebuilt exactly as its original paper built it, with the paper's own weighting, breakpoints and sample. That separates two questions that had been merged: does the paper's own result reproduce, and does the effect survive a common, conservative method? And it gives the zoo a census anyone can check. It is the data this part uses.
The public release contains monthly predictor returns and documentation. Each return column follows the documented published strategy, with reconstruction differences and modern data revisions. The metadata include publication year, original sample years and reported t-statistic. The original-sample mask uses those years, without an extra December 2020 cap. The post-publication mask begins in the following calendar year, ends by December 2020 and requires twenty-four finite months. These are published, selected predictors. Later chapters additionally select a complete-history universe using observations through 2023, so none of these labels reconstructs a pristine real-time research process.
Here is the first question answered. Each dot is a predictor: the t-statistic its paper reported, against the one Chen and Zimmermann get rebuilding it. Eighty-eight percent reproduce a t-statistic above two. Most land a little below the diagonal, typically at about nine tenths of the published value: rebuilt from today's version of the data, a signal usually comes out slightly weaker than its authors reported. The papers mostly describe what is in the data. Whether it is a premium is a different question.
So why did Hou, Xue and Zhang find failure? Mostly construction. A result depends on the signal and also on the weights, the breakpoints, the treatment of microcaps, the sample and the holding period. Equal weights with breakpoints from all stocks let thousands of microcaps, a few percent of the market's value, drive the result. With value weights and exchange breakpoints, many anomalies shrink toward zero, above all those based on trading frictions, which live in the stocks that are hardest to trade.
How much do microcaps matter? Eugene Fama and Kenneth French defined them as stocks below the twentieth percentile of exchange-listed size. They are about three in five of all stocks and about three percent of the market's value. In an equal-weighted portfolio they are most of the holdings; value-weighted, they barely count. They also have the widest spreads and the hardest borrowing, so a premium that lives in them is the hardest to collect.
Then the counter-argument. Theis Jensen, Bryan Kelly and Lasse Pedersen built a hundred and fifty-three factors in ninety-three countries and a Bayesian model of replication. Most factors replicate, measured by their CAPM alphas; they cluster into thirteen themes; and they work out of sample abroad. They traced the gap with Hou, Xue and Zhang to the choice of test, to corrections that treat related factors as unrelated, and to the hurdle. And in their model, many related factors working is evidence for each of them: a zoo of cousins supports the family. Both papers are careful. They answer different questions.
An anomaly has a t-statistic of four equal-weighted, and one point two value-weighted with exchange breakpoints. Is it real? Would you trade it, and how big?
4Decay, shrinkage and publication biasMaster's4 min
Part three measured how anomalies decay after publication. This chapter asks how much of that decay a statistician should have predicted.
Consider an illustrative normal-normal empirical-Bayes model: each t equals a latent strength plus independent unit-variance normal noise, with a normal prior across strengths. Its posterior mean pulls deviations toward the fitted prior mean by v over v plus one. This is conditional on that model, not an identified truth about published predictors. The method-of-moments estimate subtracts one from the observed t variance and floors it above zero. The saved shrinkage slope is about eighty-three percent. That is the slope on deviations from the prior mean, not a predicted fraction of each premium retained. Publication selection and correlated estimation errors are omitted.
Two examples. A predictor with a t-statistic of seven is pulled down a little, to about six and a half. A marginal one at two and a half is pulled up, toward the zoo's average of nearly four. Measured against the zoo it came from, a weak result looks better than it is, because the zoo is full of strong ones. That is the first hint that noise around the published numbers is not the whole story: the zoo itself was selected.
The original paper-window mean is plotted against the mean from the next publication calendar year through 2020, requiring at least twenty-four finite post-publication months. Across two hundred and eight selected predictors the descriptive slope is about point four three, and the ratio of average means is point three eight. The scatter contains unequal horizons and modern revised data. This ratio is distinct from the empirical-Bayes slope on t deviations, and neither identifies how much publication caused returns to fall.
These bars compare two different diagnostics. Point eight three is the slope of a conditional posterior mean around a fitted prior mean. Point three eight is the ratio of post-publication to original-window average returns. Their difference is not an estimate of publication's causal cost and is not a valid additive decomposition of bias. Selection, changing samples, data revisions, risk and economic adaptation can all matter. A selected published universe requires an explicit selection model before either bar becomes a calibrated forecast.
McLean and Pontiff report a descriptive timeline for their ninety-seven-predictor study. Returns are lower after the original sample and lower again after publication. The displayed twenty-six and additional thirty-two percentage points describe those comparisons. Their interpretation invokes statistical bias and learning, with supporting evidence, but the percentages alone are not an identified causal decomposition for this zoo. The sample, vintage, construction and dependence assumptions differ from the current public panel.
By the kind of data a predictor uses. Signals built from prices alone, the cheapest to compute and to trade on, kept the least, under three tenths. Accounting and analyst signals kept a little over a third. The handful of signals built from institutions' holdings kept almost everything, though six is too few to lean on. The pattern fits arbitrage: what is easiest to exploit decays fastest.
Publication-bias estimates are model conditional. A truncation model of published t-statistics can yield a small correction under its selection and distribution assumptions. It cannot enumerate every specification search or identify all biases in revised histories. Descriptive post-publication decay also mixes changing samples, risk, costs, competition and noise. These data alone do not show that learning caused most of the decline. Retaining one third to one half of the published return is a sensitivity scenario, not a universally calibrated forecast. Implementation costs and prediction uncertainty must be considered separately.
A new paper reports an anomaly with a t-statistic of three and a half and zero point eight percent a month. What return would you plan for if you traded it from next year, and why?
5Data-mined against peer-reviewedMaster's3 min
A test of the whole enterprise: do published, theorised predictors do better than ones found by brute force?
Andrew Chen, Alejandro Lopez-Lira and Tom Zimmermann ran the experiment. Take pairs of accounting items and form every ratio, and every change in a ratio: about twenty-nine thousand signals, with no idea behind any of them. For each published predictor, find the mined signals that would have passed a t of two in the same years: what a data miner with no theory would have published instead. Then compare what each does after its sample ends.
First, what chance alone would give. If none of the twenty-nine thousand signals had any premium, about four and a half percent would still clear a t of two in any sample: some thirteen hundred false positives. About eighty would clear three. So the miner's winners surely include many duds. The interesting question is whether they do any worse, out of sample, than the journals' winners.
The cited working paper reports similar retention for its mined and peer-reviewed groups. The approximate displayed figures are version-dependent findings from that study, not recomputed experiments here. Some mined themes precede the corresponding publications in its retrospective design. This comparison does not identify a universal causal effect of peer review, certify a real-time opportunity, or forecast the net performance of a newly mined signal. Its construction, selection, dependence and implementation assumptions matter.
A second result. Predictors whose papers explained them as compensation for risk did not hold up better than the others, and in some comparisons did worse. That is not a paradox. A real mispricing decays as it is traded away, and so does a mispricing that was labelled a risk premium. The label is cheap; out-of-sample returns are not. Part twenty-three's rule, that every premium must state its reason, still stands: the reason is how the House knows what to stress, not proof that the premium will last.
Yan and Zheng study about eighteen thousand fundamental signals using a bootstrap reference for chance discoveries. Their reported excess of high statistics is evidence under that paper's sample, null and dependence assumptions. It does not by itself identify an implementable causal premium or show that a search count removes every bias. Published data mining can be evaluated transparently when construction, search, calibration and independent validation are documented; counting alone is insufficient. No additional market bootstrap or signal search is run here.
For the research desk. A mined signal, honestly counted and tested out of sample, is evidence of the same quality as a published one. What separates them is the count: the miner knows it tried twenty-nine thousand, and a paper rarely says how many versions it tried. Part twenty-nine builds the House's own alpha miners, and they will run the trial counter into the millions.
A colleague mined ten thousand ratios and found one with a t-statistic of four and a half in 1980 to 2000, and two point four in 2001 to 2020. Is it a discovery? What hurdle should each period face?
6Shrinking the cross-sectionPhD4 min
Instead of choosing a few factors, use all of them, and shrink. For excess or long-short factor returns, normalise the mean of a linear discount factor to one. Zero pricing errors imply that means equal covariances times b. This linear kernel need not stay positive. The plug-in loading is inverse covariance times means, also the tangency-portfolio direction under unrestricted weights. The computed F times b is a portfolio return, not the discount factor itself. Estimated means and small covariance eigenvalues make the weights noisy. The published-predictor panel also selects complete histories using later missingness, so this is not a reconstructed real-time opportunity set.
Kozak, Nagel and Santosh motivate shrinkage through beliefs about plausible mean-variance opportunities. This code illustrates isotropic ridge in the original factor units; it is not an exact reproduction of every paper specification. The covariance plus gamma identity is solved against the mean vector. Rescaling factor columns changes this isotropic prior. In principal components, each unshrunk loading is multiplied by its eigenvalue over eigenvalue plus gamma. Small-variance directions are shrunk more under this rule. The exact Bayesian interpretation and mapping from kappa require a specified prior and moment convention.
Two directions, in numbers. Both earn two tenths of a percent a month. One has a variance of one percent, the other a hundredth of that. The plug-in discount factor loads one hundred times more on the small direction, because the same mean on a hundredth of the variance is a Sharpe ratio ten times higher. With gamma at a thousandth, the big direction keeps nine tenths of its loading and the small one keeps one eleventh. Shrinkage distrusts exactly the high Sharpe ratios that rest on very little variance, which is where estimation error hides.
The original illustration chooses kappa by three-fold cross-validation of average-return pricing fit. Each fold is a consecutive block, but fitting uses the other blocks, including future months when evaluating an earlier block. Full-sample covariance also calibrates the penalty grid. The training fit improves as shrinkage vanishes. The displayed fold score penalises unstable fitting, but its maximiser is selected on the entire research window. This is an internal selection diagnostic, not a chronological forecast or an independent test. Neither a small grid nor a hump-shaped curve eliminates selection uncertainty.
Three qualifications to the original selection. Contiguous blocks keep neighbouring months together, but fitting on the other folds still uses future observations for earlier validation. There is no chronological forecast, purging or gap. The cross-sectional R squared measures held-block average-return pricing fit, not a realised trading forecast. Choosing among twenty kappa values still creates selection uncertainty. Full-window penalty calibration and later use of this selected kappa prevent the subsequent date split from being an independent validation.
What does the chosen discount factor load on? Short-term reversal leads by far, then industry momentum, a measure of efficiency, quarterly profitability and intermediate momentum. Short-term reversal turns over its whole portfolio every month, so its paper return is the one most exposed to trading costs. The discount factor is a statistical object that prices the zoo. It is not yet a fund.
The original split fits weights on 1973 through 2000 and evaluates them in 2001 through 2020. Kappa was chosen using the whole research window, and the universe uses complete histories through 2023. This is a retrospectively selected split with hyperparameter and universe information from the later window, not independent validation or reconstructed real-time availability. The split scales portfolios using the fitting window. The separate full-window series uses full-window volatility scaling. Both omit realistic financing, borrow, costs and capital constraints. No corrected strategy or new test is substituted.
Three qualifications. Sparse representations depend on the coordinate system; conclusions about characteristic versus component sparsity are empirical paper findings, not a theorem that one representation always wins. The plotted factor portfolio is a research-return combination, with missing financing, borrow, costs, capacity and capital constraints. Its covariance normalization does not make it a feasible fund. Twenty shrinkage settings are in the existing local ledger. The future-complete universe, future CV folds and full-window hyperparameter choice remain inherited selection, even though this review adds no trials or scores.
Under what assumptions can ridge shrinkage improve later-window performance, and which directions does this isotropic rule shrink most? Does the preserved selected split establish that it always beats the unshrunk portfolio?
7Taming the zooPhD3 min
A test for the question every new factor should face: what does it add?
One conditional pricing question asks whether a new factor has an SDF loading after controls. Use excess returns and a centered linear kernel normalised to mean one; that kernel need not be positive. The resulting cross-sectional mean equation involves covariances and SDF loadings, not automatically the factors' own mean premia. With many controls, selection and weak identification affect inference. A nonzero fitted loading alone does not establish a causal risk story.
The lasso selects variables automatically: an absolute-value penalty sets most coefficients exactly to zero. But one lasso is not enough. It can drop a control that matters only through its correlation with the new factor, and then the new factor's coefficient silently absorbs the missing control's effect. That is omitted-variable bias, chosen by an algorithm.
A fixed omitted-variable example clarifies the motivation. Let the new covariance exposure have no structural loading but be ninety percent correlated with an old exposure that does. If the old exposure is omitted, the new one borrows its coefficient by the standard regression formula. A second selection is designed to retain predictive controls, but penalties and finite noise can still miss them. Bias removal and valid inference require assumptions beyond drawing the two-step diagram.
Feng, Giglio and Xiu motivate double selection; this implementation is a simplified illustration. Select controls predicting cross-asset means. Also select controls predicting covariances with the candidate, then retain their union. The implementation scales columns without demeaning in the no-intercept lassos. The final regression adds an intercept and reports cross-asset HC0. It omits dependent portfolio errors, time-series uncertainty in estimated covariances and the full selection correction. Its t values are heuristic diagnostics, not the paper's formal valid inference.
The preserved illustration compares twenty-five predictors published from 2011 with fifty-three published by 2003. The universe is selected using complete histories through 2023, while these regressions use 1973 through 2020. The twelve displayed rows are ranked by their own mean t, not their average returns. The mean t is an iid benchmark. The no-control SDF coefficient uses cross-asset HC0. So does the simplified double-selection coefficient. Crossing one point nine six here is not a multiplicity-adjusted, dependence-valid discovery or proof of an incremental opportunity.
The saved counts are descriptive. Twenty-one own-mean t values exceed one point nine six, fourteen absolute no-control loading t values cross that threshold, and five simplified double-selection values do. These are different questions and heuristic standard errors, so the bars are not nested sets of certified discoveries. The paper's formal method requires additional assumptions and inference. Failure to reject a loading does not prove exact return spanning or no investor benefit.
Interpret the result conditionally. Exact payoff spanning would eliminate a new payoff for an unrestricted investor, but an insignificant loading does not establish spanning. Controls, universe, sample, penalties and error model determine the question. Publication-year grouping with revised complete histories is not a reconstruction of what an earlier researcher knew. The desk should retain those choices, report the heuristic limitations, and reserve independent evidence for any claim of incremental value.
A new factor has a t-statistic of five on its own, but its discount-factor loading is insignificant after double selection. What has the test told you, and would you still hold it?
8Weak factorsPhD3 min
A statistical trap hidden inside the two-pass regressions of Part six: weak factors. The second pass of a Fama-MacBeth test regresses assets' average returns on their estimated betas. If the factor really moves the assets, the betas are spread out and the slope, the premium, is well identified. But if the factor is weak, its true betas are all close to zero, and the estimated betas are mostly noise. The slope becomes a ratio of noises, with no reason to be near the true premium, and the usual standard errors badly understate the uncertainty. Raymond Kan and Chu Zhang showed that a useless factor can look priced this way.
A simulation. Fifty assets, forty years, a factor with a true premium of half a percent a month. When the factor is strong, with betas around one, the two-pass estimates cluster around the truth. Make the same factor weak, betas around one twentieth, and the estimates spread from minus six tenths to plus three quarters, centred near zero. The truth is the same half percent in both. The weak factor's premium is simply not identified by these test assets.
A classical errors-in-variables example explains one mechanism. Assume an intercept, independent additive beta error, and structural residuals uncorrelated with the true beta and its error. The limiting cross-sectional slope is multiplied by true-beta variance divided by true-beta plus error variance. With variances point zero one and point zero four, that factor is one fifth. Estimated factor betas need not satisfy these classical independence assumptions; weak identification and generated regressors can behave differently. This is an illustration, not a general identity for every two-pass risk-premium estimator.
And a second problem. A model rarely contains every factor that prices the assets. If an omitted factor's betas are correlated with the included factor's, its premium leaks into the estimate. Stefano Giglio and Dacheng Xiu showed that the bias does not go away with more data, and that the same factor gets different premia from different sets of test assets.
A three-pass framework addresses omitted latent factors under strong assumptions. PCA estimates a sufficiently pervasive latent factor span from many test assets; finite data do not guarantee that every factor is recovered. The estimated latent factors are priced with normalization and rank conditions. The candidate's exposure to that span links its premium to the latent prices. Weak factors, insufficient pervasiveness and misspecification still threaten identification. Later work studies more informative test-asset selection; it does not make weak identification disappear automatically.
Two habits follow. Before estimating any premium, check that the factor moves the test assets at all: the spread of its betas and their t-statistics. And be most suspicious of non-traded factors, consumption or inflation: they are often weak, and the premia estimated for them from portfolio sorts can be almost anything. Part twenty-three's consumption model was an example.
A macro factor's estimated premium is zero point eight percent a month, with a t of two and a half, but its betas on the test portfolios all have t-statistics below one. What do you conclude?
9PCA, RP-PCA and IPCAMaster's4 min
Let the data find the factors: three ways, and what each one optimises. Start with the zoo's covariance. A hundred and fifty-four long-short portfolios, but how many independent directions? The first principal component explains a third of their variance, five explain two thirds, ten three quarters. The zoo moves as a few themes and a long tail, as Part twenty-four's thirteen themes suggested.
Ordinary PCA uses the centered covariance, so directions are ranked by variance rather than mean-return efficiency. Risk-premium PCA adds a weighted mean outer product to the second moment. Here gamma is fixed at ten in the original computation. At minus one the matrix is the centered covariance with denominator T: it has the same eigenvectors as the usual T minus one covariance, but not the same eigenvalues. Means can reveal low-variance directions, yet remain noisy and sensitive to published-universe selection.
Compare the first components in the preserved split calculation. Ordinary PCA ranks variance, and its first component has little subsequent mean-variance performance in this sample. The risk-premium component has a higher saved later-window Sharpe ratio. That is a descriptive contrast, not proof that the first component is unrewarded risk or that RP-PCA discovers the true discount factor. Both inherit the complete-history and published-universe selection.
The original fit uses 1973 through 2000 to estimate component weights and their tangency combination, then evaluates fixed weights in 2001 through 2020. The asset universe was selected for complete observations through 2023, so this is a retrospective split on a selected panel. The chart retains all ten component counts for ordinary PCA. It also retains all ten for gamma-ten RP-PCA. Reading the best point from these curves is another selection. Reported Sharpe ratios omit financing, borrow, trading costs and feasible capital constraints; none certifies an independent implementable winner.
Gamma controls a mean-variance trade-off. At minus one the matrix has ordinary PCA directions. For very large positive gamma the leading direction approaches the mean vector in the chosen factor units; it is not automatically equal risk. This original calculation fixes gamma at ten and does not tune it, but a fixed literal does not establish that a historical decision preceded all knowledge of the test period. Means and asset selection still use noisy published histories. Their precision depends on dependence and model structure, not simply on having many columns.
The alpha table asks a different question. Component directions are trained in the earlier window, but the displayed intercepts are fitted on the later 2001 through 2020 returns themselves. These are retrospective later-window RMS intercepts, with no joint uncertainty test, rather than fully frozen out-of-sample forecasts. Smaller RMS alpha is not exact payoff spanning. The saved residual means remain material, and the universe was selected using complete observations through 2023.
Instrumented PCA lets individual-stock betas be functions of observable characteristics, jointly fitted with latent factors. This is a conditional factor-model restriction, not a statement that characteristics literally equal covariances. Comparing specifications with and without characteristic-driven alpha asks a conditional empirical question under the model and inference assumptions. Nonrejection of alpha is not proof of exact pricing or a unique causal risk channel. This lecture presents the method conceptually; it does not estimate stock-level IPCA or create another market test.
Two conditional lessons. Variance, mean-return fit and characteristic-driven factor exposures define different objectives and restrictions. A low-dimensional combination can have a higher saved later-window score while leaving material intercepts. Those intercepts are fitted on the later data, and the universe is selected. The comparison does not prove a true discount factor, exact payoff spanning or a universal future winner.
Why can the first principal component of the zoo, which explains a third of its variance, have almost no average return, and what does that say about using PCA to build a discount factor?
10Comparing modelsMaster's4 min
Not whether a model is true, but which of several is best. Part twenty-four related conditional mean alpha to the gain in maximum squared Sharpe. This needs matching moments and unrestricted portfolio weights; the finite-sample GRS statistic also has model-specific scaling. Barillas and Shanken show how traded-factor models can be compared using the factors themselves. For a common union opportunity set and consistent moments, the factors with higher attainable squared Sharpe leave a smaller mean-variance gap. That criterion does not prove a risk-based explanation, exact payoff spanning, superiority for every constrained investor, or a fresh out-of-sample winner. Estimation and model selection uncertainty remain.
Why can test assets mislead? When they are built from a model's own sorts, they flatter it: the twenty-five size and value portfolios suit the three-factor model because its factors were built from the same sorts. And when the assets have a strong factor structure, almost any factor correlated with that structure appears to price them, with a high R squared, as Lewellen, Nagel and Shanken showed with deliberately meaningless factors. The remedy is the Sharpe-ratio comparison, and test assets the modeller did not choose.
The table preserves seven named models on the same observed calendar. Maximum squared Sharpe uses sample covariance with denominator T minus one, in the earlier window and the full window. The later-window column holds the earlier tangency weights fixed but uses standard deviation with denominator T. These finite-sample conventions differ. Modern published factors, especially expected growth, are backfilled histories rather than reconstructed historical forecasts. The saved ranking is conditional evidence about this panel, not a historically blind contest.
The original search considers ten factor columns, including expected growth. Market is mandatory and a model may contain at most six factors, giving three hundred and eighty-two candidate subsets. Each dot compares earlier-window attainable squared Sharpe with later returns from the earlier fitted weights. Every candidate shares the selected modern factor histories. The scatter shows estimation and ranking uncertainty. Picking the later-window leader uses those same evaluation outcomes, so its reported performance is selected rather than a fresh validation.
The table ranks candidates by the earlier fitting window and retains their saved later-window results. The search family contains three hundred and eighty-two subsets of ten columns, with market mandatory and no more than six factors. A separate top-out list chooses on the later window itself. Its winner is selected on that window, while even the earlier-ranked list inherits backfilled published-factor construction. Neither ranking is a posterior probability that a model is true, an exact spanning test, or a cost-adjusted investment recommendation.
Fama and French used the same criterion on their own models. In 'Choosing factors' they found that adding momentum, and measuring profitability with cash flows rather than accounting earnings, raised the squared Sharpe ratio. And they warned that such gains are small and partly in sample, the same caution the near-ties above demand.
Bayesian model comparison places a prior over models and their parameters, then weights them by marginal likelihood under a specified return model. Published work explores very large model spaces and model averaging. Those probabilities are conditional on priors, likelihood, candidate set and observed selection; they are not unconditional probabilities of economic truth. Isotropic ridge is a continuous shrinkage estimate and is not automatically the same operation as averaging a discrete subset model space. No new Bayesian market comparison is fitted here.
Two conditional lessons. Compare traded-factor mean-variance opportunity sets on consistent moments and a common union, while retaining estimation, publication and selection uncertainty. Near ties can motivate prespecified shrinkage or averaging, but weights, priors and validation remain choices. Neither discrete model averaging nor ridge automatically wins out of sample, and choosing among them after the same evaluation requires fresh evidence.
Model A beats model B on the twenty-five size and value portfolios, but B's factors reach a higher squared Sharpe ratio. Which is better, and why can the test assets mislead?
11Registration and holdout accountingIndustry2 min
This review does not open or score the sealed experiment. Instead, we examine what a fresh test would require, and how little precision three years can offer.
A registration is a timestamped commitment. Freeze the code, universe, formation and holding clocks, missing-data treatment and available publication vintages. Freeze the cost and funding assumptions, and retain every variant considered. Freeze the evaluation window, benchmark, statistic and decision rule before examining outcomes. A hash documents the commitment; it cannot make a previously examined sample unseen.
Gross factor returns are research objects. A net implementation must account for trading, funding and borrow costs on a consistent capital base. This equation is a bookkeeping schematic. A constant annual cost haircut may be useful for a declared sensitivity exercise, but it does not reconstruct actual turnover, market impact, collateral or capacity. No net historical strategy series is generated here.
Three years is a short test. Under a stable independent-return approximation, the mean t-statistic is the annual Sharpe ratio times the square root of years. At three years, the rough standard error of an estimated annual Sharpe ratio is fifty-eight hundredths. Reaching a t-statistic of two would require about one point one five. These are fixed arithmetic illustrations, not results from the sealed sample. Serial dependence, tails and selection can make the approximation unreliable; failure to reject zero is not evidence that two strategies are equivalent.
A trial ledger records what a process actually tried. This review adds no market trials, registrations or scores. That does not mean the published factors arrived without selection. Here the complete-history universe uses observations through 2023. The contiguous-fold cross-validation trains on future folds, and the shrinkage choice uses the later evaluation window. Those retrospective choices do not become independent by freezing weights afterward. A fresh holdout requires genuine separation and a prespecified evaluation. Renaming familiar history cannot create one. Part twenty-six studies backtesting choices and the broader search.
The boundary is explicit. The original envelope computation is preserved and excluded from this review. No experiment payload, cache or performance row is accessed, and no substitute historical test is created. Named public data files can contain later published observations; that is a different access path, and it does not certify a blind experiment. Pause and predict. A registered strategy has an estimated Sharpe ratio of point four after three years. Under the stated approximation its t-statistic is about point six nine. What can that establish, given selection, costs and the short sample?
12Rule 25: the SDF modelIndustry2 min
The House's twenty-fifth rule, and the discount-factor model the research desk now keeps. The bars show the existing registered trials by part, using log ten of one plus the count. The total through Part twenty-five is . This review adds zero registrations or market trials. The historical ledger records its own declared configurations; it does not enumerate every unpublished search or every inherited choice in the public predictors. A local count is useful accounting, not proof that selection or information leakage has been eliminated.
The sheet separates saved diagnostics from certified discoveries. The noise maximum is simulated. Bonferroni and BH counts use approximate mean t p-values; their formal guarantees require valid null calibration and appropriate dependence conditions. The empirical-Bayes slope and observed return-retention ratio are different quantities. Five simplified double-selection loadings cross the nominal threshold, without formal inference certification. The sealed experiment remains unopened and unscored in this review.
Three excerpts. The shrinkage discount factor: the covariance plus gamma times the identity, solved against the means; one line, one parameter. Risk-premium PCA: the second moment plus gamma times the outer product of the means, before the eigenvectors. And double selection: two lassos, and the union of what they keep. Each replaces a researcher's discretion with a rule whose choices can be counted: the shrinkage by cross-validation, the components by their number, the controls by a penalty set in advance.
The desk's tools include maxima, familywise corrections, BH, conditional empirical Bayes, ridge, latent factors and simplified selection. A tool's name does not certify valid p-values, independence, identification or implementation. Rule twenty-five is to disclose the search and inherited selection, state the calibration assumptions, compare exposures conditionally, and report prior and validation choices. Distinguish gross research returns from cost scenarios and feasible net performance. A local count or a one-third retention scenario cannot replace a genuinely separated evaluation.
Apply the qualified rule. A best t of two point nine among two hundred has a selected normal-reference p-value near three tenths only under the stated independent normal search model. An insignificant simplified loading does not prove exact spanning or no incremental utility. A one-third to one-half return-retention assumption is a sensitivity scenario, not a universal forecast. Comparing equal and value weights asks about different portfolios; assess uncertainty, costs and feasibility. Counting is necessary documentation, but it does not replace these assumptions.
For the researcher: how many anomalies are real?PhD6 min
For the researcher: exact false-discovery results require explicit null and dependence assumptions. Estimating the share of nulls and local densities adds a mixture model and further uncertainty. We preserve the numerical diagnostics while distinguishing model-conditional statements from identified facts about published anomalies.
First state an exact theorem. Apply BH at level q to a fixed family. Assume independent p-values and exactly uniform true-null p-values. Write the expected false-rejection fraction as a sum over true nulls and possible rejection counts, with zero fraction when there are no rejections. Each true null then contributes q over m, giving pi zero times q exactly. Merely valid super-uniform p-values give an upper bound rather than equality. Appropriate positive regression dependence permits a bound, not arbitrary correlation or arbitrary dependence.
The key step deserves a line of its own. Let R i be the number of rejections when the i-th p-value is replaced by zero. It depends only on the other p-values, so it is independent of this one. If the i-th null is rejected with k rejections in all, then setting its p-value to zero changes nothing: the same k are rejected. So the event splits into two independent pieces. A uniform p-value falls below q k over m with probability q k over m. The k's cancel, the probabilities of R i sum to one, and each null contributes q over m. Sum over the nulls, and the rate is the null share times q. Under dependence the argument breaks at the factoring step, which is where Benjamini and Yekutieli's correction comes in.
Storey's estimator needs another careful distinction. Under uniform true-null p-values, each null exceeds a fixed lambda with probability one minus lambda. Divide the total count above lambda by m times one minus lambda. For this untruncated estimator the expectation is at least pi zero, because alternatives add nonnegative tail mass. This is an expectation bound, not a guarantee that each realised estimate exceeds truth. Capping at one can change that bound. The saved empirical calculation caps the estimator, and using q over an estimated pi zero does not automatically retain finite-sample FDR control.
The preserved simulation uses four hundred replications per row and two hundred and eight independent tests. Non-null effects are gamma distributed, with independent normal observation noise. The average realised false-rejection fraction is close to pi zero times q, with finite simulation error. The displayed untruncated Storey estimates have averages above the generating null shares; their reported spread is across replications. This checks the stated toy model, not dependence-valid error control for published return predictors.
The in-sample histogram inherits significance and publication selection. Applying a uniform-null mixture mechanically produces a very low fitted null share, which is not identified truth. The post-publication returns were not selected on this exact statistic by the original paper, but the predictors, directions, available histories and modern release remain selected. Normal tail probabilities from iid mean t values are not automatically uniform under the null. The capped estimate varies strongly with lambda; it does not prove that a majority of predictors retain real premia.
The lambda curve is a sensitivity diagnostic. With uniform true nulls and alternatives concentrated near zero, a flat region may be informative. Here the saved capped estimate falls substantially across lambda. Null misspecification, dependence, direction selection, weak effects and finite noise can affect this shape. No realised point is certified to exceed the true null share, and choosing a convenient lambda after seeing the curve introduces another choice. The figure cannot identify a guaranteed minimum fraction of real anomalies.
The two-group mixture is a conditional statistical model. Suppose the null density is standard normal and the mixture density and null share are correctly specified. Bayes's formula then gives the local null probability. The saved example instead plugs in a kernel density and a capped estimated null share, and clips local ratios at one. These plug-ins need not define a coherent identified mixture. Summing one minus the fitted ratios is a model diagnostic; without those assumptions it is not a certified expected count of real economic effects.
Read the density plot as a model-dependent diagnostic. White is the fitted mixture and grey is the estimated null share times a standard-normal density. The coloured rug uses clipped fitted local ratios. The displayed count and sum depend on kernel smoothing, the assumed normal null, the capped null share and the selected published universe. They do not establish how many anomalies are real or what a future implementation will earn.
These saved numbers answer different conditional questions. BH uses approximate normal p-values, while the adaptive row replaces q with q over a capped estimated null share. That plug-in does not inherit the same finite-sample guarantee automatically. Local-ratio counts and their summed complements additionally depend on a kernel mixture model. Report them as sensitivity diagnostics on a selected published universe. None identifies a certified majority of real factors, controls portfolio loss, or proves an implementable future premium.
Three open questions. Shared stocks create dependence. BH has a bound under valid null p-values and appropriate positive regression dependence, not arbitrary positive correlations. Adaptive null-share and local-density methods need further assumptions. A small post-publication statistic cannot by itself distinguish no original effect from economic decay, changed risk, noise or data revision. Finally, statistical nonzero means are not net economic opportunities. Costs, funding, constraints and a meaningful economic null matter.
Pause and predict. Of a thousand p-values, three hundred and eighty exceed one half. Compute the untruncated Storey plug-in estimate. If BH at ten percent rejects one hundred and twenty, multiplying point seven six times point one times one hundred and twenty gives about nine. Explain why that is only a heuristic under an assumed stable mixture, not a realised false-discovery count or a consequence of FDR alone.
Recap, desk questions, problemsAll tracks4 min
Fourteen lessons. Search changes the distribution of the best result. Error-control procedures need valid null p-values and their stated dependence conditions. Published predictors are a selected universe, and modern reconstructions are not historical vintages. Replication depends on construction. The empirical-Bayes slope and observed return-retention ratio are different diagnostics, not a causal decomposition. Published mining comparisons do not deliver a universal forecast. The saved shrinkage cross-validation uses future folds and evaluation-window information, so the split is retrospective.
The simplified double-selection t values are heuristic, and nonrejection does not prove exact spanning. Weak factor exposures undermine identification. PCA comparisons inherit complete-history and publication selection. IPCA models conditional betas rather than making characteristics literally equal to covariances. Traded-factor model comparison is conditional mean-variance geometry; choosing a later-window winner uses that window. Registration cannot make previously examined history fresh, and three years gives little precision. The sealed experiment remains unopened. Count choices, state assumptions, disclose inherited selection, and shrink conditionally.
Six desk questions. The expected maximum depends on the declared noise model, horizon and search count. The standard-normal independent maximum gives a selected p-value near three tenths for a best t of two point nine among two hundred; unknown search and dependence change calibration. FDR controls an expected false-rejection fraction under assumptions. It does not cap realised false discoveries, portfolio loss, common exposures or funding risk.
A microcap result needs uncertainty, liquidity and cost analysis before it is an implementable premium. Retaining one third to one half of a published return can be a sensitivity scenario, not a universal calibrated forecast. An insignificant simplified SDF loading does not prove exact spanning or no incremental value. Assess power, identification, estimation error and implementation. All six worked answers remain in the bilingual notes.
The first six problems: normal maxima, Bonferroni under normal null calibration, three corrections by hand, the conditional normal-normal posterior, ridge in principal components, and two numerical directions. State positive eigenvalues and the assumed units.
Problems seven through ten: the centered covariance convention in RP-PCA, classical independent errors-in-variables attenuation, conditional traded-factor mean-variance comparison, and expected noise discoveries. The attenuation formula is not a general two-pass identity; expected counts do not require independent tests when marginal probabilities are fixed.
Two qualifying problems: prove exact BH false-discovery equality for independent tests with uniform true-null p-values. Then prove the expectation bound for the untruncated Storey estimator and the conditional two-group tail-area identity. Clipping changes the first claim. All twelve worked solutions are retained in English and Chinese.
Where this comes back. Part twenty-six puts the trial counter into every backtest and turns it into a deflated Sharpe ratio. Part twenty-seven feeds the characteristics to machine-learned discount factors. Part twenty-nine's alpha miners try millions of signals and are deflated by the count. Part thirty turns the discount factor's weights into a portfolio with costs and constraints. And the finale deflates every row by the series' full count.
The textbooks this part follows, and the papers it draws on, from Holm's step-down test to the replication debate. Every number on screen was computed by the House's code from public data, with simulations labelled as such. The predictors' returns are Chen and Zimmermann's open-source release, which anyone can download and check against these numbers.
The research desk now has a factor library, a conditional discount-factor model and its local trial ledger. Search makes the best result optimistic, and published histories inherit selection. Shrinkage is a disciplined conditional estimate, not a guarantee that a portfolio is feasible or a predictor is real. Next, Part twenty-six examines backtesting choices, planted errors, costs, funding, borrow and the assumptions behind a deflated Sharpe ratio.
Where it goes next. The same arithmetic applies to your own research: Part 26 turns it on the backtest.
Key results
The part's results in one place, for revision.
Try it
Lab 25 · Three hundred factors, thirty real: four hurdles
Draw t-statistics for 300 factors of which 30 have a real premium. Apply the classical 1.96, Bonferroni, Benjamini-Hochberg and empirical-Bayes shrinkage, and count true and false discoveries under each.
python -m videos.quant.labs 25
needs numpy, scipy, matplotlib, numba · download lab25.py ·
source on GitHubt > 1.96 false discovery rate 33.5% real factors found 86.2%
Bonferroni false discovery rate 0.2% real factors found 42.8%
Benjamini-Hochberg 5% false discovery rate 4.8% real factors found 66.1%
Bonferroni hurdle for 300 tests |t| > 3.76
Best |t| among 270 pure-noise factors 3.10 on average
Empirical-Bayes shrinkage of every t x0.54
The 1.96 hurdle was built for one test. BH keeps the share of false discoveries near 5% without Bonferroni's loss of power.
The code (64 lines; it asserts its own result)
"""Lab 25: three hundred candidate factors, thirty real: who gets through each hurdle."""
import numpy as np
from scipy.stats import norm
from videos.quant import labs
from explainer.quant.house import econ, zoo
TITLE = "Three hundred factors, thirty real: four hurdles"
GOAL = ("Draw t-statistics for 300 factors of which 30 have a real premium. Apply the classical 1.96, Bonferroni, "
"Benjamini-Hochberg and empirical-Bayes shrinkage, and count true and false discoveries under each.")
TASKS = [
"Publish only t > 2 and rerun eb_shrink on the survivors. How wrong is the shrinkage factor?",
"Make the null t-statistics correlated (a common market factor). Does BH still control the FDR?",
"Lower the share of real factors to 3%. What does 1.96 deliver now?",
]
def run(seed=0):
rng = np.random.default_rng(seed)
M, real = 300, 30
truth = np.zeros(M, bool)
truth[:real] = True
lab = labs.Lab()
fdp = {"t > 1.96": [], "Bonferroni": [], "Benjamini-Hochberg 5%": []}
power = {k: [] for k in fdp}
for rep in range(400):
theta = np.where(truth, rng.normal(3.5, 1.0, M), 0.0)
t = theta + rng.standard_normal(M)
p = 2 * norm.sf(np.abs(t))
rules = {"t > 1.96": np.abs(t) > 1.96, "Bonferroni": np.abs(t) > zoo.bonferroni_t(M),
"Benjamini-Hochberg 5%": econ.benjamini_hochberg(p, 0.05)}
for k, rej in rules.items():
fdp[k].append(np.sum(rej & ~truth) / max(rej.sum(), 1))
power[k].append(np.sum(rej & truth) / real)
for k in fdp:
lab.row(k, f"false discovery rate {100 * np.mean(fdp[k]):4.1f}% real factors found {100 * np.mean(power[k]):4.1f}%")
eb = zoo.eb_shrink(t)
best = zoo.noise_max_t(M - real, sims=2000, seed=seed, absolute=True)
lab.row("Bonferroni hurdle for 300 tests", f"|t| > {zoo.bonferroni_t(M):.2f}")
lab.row("Best |t| among 270 pure-noise factors", f"{best['mean']:.2f} on average")
lab.row("Empirical-Bayes shrinkage of every t", f"x{eb['shrink']:.2f}")
lab.note = "The 1.96 hurdle was built for one test. BH keeps the share of false discoveries near 5% without Bonferroni's loss of power."
assert np.mean(fdp["t > 1.96"]) > 0.25 and np.mean(fdp["Bonferroni"]) < 0.01
assert 0.03 < np.mean(fdp["Benjamini-Hochberg 5%"]) < 0.06 and np.mean(power["Benjamini-Hochberg 5%"]) > np.mean(power["Bonferroni"])
fig, ax = labs.figure(2, size=(11, 4.2))
bins = np.linspace(-4, 8, 61)
ax[0].hist(t[~truth], bins=bins, color=labs.CASH, label="270 with no premium")
ax[0].hist(t[truth], bins=bins, color=labs.GAIN, label="30 real")
for x, c, name in ((1.96, labs.LOSS, "1.96"), (zoo.bonferroni_t(M), labs.P, "Bonferroni")):
ax[0].axvline(x, color=c, ls="--", lw=1)
ax[0].text(x + 0.05, ax[0].get_ylim()[1] * 0.92, name, color=c, fontsize=8)
ax[0].set(title="One draw of 300 t-statistics", xlabel="t")
ax[0].legend(fontsize=8)
names = list(fdp)
x = np.arange(3)
ax[1].bar(x - 0.2, [100 * np.mean(fdp[k]) for k in names], 0.4, color=labs.LOSS, label="false discovery rate")
ax[1].bar(x + 0.2, [100 * np.mean(power[k]) for k in names], 0.4, color=labs.GAIN, label="real factors found")
ax[1].set_xticks(x, ["t > 1.96", "Bonferroni", "BH 5%"])
ax[1].set(title="What each hurdle delivers (400 draws)", ylabel="%")
ax[1].legend(fontsize=8)
lab.fig = fig
return lab
Now change it
- Publish only t > 2 and rerun eb_shrink on the survivors. How wrong is the shrinkage factor?
- Make the null t-statistics correlated (a common market factor). Does BH still control the FDR?
- Lower the share of real factors to 3%. What does 1.96 deliver now?
Problems, with solutions
Try each problem before opening its solution; the last two of each set are at qualifying-exam level.
Desk questions, with solutions
- Best of 200 noise strategies. Under the saved independent Student-t illustration, the expected positive maximum is about 2.8, or about 3.0 for the absolute maximum. A normal asymptotic formula is only an approximation; dependence and the actual search family matter.
- Best t = 2.9 among 200. For independent standard normals the selected one-sided tail is 1 − Φ(2.9)^200 ≈ 0.31, versus 1 − Φ(2.9) ≈ 0.0019 for a prespecified test. This calibration is conditional on the declared search and null model.
- Ten of 100 signals. Choose and report a discovery-error objective with valid null calibration and dependence assumptions. FDR controls an expectation, not the realised dud count or loss of the selected portfolio; FWER is also meaningful for a family of claims.
- Microcap significance. Equal-weight and value-weight results estimate different portfolios. Neither a t = 4 nor a changed t = 1.2 by itself identifies a persistent premium. Assess sample uncertainty, liquidity, costs and scale.
- Published 0.8% monthly. 0.3–0.4% can be an explicitly labelled sensitivity scenario. The selected historical mean-retention ratio is not a calibrated universal forecast, and net implementation requires separate costs and uncertainty.
- Insignificant simplified DS loading. Nonrejection does not prove spanning or zero incremental utility. Check power, weak identification, covariance and selection uncertainty, factor dependence and implementation. Exact spanning is a stronger payoff statement.
Problems, with worked solutions
-
Normal maximum. Show that \(\Pr(\max_{i \le n} Z_i \le c) = \Phi(c)^n\) for independent standard normals, and that the median maximum solves \(\Phi(c) = 2^{-1/n}\). Find it for \(n = 200\).
Solution
Independence gives Pr(max Zᵢ ≤ c) = ∏Pr(Zᵢ ≤ c) = Φ(c)^n. The median solves Φ(c) = 2^(−1/n); for n = 200 it is about 2.70. This is the median of standard-normal maxima, not the Student-t simulation's mean.
-
Normal Bonferroni. Bonferroni for \(m = 212\) two-sided tests at 5%: find the \(p\) and \(|t|\) hurdles.
Solution
For 212 two-sided tests at 5%, p ≤ 0.05/212 = 0.00023585 and |z| ≥ Φ⁻¹(1 − 0.05/(2·212)) ≈ 3.68. The union bound uses valid marginal p-values and permits arbitrary dependence; exact finite-sample Student-t thresholds differ.
-
Five p-values. \(p\)-values 0.001, 0.008, 0.012, 0.03, 0.2 (\(m = 5\), 5%). How many rejections by Bonferroni, Holm, and Benjamini–Hochberg?
Solution
Bonferroni's 0.01 threshold rejects 0.001 and 0.008: two. Holm thresholds 0.01, 0.0125, 0.01667, 0.025, 0.05 yield three before the 0.03 failure. BH thresholds 0.01k have last crossing at k = 4 (0.03 ≤ 0.04), so four.
-
Conditional empirical Bayes. Empirical Bayes: the zoo's \(t\)'s have mean 4 and variance 6. Shrink \(t = 7\).
Solution
Under t = θ + ε with independent ε ~ N(0,1), θ ~ N(4,5), the observed variance is 6. Posterior mean at t = 7 is 4 + (5/6)(7 − 4) = 6.5. A fitted selected-universe model need not be calibrated for future returns.
-
Ridge in components. Show that \((\Sigma + \gamma I)^{-1}\mu = \sum_k \frac{\lambda_k}{\lambda_k + \gamma}\frac{q_k^\top\mu}{\lambda_k}q_k\).
Solution
For symmetric positive-definite Σ = Σ_k λ_k q_kq_k′ and γ ≥ 0, (Σ + γI)⁻¹μ = Σ_k (q_k′μ)/(λ_k + γ) q_k = Σ_k [λ_k/(λ_k + γ)] [(q_k′μ)/λ_k] q_k. Positive λ_k permits the unshrunk expression. The isotropic penalty is unit dependent.
-
Two directions. Two principal components with variances 0.01 and 0.0001 and projected means 0.002 each. Find the unshrunk and the \(\gamma = 0.001\) loadings. Which direction does shrinkage distrust?
Solution
Unshrunk loadings are 0.002/0.01 = 0.2 and 0.002/0.0001 = 20. At γ = 0.001 they are 0.1818 and 1.8182. The smaller-eigenvalue direction retains 1/11 of its loading, versus 10/11 for the larger. Under this prior it is shrunk more, without proving its mean is false.
-
RP-PCA at −1. Show that RP-PCA with \(\gamma = -1\) is PCA of the (biased) sample covariance.
Solution
F′F/T − μμ′ = Σ_t(F_t − μ)(F_t − μ)′/T. This ML-centered covariance equals (T − 1)/T times the usual sample covariance, so eigenvectors agree but eigenvalues are rescaled.
-
Classical attenuation. In a classical EIV illustration with independent additive beta error, true-beta variance 0.01 and error variance 0.04: find the attenuation factor. Why is this not a general two-pass identity?
Solution
If β̂ = β + u, u is independent additive error, residuals are orthogonal to β and u, and an intercept is fitted, plim λ̂ = λ Var(β)/(Var(β)+Var(u)) = 0.2λ. These assumptions are not automatic for generated factor betas or weak-factor two-pass inference.
-
Conditional model comparison. Model A's factors reach \(SR^2 = 0.5\) a year, model B's 0.8. Which is better by Barillas–Shanken, and why are no test assets needed?
Solution
B has higher attainable SR² (0.8 versus 0.5). For a common union of traded returns and matching moments, the unexplained mean-variance gap is SR²(union) − SR²(model); B leaves a gap 0.3 smaller. Factors themselves can form that common union. Raw finite GRS values have additional model-specific scaling. This does not establish a unique risk story, exact spanning, investor dominance under constraints, or a future winner.
-
Expected noise counts. A miner tries 29{,}000 hypotheses with standard-normal null statistics. Find expected counts with \(|Z|>2\) and \(|Z|>3\). Do these expectations require independent tests?
Solution
With standard-normal null marginals, 29,000·2Φ̄(2) ≈ 1,320 and 29,000·2Φ̄(3) ≈ 78.3. Linearity of expectation needs no cross-test independence. Dependence does change dispersion and the chance of any exceedance.
-
Exact BH theorem. (qual) For independent \(p\)-values with exactly uniform true-null distributions, prove that Benjamini–Hochberg at level \(q\) has \(\mathrm{FDR} = \pi_0 q\) exactly. Hint: \(V/R = \sum_{i \in H_0} 1\{p_i \le qR/m\}/R\); condition on the other \(p\)'s.
Solution
Assume independent p-values and uniform true-null marginals. Let R⁽ⁱ⁾ be BH's rejection count with p_i set to zero, a function only of p₋ᵢ. For k ≥ 1, {p_i ≤ qk/m, R = k} = {p_i ≤ qk/m, R⁽ⁱ⁾ = k}. Lowering a rejected p does not change the final count; conversely a p at most qk/m preserves the kth crossing and cannot create a later one. Independence and uniformity give probability (qk/m)Pr(R⁽ⁱ⁾ = k). Therefore E[V/max(R,1)] = Σ_i∈H₀ Σ_k (1/k)(qk/m)Pr(R⁽ⁱ⁾ = k) = m₀q/m. Valid super-uniform nulls give ≤ rather than exact equality. Independence of the family is an explicit sufficient condition here.
-
Storey and local/tail rates. (qual) Show the UNTRUNCATED Storey estimator satisfies \(\mathbb E\hat\pi_0(\lambda)\ge\pi_0\) for uniform null p-values; explain why clipping at one can change this. Then, in the two-group model, show that the tail-area rate \(\pi_0\bar\Phi(z)/\bar F(z)\) equals \(\mathbb E[\operatorname{lfdr}(Z) \mid Z \ge z]\).
Solution
For fixed λ and uniform true-null marginals, E#{p > λ} = m₀(1 − λ) + Σ_i∈H₁ Pr(p_i > λ) ≥ m₀(1 − λ). Dividing proves the untruncated expectation bound; a realised estimate need not be above π₀, and capping at one may break the expectation inequality. For m = m₀ = 1 and λ = 1/2, the capped estimator is 1{p > 1/2}, with expectation 1/2 < π₀ = 1. For a correctly specified two-group density f = π₀φ + (1 − π₀)f₁, and a positive upper-tail probability, Pr(H₀|Z ≥ z) = π₀Φ̄(z)/F̄(z) = ∫_z^∞ [π₀φ(u)/f(u)]f(u)du/F̄(z) = E[lfdr(Z)|Z ≥ z]. This uses a standard-normal null and one consistent positive tail. If lfdr decreases on that tail, the average is at most its threshold value. Arbitrary clipped fitted ratios do not inherit that posterior identity.
Reading and notes
The part's papers
from READING.md
- Connor, G., Korajczyk, R. (1986). "Performance measurement with the arbitrage pricing theory." JFE.
- Cochrane, J. (2011). "Presidential address: Discount rates." Journal of Finance.
- Harvey, C., Liu, Y., Zhu, H. (2016). "... and the cross-section of expected returns." RFS.
- McLean, R. D., Pontiff, J. (2016). "Does academic research destroy stock return predictability?" Journal of Finance.
- Harvey, C. (2017). "Presidential address: The scientific outlook in financial economics." Journal of Finance.
- Green, J., Hand, J., Zhang, X. F. (2017). "The characteristics that provide independent information about average U.S. monthly stock returns." RFS.
- Yan, X., Zheng, L. (2017). "Fundamental analysis and the cross-section of stock returns: a data-mining approach." RFS.
- Barillas, F., Shanken, J. (2018). "Comparing asset pricing models." Journal of Finance.
- Kozak, S., Nagel, S., Santosh, S. (2018). "Interpreting factor models." Journal of Finance.
- Linnainmaa, J., Roberts, M. (2018). "The history of the cross-section of stock returns." RFS.
- Kelly, B., Pruitt, S., Su, Y. (2019). "Characteristics are covariances: a unified model of risk and return." JFE.
- Kozak, S., Nagel, S., Santosh, S. (2020). "Shrinking the cross-section." JFE.
- Feng, G., Giglio, S., Xiu, D. (2020). "Taming the factor zoo: a test of new factors." Journal of Finance.
- Freyberger, J., Neuhierl, A., Weber, M. (2020). "Dissecting characteristics nonparametrically." RFS.
- Hou, K., Xue, C., Zhang, L. (2020). "Replicating anomalies." RFS.
- Lettau, M., Pelger, M. (2020). "Estimating latent asset-pricing factors." J. Econometrics; "Factors that fit the time series and cross-section of stock returns." RFS.
- Chen, A., Zimmermann, T. (2020). "Publication bias and the cross-section of stock returns." Review of Asset Pricing Studies.
- Chordia, T., Goyal, A., Saretto, A. (2020). "Anomalies and false rejections." RFS.
- Harvey, C., Liu, Y. (2020). "False (and missed) discoveries in financial economics." Journal of Finance.
- Giglio, S., Xiu, D. (2021). "Asset pricing with omitted factors." JPE.
- Chen, A., Zimmermann, T. (2022). "Open source cross-sectional asset pricing." Critical Finance Review.
- Jensen, T., Kelly, B., Pedersen, L. H. (2023). "Is there a replication crisis in finance?" Journal of Finance.
- Bryzgalova, S., Huang, J., Julliard, C. (2023). "Bayesian solutions for the factor zoo: we just ran two quadrillion models." Journal of Finance.
- Chen, A., Lopez-Lira, A., Zimmermann, T. (2024). "Does peer-reviewed research help predict stock returns?" Working paper (verify).
- Giglio, S., Xiu, D., Zhang, D. (2025). "Test assets and weak factors." Journal of Finance (verify: year).
Papers and sources
Papers, chapter by chapter
- Hook: Cochrane (2011); Chen and Zimmermann (2022).
- ch. 1: Ioannidis (2005); Harvey, Liu and Zhu (2016); Harvey (2017).
- ch. 2: Holm (1979); Benjamini and Hochberg (1995); White (2000); Romano and Wolf (2005); Harvey and Liu (2020).
- ch. 3: Fama and French (2008); Hou, Xue and Zhang (2020); Chen and Zimmermann (2022); Jensen, Kelly and Pedersen (2023).
- ch. 4: McLean and Pontiff (2016); Chen and Zimmermann (2020); Chordia, Goyal and Saretto (2020).
- ch. 5: Yan and Zheng (2017); Chen, Lopez-Lira and Zimmermann (working paper, arXiv 2212.10317).
- ch. 6: Kozak, Nagel and Santosh (2018, 2020).
- ch. 7: Tibshirani (1996); Belloni, Chernozhukov and Hansen (2014); Feng, Giglio and Xiu (2020).
- ch. 8: Kan and Zhang (1999); Kleibergen (2009); Giglio and Xiu (2021); Giglio, Xiu and Zhang (test assets and weak factors).
- ch. 9: Connor and Korajczyk (1986); Kelly, Pruitt and Su (2019); Lettau and Pelger (2020).
- ch. 10: Lewellen, Nagel and Shanken (2010); Barillas and Shanken (2017, 2018); Fama and French (2018); Bryzgalova, Huang and Julliard (2023).
- ch. 11: Novy-Marx and Velikov (2016) on costs.
Textbook audit
| Textbook | Chapters | Where |
|---|---|---|
| Kelly and Xiu, Financial Machine Learning | 3 (regularisation, the lasso), 4 (PCA, RP-PCA, IPCA), 5 (SDF estimation, KNS) | ch. 6–9 |
| Bali, Engle and Murray, Empirical Asset Pricing | 5 (the cross-section, multiple tests), 6 (factor models) | ch. 1–4, 10 |
| Efron, Large-Scale Inference | 1–4 (empirical Bayes, false discovery rates) | ch. 2, 4 |
| Cochrane, Asset Pricing | 12–13 (regression tests, the SDF with many factors) | ch. 6, 10 |
Data, scope and reproducibilityData access and reproducibility
OSAP release 2024.10 uses the original public PredictorLSretWide.parquet and SignalDoc.csv readers from Part 3. Their fully read public release includes observations through 2023. Complete-history universe selection therefore uses later missingness, even though return calculations generally end in 2020. Named French and q public archives include observations through 2025 before cuts. Public archive reads are distinct from opening or scoring the excluded sealed experiment; no claim is made that all post-2020 public bytes remain unread.
No force/refresh, new registration, market strategy trial, sealed payload access or replacement historical test is authorised or performed in this review. One initial zoo restore hit a concurrent public-cache temporary-file rename race; its exact failure is retained and one ordinary retry succeeded after the other reader finished. The ten permitted originals all restored, with 11 total invocations. No computation or registry was edited to bypass a check.
The range audit includes original histogram tails, the full −1.005 CV score, all scatter points, full weak-simulation estimates and all post-publication rug observations. The saved density curve remains on its actual computed grid [−4,7]; expanding the rug axis does not extrapolate it. The nested text table is extended additively; earlier strings remain byte-for-byte in value. Source translation, actual renders, sampled signal/timing checks and continuous listening are separate evidence categories.
Chapter notesChapters and scientific scope
- Two hundred coins. A fixed 240-month, 200-strategy independent normal-return example and a selected published-predictor census. The best observed mean t is not a prespecified single test. The normal maximum formula assumes independent standard normals; the separate saved maximum simulations draw independent Student-t variables with 239 degrees of freedom. Positive and absolute maxima differ. The square-root-log formula is asymptotic, particularly inaccurate at one try.
- Hundreds of factors. The search count raises a normal Bonferroni threshold. Valid marginal p-values give Bonferroni control under arbitrary dependence; Harvey–Liu–Zhu's t > 3 is a model-dependent research conclusion, not a universal critical value. Fixed base-rate/power arithmetic does not estimate the true share of published factors.
- Multiple testing. Bonferroni and Holm address familywise error in a fixed family. BH bounds expected false-rejection proportion under valid null calibration and independence or suitable PRDS, not arbitrary positive correlation. FDR does not bound realised errors, portfolio losses or funding risk. Saved return p-values use naive iid mean t statistics and normal tails, so formal calibration is conditional. Bootstrap/reality-check methods are conceptual references, not newly executed market inference.
- Replication. Construction, weights, breakpoints, microcaps, sample and data vintage change the estimand. OSAP's documented reconstructions are not identical historical data vintages. The original-paper mask follows SampleStart/End years without an extra 2020 cap; post-publication starts in the next calendar year, ends by December 2020 and needs 24 finite months. Publication and direction selection remain.
- Decay and empirical Bayes. The normal-normal illustration assumes independent unit-noise observations and a normal prior. The posterior-mean slope 0.831 acts on deviations from the fitted prior mean; it is not a premium-retention forecast. The observed post/original mean-return ratio 0.379 and scatter slope 0.426 are different estimands. Their difference is not a causal bias decomposition. Publication-truncation and learning interpretations require assumptions; a one-third to one-half retention scenario is not a universal forecast.
- Mined against peer-reviewed. Published studies and their construction choices are attributed. Expected noise counts use marginal normal probabilities; independence affects joint uncertainty rather than the sum's expectation. Retention in a published study does not calibrate a new strategy's costs or future return.
- Shrinking the cross-section. A centered linear kernel m = 1 − b′(F − μ) has mean one and may be negative. F b is a factor-portfolio return, not m. The House implements isotropic ridge (S + γI)⁻¹μ in the chosen factor units; rescaling changes its prior. The 154-column universe is selected for complete observations from 1973 through 2023 before returns are restricted to 1973–2020. Three contiguous CV folds fit on the other folds, including future observations; the penalty grid uses full-window covariance. The chosen κ uses all observations through 2020, including the later 2001–2020 evaluation window. The split is retrospective, with hyperparameter leakage, not independent chronological validation. Full-window portfolio scaling is also retrospective; split scaling uses the fitting window. Twenty κ settings are in the existing ledger; this review adds none.
- Taming the zoo. The simplified FGX-style code selects two lasso sets and takes their union. Its no-intercept lassos standardise columns without demeaning; the final cross-asset regression adds an intercept and reports HC0. It omits dependent portfolio errors, estimated-covariance uncertainty and the full paper's inference correction. Of 25 recent predictors against 53 older controls, nominal mean/no-control/DS crossings are 21/14/5. These are heuristic, non-nested diagnostics, not certified discoveries. SDF covariance loadings are not automatically mean premia; nonrejection does not establish exact return spanning or no investor benefit.
- Weak factors. The original fixed 400-replication illustration uses N = 50, T = 480 and monthly λ = 0.005 (6% arithmetic annual), with beta scales 1 and 0.05. Classical independent errors-in-variables attenuation is a qualified example, not a general identity for generated betas. Three-pass methods need pervasive factors, rank, normalization and identification assumptions; PCA does not recover every factor by construction.
- PCA, RP-PCA, IPCA. RP-PCA diagonalises F′F/T + γμμ′ with γ = 10 fixed in the original code. γ = −1 gives ML-centered covariance, with the same eigenvectors but rescaled eigenvalues relative to divisor T − 1. The retrospective 1973–2000/2001–2020 split inherits complete-history and publication selection; ten component counts are displayed, and selecting the best adds selection. Later-window RMS intercepts are fitted on that later window, not frozen alpha forecasts. IPCA is conceptual here; characteristic-dependent betas do not make characteristics literally equal to covariances, and alpha nonrejection is not exact pricing.
- Comparing models. On a common union with matching moments and unrestricted traded-factor weights, higher attainable SR² leaves a smaller mean-variance gap. This is not universal model truth, exact payoff spanning or constrained-investor dominance. Finite GRS has model-specific scaling; saved legacy GRS outputs remain proxies. The actual family is ten columns (including EG), market mandatory and at most six total: Σ(j=0..5) C(9,j) = 382 models. Training is 1967–1993; later fixed-weight evaluation is 1994–2020. The top-out list selects on that very window. Maximum SR² uses covariance divisor T − 1, whereas later fixed-portfolio SR uses standard-deviation divisor T. Modern expected-growth histories are not reconstructed recursive-vintage forecasts.
- Registration and holdout accounting. Freeze code, universe, information clocks, missing-data rules, costs, benchmark and decision rule before a genuinely separated test. Hashing does not make examined data unseen. Under the stable modest-Sharpe iid approximation, t ≈ SR_annual √Y and se(SR_annual) ≈ 1/√Y. At Y = 3, se ≈ 0.58 and t = 2 needs SR ≈ 1.15; SR = 0.4 gives t ≈ 0.69. These are fixed arithmetic examples, not sealed results.
- The House. Existing registered count through Part 25 is 348, globally 23,562. The count omits inherited publication searches and does not prove selection-free inference. The 98 protected files remain fixed. Research factor combinations omit realistic trading, funding, collateral, borrow and capital constraints; compounded long-short research indices are not automatically dollar wealth.
- For the researcher. Exact BH FDR = π₀q needs independent p-values with uniform true-null marginals. Storey's untruncated fixed-λ estimator has E π̂₀ ≥ π₀ under uniform nulls; this is not a realised bound, and capping at one can change it. The 400-replication toy uses independent normal nulls and gamma non-null effects; simulation averages have Monte Carlo error. Empirical p-values inherit selected predictors and approximate calibration. Capped π̂₀, adaptive q/π̂₀ BH, kernel density and clipped local ratios are sensitivity diagnostics without automatic finite-sample FDR or posterior certification. The fitted sum Σ(1 − lfdr) is not an identified count of real economic effects.
- Recap and exercises. Fourteen qualified lessons, six desk questions, and all twelve worked problems below. On-screen problems use continuously numbered 6/4/2 pages. Every observed plotted value is retained; axes include original extrema rather than clipping tails to the plotting window.
中文讲义
本讲的中文说明、交易台问题与习题解答(与英文版对应)。
导言量化金融,从零搭建 — 第25部分:因子动物园
Chapter notes章节与科学限定
- 两百枚硬币。 固定模拟展示搜索改变最大值分布。独立标准正态最大值公式与239自由度学生t最大值模拟不同,正向最大值与绝对最大值也不同;平方根对数公式是渐近近似。
- 数量与门槛。 邦费罗尼在有效边际p值下允许任意依赖;t > 3是特定模型与研究背景下的结论,不是普遍临界值。固定真实比例与功效算例没有估计发表集合中的真实比例。
- 多重检验。 邦费罗尼、霍尔姆控制固定族错误率;BH需要有效零假设标定及独立或适用的正回归依赖,任意正相关并不足够。错误发现率控制期望比例,不控制实现错误数量、组合亏损或融资风险。收益p值使用朴素独立同分布均值t与正态尾概率,其有效性有条件。
- 重现。 权重、断点、微盘股、样本和数据版本会改变估计对象。原样本掩码直接使用论文元数据年份,不另加二〇二〇年上限;发表后从下一历年开始,最迟到二〇二〇年十二月,至少二十四个月。发表与方向筛选仍存在,现代重建不是当时版本。
- 衰减与贝叶斯。 正态共轭示例假设独立单位噪声及正态先验。零点八三一是相对先验均值偏离的后验斜率,不是保留每项溢价的比例。观测均值比零点三七九与散点斜率零点四二六是不同对象,两者与贝叶斯斜率之差不是因果分解。保留三分之一至二分之一只能作为敏感性情景。
- 挖掘与同行评审。 公开研究结果均注明出处与构造。固定边际概率下的期望噪声计数不需要独立;独立影响联合不确定性。历史研究的保留率不能标定新策略未来净收益。
- 收缩横截面。 中心化线性核m = 1 − b′(F − μ)均值为一但未必为正;Fb是因子组合收益,不是m。各向同性岭依赖因子单位。154列资产集合按一九七三至二〇二三年的完整观测筛选,再使用截至二〇二〇年的收益。三折连续区块交叉验证用其他折训练,其中包括未来折;惩罚网格使用全窗口协方差,最佳卡帕也用到后段二〇〇一至二〇二〇年。因此后段评价存在超参数信息泄漏,并非独立顺序验证。全窗口规模归一化具有回顾性,分段规模则按训练段确定。
- 驯服动物园。 简化双重选择取两个套索集合并集;无截距套索缩放但不去均值,最终横截面回归含截距并报告HC0。它忽略组合误差依赖、协方差估计不确定性与完整论文推断。25个新预测变量对53个旧控制的21/14/5个名义门槛超越是启发式、非嵌套诊断。载荷不显著不能证明精确张成或没有增量价值。
- 弱因子。 固定400次模拟含50个资产、480个月,月度价格零点零零五。经典独立测量误差衰减是有条件算例,并非生成贝塔的一般恒等式。三步方法需要广泛性、秩、归一化与识别条件,主成分不会自动恢复所有因子。
- 主成分。 风险溢价主成分矩阵为F′F/T + γμμ′,原计算固定γ = 10。负一时为分母T的中心化协方差,特征向量与分母T减一相同而特征值不同。分段继承完整历史与发表筛选;显示十种K,挑选最优点再增加筛选。后段阿尔法在后段本身拟合,并非完全冻结预测。工具主成分仅概念介绍,特征不字面等于协方差。
- 模型比较。 共同可交易收益并集、相同矩约定与无约束权重下,较高可达夏普平方留下较小均值方差缺口。这不是普遍模型真理、精确张成或约束投资者支配。十列含预期增长,市场必须纳入且总数最多六个,共382个子集。训练一九六七至一九九三年,后段评价一九九四至二〇二〇年;后段最优名单直接在该段选择。最大夏普平方使用T减一协方差,后段固定组合标准差使用T,有限样本约定不同。回填预期增长不是递归历史版本。
- 登记与精度。 真正分离的检验前,冻结代码、资产集合、时钟、缺失值、成本、基准与决策规则。哈希不能让已观察样本变新。稳定低夏普独立同分布近似下,t约等于年化夏普乘年数平方根;三年标准误约零点五八,t等于二需要夏普约一点一五,夏普零点四对应t约零点六九。均为固定算术例,不是封存结果。
- House。 截至本部分既有登记348次,全局23562次;本轮新增均为零,98个受保护文件不变。局部台账不枚举继承的发表搜索,因子组合还缺乏真实交易、融资、抵押、借券与资本约束。多空研究指数不自动等于美元财富。
- 研究者专题。 BH精确等式要求独立检验和严格均匀的真零假设p值。固定兰布达、未截断斯托里估计量的期望不低于派零,但不是每次实现的上界;截于一可改变期望界。模拟有蒙特卡洛误差。实证设上限派零、自适应BH、核密度与截断局部比值都是有条件诊断,不自动获得有限样本错误率或后验认证,补数求和不是已识别的真实效应数量。
- 回顾与习题。 十四点回顾、六道研究台题、十二道完整习题。画面按6/4/2分页连续编号,保留全部观测极值,不把尾部裁到绘图区边界。
Desk questions, with solutions交易台问题与解答
- 两百个噪声策略的最佳值。 保存的独立学生t示例正向最大值均值约二点八,绝对最大值约三;正态渐近式只是近似,依赖与搜索族都重要。
- 最佳t为二点九。 独立标准正态假设下,选择后尾概率1 − Φ(2.9)^200约零点三一;事前指定单项则约零点零零一九。必须说明搜索数量与零假设模型。
- 一百个中选十个。 声明错误控制目标及有效标定、依赖假设。错误发现率控制期望,不保证已实现错误数量或组合安全;族错误率也适用于一族主张。
- 微盘股显著性。 等权与市值权估计不同组合;单个t值不能识别持续溢价。应评估不确定性、流动性、成本与规模。
- 发表月收益百分之零点八。 零点三至零点四可作为明确标注的敏感性情景,并非通用标定预测。净实施还要单独评估成本与不确定性。
- 简化载荷不显著。 不拒绝不能证明精确张成或没有增量效用;需要功效、弱识别、协方差与选择不确定性、因子依赖及实施分析。
Problems, with worked solutions习题与解答
-
正态最大值。 证明独立标准正态最大值分布\(\Pr(\max_{i\le n}Z_i\le c)=\Phi(c)^n\),以及中位数条件\(\Phi(c)=2^{-1/n}\);计算\(n=200\)的中位数
解答
独立性给出Pr(max Zᵢ ≤ c) = Φ(c)^n;中位数满足Φ(c) = 2^(−1/n),n = 200时约2.70。这是标准正态最大值中位数,不是学生t模拟均值。
-
邦费罗尼。 212项双侧5%邦费罗尼检验,在正态参考标定下,p值与绝对统计量门槛各是多少?
解答
0.05/212 = 0.00023585,双侧正态临界值Φ⁻¹(1 − 0.05/(2·212))约3.68。有效边际p值及并集界允许任意依赖;有限样本学生t临界值不同。
-
五个p值。 五个p值为0.001、0.008、0.012、0.03、0.2,水平5%。分别求邦费罗尼、霍尔姆与BH拒绝数
解答
邦费罗尼0.01拒绝0.001和0.008,共二个。霍尔姆门槛0.01、0.0125、0.01667、0.025、0.05,在0.03失败前拒绝三个。BH最后交点k = 4,0.03 ≤ 0.04,拒绝四个。
-
条件贝叶斯。 条件正态共轭模型中,观测\(t\)均值4、方差6,计算\(t=7\)的收缩后验均值
解答
t = θ + ε,独立单位正态噪声,θ ~ N(4,5),观测方差6;t = 7的后验均值4 + (5/6)(7 − 4) = 6.5。已筛选集合的拟合模型未必标定未来收益。
-
岭分解。 正定协方差的特征分解下,证明\((\Sigma+\gamma I)^{-1}\mu=\sum_k\frac{\lambda_k}{\lambda_k+\gamma}\frac{q_k^\top\mu}{\lambda_k}q_k\),并说明正特征值与单位条件
解答
正定对称Σ = Σ_k λ_k q_kq_k′,γ ≥ 0时,(Σ + γI)⁻¹μ = Σ_k(q_k′μ)/(λ_k + γ)q_k = Σ_k[λ_k/(λ_k + γ)][(q_k′μ)/λ_k]q_k。未收缩形式需要正特征值;各向同性惩罚依赖单位。
-
两个方向。 两个方向方差0.01与0.0001,投影均值均0.002。计算未收缩及\(\gamma=0.001\)载荷;哪个方向被收缩更多?
解答
原载荷0.002/0.01 = 0.2,0.002/0.0001 = 20;γ = 0.001时为0.1818和1.8182。小特征值方向保留十一分之一,大方向保留十一分之十。这是该先验的收缩结果,不证明其均值虚假。
-
负一特例。 证明风险溢价主成分在\(\gamma=-1\)时给出分母T的中心化协方差,其特征向量与常用样本主成分一致
解答
F′F/T − μμ′ = Σ_t(F_t − μ)(F_t − μ)′/T,等于常用样本协方差的(T − 1)/T倍。特征向量相同,特征值缩放。
-
经典衰减。 经典独立加性贝塔误差示例中,真贝塔方差0.01、误差方差0.04,求衰减系数;为何它不是一般两步回归恒等式?
解答
若β̂ = β + u且u独立加性,结构误差与β、u正交,回归含截距,则plim λ̂ = λ·0.01/(0.01 + 0.04) = 0.2λ。生成因子贝塔和弱因子两步推断不自动符合这些假设。
-
条件比较。 A与B可交易因子的年化夏普平方分别0.5、0.8。在共同并集、一致矩及无约束权重下如何比较?为何可用因子自身比较?
解答
B的可达夏普平方0.8高于A的0.5。在相同矩、共同可交易收益并集和无约束权重下,缺口SR²(并集) − SR²(模型)小0.3。因子自身可组成共同并集。有限GRS还有模型相关缩放;结论不证明风险解释、精确张成、约束支配或未来赢家。
-
期望噪声数量。 29000个假设的零假设统计量服从标准正态。求超过\(|Z|>2\)与\(|Z|>3\)的期望数量;这些期望是否要求检验独立?
解答
标准正态边际下,29000·2Φ̄(2)约1320,29000·2Φ̄(3)约78.3。期望线性不要求各检验独立;依赖改变离散程度和至少一次超越的概率。
-
BH精确证明。 (资格题)独立p值且真零假设严格均匀时,证明BH的\(\mathrm{FDR}=\pi_0q\)。提示按真零假设求和,并对其余p值条件化;无拒绝时比例定义为零
解答
假设p值独立且真零假设均匀。R⁽ⁱ⁾为把p_i设零后的拒绝数,仅依赖其余p值。k ≥ 1时,{p_i ≤ qk/m, R = k}等于{p_i ≤ qk/m, R⁽ⁱ⁾ = k}:降低已拒绝p值不改变最终数量;反向把p恢复到不超过第k门槛仍保留该交点且不产生更后交点。独立均匀性给出概率(qk/m)Pr(R⁽ⁱ⁾ = k)。对真零假设及k求和,E[V/max(R,1)] = Σ_i∈H₀Σ_k(1/k)(qk/m)Pr(R⁽ⁱ⁾ = k) = m₀q/m。超均匀有效零假设只给上界,不保证等式。
-
斯托里及局部尾部。 (资格题)证明固定兰布达、均匀真零假设下,未截断斯托里估计满足\(\mathbb E\hat\pi_0\ge\pi_0\),解释截于一的影响;再证明正确两组模型下尾部错误率等于该尾部局部率的条件平均
解答
固定λ与均匀真零假设下,E#{p > λ} = m₀(1 − λ) + Σ_i∈H₁Pr(p_i > λ) ≥ m₀(1 − λ),除以m(1 − λ)即得未截断期望界。实现值未必大于派零,截于一可破坏期望不等式。例如m = m₀ = 1、λ = 1/2时,截断估计为1{p > 1/2},期望1/2小于派零1。正确两组模型f = π₀φ + (1 − π₀)f₁、正尾概率下,Pr(H₀|Z ≥ z) = π₀Φ̄(z)/F̄(z) = ∫_z^∞[π₀φ(u)/f(u)]f(u)du/F̄(z) = E[lfdr(Z)|Z ≥ z]。须使用标准正态零分布与一致正尾;局部率递减时,尾部平均不大于门槛处局部率。任意截断拟合比值不自动继承后验恒等式。
Data, scope and reproducibility数据与复现边界
公开OSAP2024.10的两个原始读取器会完整读取包含截至二〇二三年观测的公开版本;完整历史资产筛选因此使用后续缺失信息。指定法国因子与q公开档案包含截至二〇二五年的数据,随后截取。读取公开档案不同于打开或评分被排除的封存实验;不声称所有二〇二〇年后的公开字节均未读取。
本轮不强制刷新、不新增登记或市场策略试验、不访问封存载荷、不创建替代历史检验。初次动物园恢复遇到并发公开缓存临时文件改名冲突,完整失败保留;另一个读取器完成后,单次正常重试成功。十项原计算共十一轮调用均恢复,算法和登记未为绕过检查而修改。
范围审查包括全部直方图尾部、最低约负一点零零五的交叉验证分数、全部散点、完整弱因子模拟和全部发表后地毯观测。密度曲线仍限于实际计算网格负四至七,不外推。字幕表仅追加;原有字符串值不变。源码翻译、实际渲染、抽样信号与对齐检查,以及完整连续听审分别记录。
Review log of the earlier QA passes on this part: docs/qa/quant/part25.md.
Build the film
python -m videos.quant.quant25.compute # the part's numbers, into .cache/quant25
python tools/make.py quant25 # the narrated film, English and Chinese
EXPLAINER_TTS=silent python tools/qa_scene.py quant25 Hook # one chapter, silent, with a contact sheet
Scenes: videos/quant/quant25. Setup: see the course page. Source of these notes: the part's README and the scenes' narration.