本书暂未推出简体中文版。现有版本:English, Français。
Interviews I: Maths, Probability and Speed · 职业发展
17Statistics
Saying how much a sample tells you: tests, intervals and power, estimators and their errors, multiple testing, the bootstrap and when it breaks, normality, and what a measured Sharpe ratio is worth. Most answers come down to one standard error, computed correctly.
Question 17.1 ★ QR, QT, DS, Analyst, Trader • any • junior
A coin gives 60 heads in 100 flips. Test whether it is fair, at the 5% level, using a normal approximation. Is the result the same with an exact binomial calculation?
Answer
Answer to Question 17.1.
The normal approximation gives , a p-value of about , and rejects fairness. The exact binomial p-value is about , and it does not reject.
Under a fair coin, heads have mean 50 and standard deviation , which gives . The gap comes from the count being a whole number: the exact tail starts at 60 and includes all of it, so the fair comparison uses , which gives and a p-value of , in line with the exact one.
Classic wrong answer. Treating as a sharp truth, and saying that the two methods disagree about the coin. The evidence is borderline in both cases, and that is the honest report.
Question 17.2 ★ QR, QT, DS, Analyst • any • junior
Over 400 days a strategy has a mean daily return of and a daily standard deviation of . Give a 95% confidence interval for the true mean. What sample size would make the interval half as wide?
Answer
Answer to Question 17.2.
The interval is , so about . Halving the width takes four times the data: 1600 days.
The standard error is , and of those is . Standard errors fall with , so half the width needs four times the sample.
Classic wrong answer. Saying that it needs twice the data. The square-root law says four times, and that is why adding precision gets expensive quickly.
Question 17.3 ★ QR, QT, DS, Analyst • any • junior
A researcher tests ideas of which 10% are truly good. The test has a 5% false positive rate and 80% power. An idea has just passed. What is the chance that it is a dud? Does a p-value of mean a 5% chance that the null hypothesis is true?
Answer
Answer to Question 17.3.
About 36% of the ideas that pass are duds. And a p-value of does not mean a 5% chance that the null is true.
Out of 1000 ideas, 900 are duds, and of them pass: 45. Of the 100 good ideas, 80 pass. So the fraction of duds among those that pass is .
A p-value is the chance of data this extreme if the null is true. The chance of the null given the data needs a prior, as this calculation shows. If all ideas were bad, every pass would be a dud, whatever the p-value.
Classic wrong answer. Saying that a pass gives a 95% chance that the idea is good. That reverses the conditional, and it ignores how rare good ideas are.
Question 17.4 ★ QR, QT, DS, Analyst • any • junior
Why does the sample variance divide by instead of ? Show that it makes the estimator unbiased. What does the plain estimator with average for samples of size 5?
Answer
Answer to Question 17.4.
Dividing by corrects for measuring deviations from the sample mean, rather than the true mean. The plain version with averages , which is for samples of size 5.
Start from
The mean of the first term is , and the mean of the second is . So the sum averages . The sample mean sits closer to the data than the true mean does, so deviations from it are too small. This does not need normality, and a simulation on exponentials confirms it.
Classic wrong answer. Saying that you lose a data point. The term “degree of freedom” is a good name, but you should be able to show the algebra.
Question 17.5 ★ QR, QT, DS, Analyst • any • junior
You test 20 independent trading signals, none of which works, each at the 5% level. How likely is it that one or more pass? What level per test would keep that chance at 5%?
Answer
Answer to Question 17.5.
At least one passes with chance . A level of about per test keeps the chance at about 5%.
Exactly, the per-test level is . Bonferroni’s simple rule, , gives a family chance of . It holds even when the tests are dependent, because it only uses the union bound.
Classic wrong answer. Thinking that 5% stays 5%, because each test has a 5% error. The chance that at least one is wrong rises quickly with the number of tests.
Question 17.6 ★ QR, QT, Analyst, Trader • hedge fund • junior
A thousand managers have no skill, and each beats the market in any one year with a 50% chance, independently. After five years, how many on average have beaten it every single year? What does an investor who screens for a clean five-year record learn?
Answer
Answer to Question 17.6.
About 31 of them, since . Screening for a clean five-year record finds those 31, and it tells you nothing about skill.
Each manager has a chance of of a clean record. So a clean record is not rare in a large group, and the investor would see a list of 31 winners without any skill existing at all. Next year, each still has a 50% chance.
If you see a clean record, the right question is how many people started. That number is usually not on the page, because the losers have closed.
Classic wrong answer. Saying that is about 3%, so the record is significant at the 5% level. That test applies to one manager chosen in advance, not to the best of a thousand.
Question 17.7 ★ QR, QT, DS, Analyst • any • junior
A strategy is up on 15 of 20 days. With no assumption about the size or the shape of returns, test whether its median daily return is zero. Give the exact two-sided p-value.
Answer
Answer to Question 17.7.
The exact two-sided p-value is , using a sign test.
If the median is zero, each day is up with a chance of , whatever the distribution. So the count of up days is binomial with and . Then
and doubling this gives the two-sided p-value. A simulation with Cauchy draws gives the same chance, as it should. The test ignores sizes, so it loses power on normal data, but it does not break on fat tails.
Classic wrong answer. Using a test on the returns. That needs the sizes, which you were not given, and it would be unreliable on 20 fat-tailed points.
Question 17.8 ★ QR, QT, DS • any • junior
Algorithm A produced the values 5, 7 and 9, and algorithm B produced 1, 2 and 3. With no assumption about distributions, test whether A gives higher values, using a permutation test. What is the exact one-sided p-value? Why can no sample of this size reach below it?
Answer
Answer to Question 17.8.
The p-value is . That is the smallest that any permutation test can give with two groups of 3.
If the labels have no effect, each choice of which 3 of the 6 values are called A is equally likely. There are choices. The observed one, , has the largest possible sum, 21, and it is the only one to reach it. So the p-value is .
This is the floor for two groups of 3, since a single assignment is the most extreme you can have. At this sample size, you can never get below 5%, whatever the actual size of the effect.
Classic wrong answer. Running a test, which gives a much smaller value. It gets that from an assumption that the values are normal, which you cannot check with 6 points.
Question 17.9 ★★ QR, QT, DS, Analyst • any • junior
A sample of 5 has mean 1 and standard deviation 1. Give 95% intervals for the true mean, one using the normal value and one using the correct value, given that the 97.5% point of a distribution with 4 degrees of freedom is . Why do they differ, and when does the difference stop mattering?
Answer
Answer to Question 17.9.
The normal interval is , and the interval is . The difference comes from the standard deviation being estimated, and it stops mattering at about 30 points, where the value is .
The standard error is . Multiplying by and by gives the two intervals. When is estimated from 5 points, a low estimate is common, which makes the ratio large more often than a normal variable would be. So tails are fatter. A simulation shows the normal interval covering only about of the time, and the interval .
Classic wrong answer. Saying that the difference is about non-normal data. Here the data are normal. The extra width comes only from not knowing .
Question 17.10 ★★ QR, QT, DS, Analyst • any • junior
Two series have a sample correlation of over 103 points. Give the rule of thumb for the standard error of a correlation near zero, then a proper 95% interval for this one using Fisher’s transformation. Why is the interval not symmetric around ?
Answer
Answer to Question 17.10.
The rule of thumb is near zero. The 95% interval for is about .
Fisher’s transformation, , makes the sampling law close to normal, with a standard error of , whatever the true correlation. So . Transforming back with gives the interval. A simulation with a true correlation of confirms a standard deviation of on the transformed scale, and 95% coverage.
The interval is not symmetric around , because correlation is bounded by 1, and the transformation stretches values near . An estimate of has more room below it than above.
Classic wrong answer. Using . Near zero it is fine, but at the true standard error is about , which is much smaller, and the interval is skewed.
Question 17.11 ★★ QR, QT, DS, Risk • any • junior
In 100 trading days a system has had no failures. What upper bound can you give, with 95% confidence, on its failure chance per day? Give the exact number and the rule of thumb. What is the naive estimate, and why is it not useful?
Answer
Answer to Question 17.11.
The exact bound is , and the rule of thumb is . The naive estimate is 0, which claims that failure is impossible.
Find the largest failure chance that is still consistent with no failures. You need . Taking logs gives . So 100 clean days say that the chance is below about 3% a day. That is a chance of a failure about every 33 days, which is hardly reassuring.
Classic wrong answer. Giving the point estimate 0, or . An interval is needed, and with no failures the upper end is what matters.
Question 17.12 ★★ QR, QT, Analyst, Trader • hedge fund • junior
A strategy has a true annual Sharpe ratio of . How many years of daily returns do you need before its measured Sharpe ratio is, on average, two standard errors above zero? What about true Sharpe ratios of 1 and 2? What does this say about the length of track records?
Answer
Answer to Question 17.12.
You need 16 years at a Sharpe ratio of , 4 years at 1 and 1 year at 2.
Measured over years, an annual Sharpe ratio has a standard error near . This is the same as the standard error of a mean in units of its own standard deviation, and it does not depend on how often you sample. So the ratio is , and it reaches 2 when . A simulation with 16 years of daily returns confirms a standard error of .
So a three-year record cannot separate a Sharpe of from zero, and no realistic record can do so for a slow strategy. Only high-frequency strategies with very high Sharpe ratios show their skill quickly.
Classic wrong answer. Thinking that daily data help, because there are so many points. A Sharpe ratio is a mean over a volatility. Only the volatility benefits from the finer sampling.
Question 17.13 ★★ QR, QT, DS, Analyst • hedge fund, market maker • junior
A signal adds a day to a return with a daily standard deviation of . For a two-sided test at the 5% level with 80% power, how many days of data do you need? Give the formula and the result in years. How does the answer change if the effect is twice as large?
Answer
Answer to Question 17.13.
You need days, about years. A doubled effect needs only a quarter: 784 days, about years.
The test rejects when the sample mean is more than standard errors from zero. To have 80% power, the true effect must be standard errors from zero, because is the 80% point of a normal. So , and squaring gives . A simulation of the test confirms 80% power.
Classic wrong answer. Using only the , which gives about 1537 days. At that size you have just a 50% chance of detecting the effect, because half of the time the estimate falls below the true value.
Why it matters. Plan your sample before you test. A daily edge of 5 basis points in 1% volatility is a Sharpe near 0.8, and it takes more than a decade to confirm by this rule.
Question 17.14 ★★ QR, QT, DS • any • junior
Ten tests produce the p-values , , , , , , , , and . How many are rejected under Bonferroni at a family level of ? How many under Benjamini–Hochberg, with a false discovery rate of ? What does each one control?
Answer
Answer to Question 17.14.
Bonferroni rejects one test, and Benjamini–Hochberg rejects three. Bonferroni controls the chance of any false rejection, and Benjamini–Hochberg controls the expected fraction of false rejections among the rejections.
Bonferroni compares each p-value with . Only passes.
Benjamini–Hochberg sorts them, and finds the largest with . Here , , , but , and no later one passes. So the first three are rejected. If you are searching for signals, and will validate them after, a false discovery rate is the natural choice. If one false result is costly, use the family-wise rule.
Classic wrong answer. Stopping at the first failure in a step-up rule without looking further. Benjamini–Hochberg takes the last that passes, even if an earlier one fails.
Question 17.15 ★★ QR, QT, DS • any • junior
Waiting times follow a Gamma distribution with shape and scale , whose mean is and variance is . A sample has mean 4 and variance 8. Give the method-of-moments estimates. Why would you still prefer the maximum-likelihood estimates, if you can compute them?
Answer
Answer to Question 17.15.
The method of moments gives and . Maximum likelihood is more efficient, especially for the shape, at the cost of a numerical solution.
Match the moments. Variance over mean gives , and then is mean over .
The method is simple, and it gives a good starting value. But it uses the sample variance, which is noisy for skewed data. A fit with 300 samples of size 50 shows a lower variance for the maximum-likelihood shape than for the moment shape. Maximum likelihood is asymptotically efficient, if the model is right. So it is common to start from the moment values and then iterate.
Classic wrong answer. Saying that the two methods are the same, since they use the same data. They use it differently, and they agree only for special families such as the Poisson or the normal.
Question 17.16 ★★ QR, QT, DS • any • junior
You have independent exponential waiting times with rate . Derive the maximum-likelihood estimate of the rate. Is it unbiased? Give the unbiased version, and its value when and the sample mean is 2.
Answer
Answer to Question 17.16.
The maximum-likelihood estimate is . It is biased high: . The unbiased version is , which is against for and .
The log-likelihood is . Setting its derivative to zero gives .
The sum is Gamma with shape , so , which gives the bias. In words: is convex, so by Jensen’s inequality the average of is above . A simulation with rate 3 and gives for the first and 3 for the second.
Classic wrong answer. Thinking that an unbiased mean gives an unbiased rate. A nonlinear function of an unbiased estimator is biased.
Question 17.17 ★★ QR, QT, DS • any • junior
Daily counts are Poisson with mean , and you have days. Show that the sample mean reaches the lower bound on the variance of an unbiased estimator. To estimate the chance of a day with no events, compare the fraction of zero days with , at , in asymptotic variance. Which is better, and what does the better one assume?
Answer
Answer to Question 17.17.
The Cramér–Rao bound is , and , so the bound is reached. At , the asymptotic variances for the chance of zero are for and for the fraction of zero days. So is about times better, if the data really are Poisson.
The Fisher information per day is , since the score is and its variance is . So the bound is .
For , use the delta method: the slope is , which gives . The fraction of zeros is a binomial proportion, with variance . Simulations with 200 days confirm both.
The first needs the model. With overdispersed counts of mean 2, and a true chance of a zero of , it would report , far off, while the fraction stays correct. Efficiency has a price, which is the model assumption.
Classic wrong answer. Preferring the fraction because it is “non-parametric”, and calling that better without qualification, or the reverse. Each one is the right choice under a different view of how much you trust the model.
Question 17.18 ★★ QR, QT, DS, QD • any • junior
You draw a bootstrap sample of size with replacement from data points. What fraction of the original points does it contain on average, for large ? What does the bootstrap estimate, and in plain words why does it work?
Answer
Answer to Question 17.18.
About . The bootstrap estimates the sampling variability of a statistic, by treating the sample as if it were the population.
A given point is missed by one draw with chance , and by all with chance . So of the points appear, some of them repeatedly.
The idea: you would like to draw many samples from the true distribution, and see how the statistic varies. You cannot do that, so you draw from the sample itself, which is the best estimate you have of that distribution. For a mean, the bootstrap standard error matches the formula , as a simulation confirms. For a median or a Sharpe ratio, where there may be no simple formula, it gives you one with no algebra.
Classic wrong answer. Saying that the bootstrap creates more data. It creates no information about the population. It only shows how much the statistic moves under resampling.
Question 17.19 ★★ QR, QT, DS, Risk • any • junior
Daily returns follow an AR(1) with coefficient . By what factor does the variance of the sample mean exceed the value computed by assuming independence? What does a plain bootstrap report, and what should you do instead?
Answer
Answer to Question 17.19.
The variance is 3 times larger: , so the standard error is times larger. A plain bootstrap reports the naive figure. Use a block bootstrap.
The variance of a mean is
With , the sum is . Paths of length 2000, simulated, show this factor.
A plain bootstrap draws points independently, so it destroys the autocorrelation and reports , as a simulation on one path confirms. A block bootstrap draws runs of neighbouring points, longer than the memory of the series, here blocks of 50, and that recovers most of the factor.
Classic wrong answer. Using the plain bootstrap as an all-purpose fix. It assumes independent draws, and the result is too narrow on any autocorrelated data.
Follow-up. And for negative autocorrelation? The factor is below 1. At , it is , so the mean is known better than the naive formula says.
Question 17.20 ★★ QR, QT, DS, Risk • any • junior
A thousand daily returns have a skewness of and an excess kurtosis of 3. Give the standard errors of those two numbers under normality. Compute the Jarque–Bera statistic, and say what it is compared with. What is the weakness of this test for financial data?
Answer
Answer to Question 17.20.
Under normality, the standard errors are for skewness and for excess kurtosis. Jarque–Bera is , compared with a chi-square with 2 degrees of freedom, whose 95% point is .
The statistic is the sum of the two squared -scores, . Simulations of normal samples of 1000 confirm both standard errors.
The test rejects easily with financial data, and that is its weakness. With many points it finds any departure, however small. And it says only that the data are not normal, not why. Stochastic volatility with normal shocks fails it too, in the simulation more than 99% of the time, so a rejection does not imply fat-tailed shocks. Skewness and kurtosis estimates are also very sensitive to a few extreme days, so you should look at those before you trust them.
Classic wrong answer. Treating rejection as a useful finding. For daily returns the test almost always rejects, so a chart of the tails tells you more.
Question 17.21 ★★ QR, QT, Risk, Trader, Analyst • any • junior
A daily return has a standard deviation of , and today it is . If returns are normal, how often should you see such a day, in years? How often if returns follow a Student with 3 degrees of freedom, rescaled to the same standard deviation? What do you conclude?
Answer
Answer to Question 17.21.
If normal, the chance is about a day, about once in years. If Student with 3 degrees of freedom, the chance is about a day, about once in years. Such a day is not a miracle. It tells you that the model is wrong.
For the normal, , and with 252 trading days per year you get the first number.
For the , the variance is , so a rescaled move of is a raw value of . Its tail is about . A simulation confirms that tail.
You should not conclude that a very rare thing has happened. Compare the likelihood under each model. If 5-sigma days occur every few years, then the normal is the model to drop, and a stress limit built on it has to be redone.
Classic wrong answer. Saying that the event is impossible, or that it is simply bad luck. A probability as low as that is a statement about a model, and evidence that it is wrong is much more likely than the event itself.
Question 17.22 ★★ QR, QT, DS • any • junior
A die is rolled 120 times, and the faces 1 to 6 come up 30, 18, 20, 22, 16 and 14 times. Run a chi-square test of fairness, given that the 95% point with 5 degrees of freedom is . A casual look suggests that the face 1 is favoured. Would you test that one face alone, and how?
Answer
Answer to Question 17.22.
The chi-square statistic is 8, below , so fairness is not rejected (p about ). You could test face 1 alone, with (p about ), but you chose it after looking. So you must correct for the 6 faces, which gives about .
Each expected count is 20. The statistic is
For one face, the count is binomial, with standard deviation , so .
Classic wrong answer. Testing the largest face and reporting . It is the largest of six by construction, so that p-value is six times too good.
Question 17.23 ★★ QR, QT, DS, Trader • any • junior
A string of 100 up and down days contains 30 runs, where a run is a maximal block of the same sign. If the days are independent and fair, what mean and standard deviation does the number of runs have? What does 30 suggest? What would 65 suggest?
Answer
Answer to Question 17.23.
The mean is and the standard deviation is about . Thirty runs is standard deviations low, which suggests momentum or clustering. Sixty-five is high, which suggests reversal.
The number of runs is 1 plus the number of changes. Each of the 99 neighbouring pairs is a change with a chance of , and these are independent for a fair sequence. So the count of changes is binomial with , with mean and variance . A simulation confirms both.
Note that the test looks at order, not at the proportion of up days. A market can have a positive average return and still look perfectly random on this test.
Classic wrong answer. Thinking that a long run is suspicious by itself. Long runs are common in fair data, and people tend to underestimate them. What counts is the number of runs overall, against this mean and standard deviation.
Question 17.24 ★★ QR, QT, DS, LLE • market maker, hedge fund • junior
Two execution algorithms each trade the same 100 orders. Their slippages have a standard deviation of 10 basis points each, a correlation of across orders, and a mean difference of 1 basis point. What is the -score if you compare them as two independent samples? If you compare them as pairs? Which one is right, and what does this suggest for designing a test?
Answer
Answer to Question 17.24.
As independent samples , and as pairs . Pairing is right, because both algorithms traded the same orders.
As independent samples, the standard error of the difference is . As pairs, the difference on each order has variance , so the standard error is . That is times smaller. A simulation of correlated pairs gives the same figure.
The orders’ difficulty is shared, so it cancels in the difference. To compare methods, design the test so that shared noise can cancel: run both on the same orders, or on randomly assigned neighbouring orders. Here the same data move from “no evidence” to “significant” purely by using the right design.
Classic wrong answer. Using the independent test because that is the default, and concluding that the two algorithms cannot be told apart. The formula has to reflect how the data were made.
Question 17.25 ★★ QR, QT, DS, Analyst • any • junior
Two independent estimates are 0 and 3, each with a standard error of 1. Their 95% intervals overlap. Is the difference significant at the 5% level? Find the general rule relating overlap to significance.
Answer
Answer to Question 17.25.
Yes, it is significant. The difference is 3 with a standard error of , so and p is about . With equal errors, intervals overlap until the gap reaches standard errors, but significance needs only .
The two intervals are and , which overlap between and . But the standard error of a difference is not the sum of the two standard errors. It is . So non-overlap is a very strict test, with a real level of about . Overlap does not mean “no difference”.
In general, with standard errors and , the intervals overlap while the gap is below , and the difference is significant once the gap exceeds . So a significant difference with overlapping intervals is always possible, and the two thresholds differ by a factor of up to , reached when .
Classic wrong answer. Saying that overlapping intervals mean no significant difference. Non-overlap is the stricter rule, by a factor of up to in the gap.
Question 17.26 ★★ QR, QT, DS, Risk • any • junior
For ten points, runs from 1 to 10, and , except that the last is 100. Compute the Pearson and the Spearman correlations. Which gives the fairer summary, and when would you worry about using each of them?
Answer
Answer to Question 17.26.
Pearson is about and Spearman is 1. Spearman gives the fairer summary of this relation, which is perfectly increasing.
Spearman is the correlation of the ranks. The ranks of are those of , so it is exactly 1. Pearson measures a linear relation, so one point far off the line pulls it down. Without that point it is 1 as well.
Use Spearman when you care about ordering, or when you have outliers or fat tails. It ignores sizes, so it may miss the fact that the top point really matters. If you size a position by a signal, the actual linear relation matters, and Pearson on winsorised data may be more relevant. Show both, and if they differ look for the reason.
Classic wrong answer. Saying that is the true strength of the relation, or dropping the point because it looks odd. Look at why it is there first.
Question 17.27 ★★★ QR, QT, DS • hedge fund • junior, experienced
You estimate the variance of a normal distribution from independent draws, using . Find the divisor with the smallest mean squared error. For , give the mean squared error, in units of , for , and the best . How does that square with unbiasedness being a virtue?
Answer
Answer to Question 17.27.
The best divisor is . For , the mean squared errors are for , for and for .
Let , so is chi-square with degrees of freedom. So and . Then, in units of ,
Minimising over gives . The minimum value is .
The best divisor gives a biased estimate: it averages here. That is a good trade, since variance estimates have high variance, and shrinking them reduces that. Unbiasedness is one property, and it is not the same as accuracy. The result depends on the normal kurtosis. With a Laplace, a simulation shows a best divisor above 12, so shrink even more on fat tails.
Classic wrong answer. Saying that must be best, as it is unbiased. Unbiased means right on average. You can have a smaller mean squared error by accepting a small bias, even though the unbiased estimate is the closer one on most samples: here beats on only about 36% of them.
Question 17.28 ★★★ QR, QT, DS • hedge fund • junior, experienced
You must choose between two exact hypotheses from independent draws: the distribution is , or it is . What is the best test, and why? How large must be for both error rates to be at most 5%, if they are set equal?
Answer
Answer to Question 17.28.
Reject when , which is the likelihood-ratio test. You need , as .
By the Neyman–Pearson lemma, the most powerful test at any level uses the likelihood ratio. For two normals with the same variance,
so the test depends only on the sample mean. Setting the cut-off at gives equal error rates, by symmetry.
Each error is , because the cut-off is half a mean-gap away, in units of . For this to be at most 5%, you need . At the error is , and at it is above 5%. A simulation at confirms this for both.
For a gap of standard deviations, . Halving the gap takes four times the data.
Classic wrong answer. Using a one-sided test against the first hypothesis at 5%, with a cut-off of . That fixes only one error rate, and it says nothing about the other. A fair decision between two exact hypotheses controls both.
Question 17.29 ★★★ QR, QT, DS, Analyst • hedge fund, market maker • junior, experienced
You run an experiment on a null effect. After each of 10 equally spaced batches, you compute a -score on all data so far, and stop as soon as . About what is your real false positive rate? What happens with no limit on looks? What cut-off per look would restore 5%, and what is the method called?
Answer
Answer to Question 17.29.
The real false positive rate is about 19%. With no limit on looks, it creeps up towards 100%. A cut-off of about per look restores 5%, and this is the idea behind group sequential testing, with Pocock boundaries.
Each look is correlated with the previous ones, so the risk does not add up fully, but it does accumulate. Simulating the -scores of a cumulative sum over 10 looks gives . With 5 looks it is .
With no limit, the law of the iterated logarithm says that a random walk’s -score eventually exceeds any fixed level. So you are certain to “find” an effect if you are willing to wait long enough. A simulation with 2000 looks is already above 40%.
A cut-off of per look, which is a nominal p-value of about , keeps the total at 5% for 10 looks. Other schemes spend the error unevenly, so that early looks need very strong evidence.
Classic wrong answer. Thinking that peeking is harmless if you do not change the procedure. The stopping decision is part of the procedure, and a p-value computed as though the sample size were fixed is wrong.
Why it matters. In research and in backtesting alike, stopping when results look good is the same trap as trying many signals. Decide the sample before you start, or use a boundary designed for stopping.
Question 17.30 ★★★ QR, QT, DS • any • junior, experienced
You draw independent values from a uniform on , and you want a confidence interval for from the sample maximum. Show that a plain bootstrap of the maximum fails, by finding the probability that the bootstrap maximum equals the sample maximum, for large . What does the true sampling distribution look like, and what would you use?
Answer
Answer to Question 17.30.
The bootstrap maximum equals the sample maximum with probability . The true sampling law has no such lump. Use the exact law: .
A bootstrap sample contains the sample’s largest point unless all draws miss it, so the bootstrap distribution has an atom of at the sample maximum. Any bootstrap interval is therefore degenerate on one side. It cannot reflect that the true lies above every observed point.
The true law is continuous. tends to an exponential with mean 1, and simulations confirm its mean and a tail value. Since has the exact law above, a 95% one-sided interval is , and for the factor is .
Why it fails: the bootstrap works when the statistic is a smooth function of the empirical distribution. An extreme value depends on what happens at the edge, and the sample holds no information from beyond the edge. A subsample of size works better, as does a parametric bootstrap.
Classic wrong answer. Saying that the bootstrap always works if you take enough resamples. More resamples only reduce the Monte Carlo error. They do not repair a method that is wrong for this statistic.
Why it matters. Tail risk measures are close to this case. Bootstrapping the worst day or the extreme quantile of a return series understates how bad things can be, for the same reason.
Question 17.31 ★★★ QR, QT, Analyst, Risk • hedge fund • junior, experienced
A strategy has a monthly Sharpe ratio of measured over months. Derive the standard error of the estimate under normality. How much wider does the interval get if monthly returns have a skewness of and a kurtosis of 6, given that the variance becomes ? Why does it get wider?
Answer
Answer to Question 17.31.
Under normality the standard error is about . With a skewness of and a kurtosis of 6, it is about , so 16% wider.
Write . Under normality, and are independent, with variances and about . The delta method gives
With and , that gives .
With the given formula, the numerator is , so the result is . The formula is also tested by a simulation with a mixture of skewed, fat-tailed returns, where it is within 5%.
Negative skew makes it wider, because it couples the mean to the volatility: a large loss both lowers the mean and raises the volatility, so errors in the two move the ratio in the same direction. Fat tails make the volatility estimate noisier, so the second term is larger.
Classic wrong answer. Applying with no correction. For a low Sharpe and thin tails this is fine. On a strategy that sells options, with heavy negative skew, the interval is much too narrow.
Follow-up. What about annual units? Multiply by : an annual Sharpe of has a standard error of about for normal returns and about in the fat-tailed case. The record is then about 3 standard errors from zero.
Question 17.32 ★★★ QR, QT, Analyst, Risk • hedge fund • junior, experienced
Monthly returns have a Sharpe ratio of and first-order autocorrelation of , following an AR(1). The usual rule multiplies by . What is the correct annual Sharpe ratio? What happens with negative autocorrelation? What kinds of strategies display positive autocorrelation in their reported returns, and why?
Answer
Answer to Question 17.32.
The correct annual Sharpe ratio is about , not . With autocorrelation of , it is about . Illiquid or marked-to-model strategies often show positive autocorrelation, because their reported prices move slowly.
The annual return is the sum of 12 monthly returns, so its mean is , and its variance is
The usual rule keeps only the first term. With the bracket is about , and so the annual Sharpe ratio is . A simulation of 100 000 years of this process gives the same.
Positive autocorrelation makes a strategy’s monthly volatility look lower than its risk over a long horizon, and therefore a Sharpe ratio that is too high. Stale prices cause this: a private asset valued by appraisal, or an illiquid book marked to a model, moves slowly, which smooths returns month to month. Real momentum can also contribute.
Classic wrong answer. Applying in all cases. It assumes independent returns. If you see smooth returns from an illiquid book, you should treat the autocorrelation as a warning and unsmooth the series before computing risk.
Question 17.33 ★★★ QR, QT, DS • hedge fund • junior, experienced
Two strategies have the same true annual Sharpe ratio and a correlation of , and you have 5 years of daily returns on each. What is the standard error of the difference of the two measured Sharpe ratios? How does that compare with treating them as independent? What does this imply about choosing between similar strategies?
Answer
Answer to Question 17.33.
The standard error of the difference is about , against about if independent. So the correlation makes the comparison times sharper, but a gap of is still only one standard error.
Each measured Sharpe ratio has a variance of about . The covariance of two of them is about , since it comes mainly from the correlation between the two means. So the difference has a variance of . With daily data, the volatility term is negligible, because each day’s Sharpe ratio is small, and a simulation with 5 years of daily data gives .
So over 5 years, two equally good strategies with this correlation will often appear different: a gap above in favour of one of them occurs more than 10% of the time, in the simulation. If you have just picked the better of two similar strategies on the basis of a backtest, you probably picked noise. The choice may still be harmless, as they are correlated, but you should not expect the gap to persist.
Classic wrong answer. Using the two separate standard errors, or the one-sample formula for the gap. Both overstate the error of the difference, and they suggest that the strategies cannot be told apart even when they can.
Why it matters. An uplift in a backtest from changing a parameter is a difference between two highly correlated strategies. It often has more precision than you might think, but not enough to justify most small improvements.
Question 17.34 ★★★ QR, QT, Risk, DS • bank, hedge fund • junior, experienced
You estimate the 1% quantile of a daily return, value at risk, from 1000 days of normal returns. Derive the standard error of the sample quantile, and compare it with the error of , in units of . Why is the first larger? When should you still choose the first?
Answer
Answer to Question 17.34.
The sample quantile has a standard error of about , and has one of about . The first is about times larger.
Take the count of points below the level : it is binomial, with a standard deviation of . The local slope of its expected value is , so converting from count to position gives
For the other: , multiplied by . Simulations confirm both.
The first is larger because it uses only points near the 1% tail. Only about 10 points fall there, whereas uses all of them. In a density-poor tail, each point moves the quantile a lot.
But the second is right only if the normal is. On returns with 3 degrees of freedom, also tested, the normal rule is biased by more than , whereas the sample quantile is close to unbiased. So choose the sample quantile when you distrust the shape, and report its wide interval. A precise answer to the wrong question is worse.
Classic wrong answer. Choosing a rule by its standard error alone. The total error includes bias, and at the tail, model error usually dominates sampling error.
Question 17.35 ★★★ QR, QT, Risk, DS • any • junior, experienced
A sample of 101 returns has a standard deviation of . What is the standard error of that estimate if returns are normal? If they have a kurtosis of 6? Derive the rule. What does this do to the usual chi-square interval?
Answer
Answer to Question 17.35.
For normal returns, the standard error is about . With a kurtosis of 6, it is about , which is times larger. A chi-square interval has the wrong width, and it undercovers.
The variance of the sample variance is about , with the kurtosis. A normal has , so this is . For the standard deviation, the delta method divides by :
For , this is . For , it is . Simulations with normal and Laplace draws, which have a kurtosis of 6, agree.
The chi-square interval is built on . With fat tails, the actual coverage of a nominal 95% interval is below 85% in the simulation. It needs correcting, with a bootstrap or a formula based on the sample kurtosis, and with the caution that the kurtosis estimate is itself very noisy.
Classic wrong answer. Using regardless. The formula looks universal, because it does not contain any shape parameter, but that is because it has assumed one.
Question 17.36 ★★★ QR, QT, DS • hedge fund • junior, experienced
You measure a correlation of between a signal and next-day returns. Half of the signal’s variance is measurement noise, and three-quarters of the variance of the day’s return is noise unrelated to anything you could forecast. What is the correlation between the true signal and the forecastable part of returns? Derive the formula. What does this say about raw correlations in finance?
Answer
Answer to Question 17.36.
The true correlation is about , nearly three times the measured .
Suppose that and , with independent noise. The noise does not change the covariance, but it does raise the variances. So
with . Here and , so . A simulation with 40 million points recovers from the true . With no noise, the two are the same, which is a check.
In finance, returns are mostly noise, so a raw correlation of to may reflect a strong relation with the small forecastable part. This also tells you that cleaning the signal is valuable: if you halved its noise, the measured correlation would increase. It does not tell you that you can trade better than , as you can only trade the noisy signal against the noisy return.
Classic wrong answer. Treating this correction as a way to boost your measured performance. You can only trade what you measure. The corrected number tells you about the limit, and about what cleaner data could give.
Question 17.37 ★★★ QR, QT, DS, Risk • hedge fund, market maker • junior, experienced
An asset’s return has an annual volatility of 20%, and you have 10 years of daily data. Find the standard errors of the annual mean and of the annual volatility, in percentage points. How does each change if you sample monthly, or by the minute? What practical conclusion follows, and what prevents you from pushing the volatility result without limit?
Answer
Answer to Question 17.37.
The annual mean has a standard error of about points, at any sampling frequency. The annual volatility has one of about points with daily data, with monthly data, and it would keep falling with finer sampling. So you can estimate volatility far better than the mean, roughly 22 times better here. In practice, microstructure noise limits how fine you can go.
For the mean: the sum of returns over years depends only on the start and end prices, so sampling more often adds no information. Its standard error is .
For the volatility: with returns, the standard error is . For , that is . Simulations with 120 and 2520 steps confirm both.
So estimating means needs long histories. Estimating volatility needs fine sampling.
At very fine scales, the price is not a pure diffusion. Bid-ask bounce and discrete ticks add noise, which grows relative to the variance, and returns have jumps and intraday patterns too. So there is a sampling interval below which the estimate gets worse. Also, volatility itself changes, so a long sample does not answer the question of what it is today.
Classic wrong answer. Saying that more data gives a better estimate of everything. Time span and sampling frequency are different kinds of “more”, and they help different quantities.
Question 17.38 ★★★★ QR, QT, DS • hedge fund • experienced
You observe in dimensions and estimate the mean with total squared error as the loss. Show that the James–Stein estimator beats itself for every when . Give its risk at for . Why is it strange, and how would you use it on a set of asset mean returns?
Answer
Answer to Question 17.38.
The risk is , which is below for every . At and the risk is 2, against 10 for .
Stein’s lemma says . Write the estimator as , with . Then
A direct calculation gives and . So the risk is , which is the formula above. Since , the risk is below whatever is, for . For , the factor vanishes.
At , is chi-square, with , so the risk is . Simulations at various confirm the formula and the gain.
It is strange, because the components can be anything, unrelated to one another. Yet the total error falls if you shrink them all towards a common point, even if the estimate for each single one is not better. Mean returns on many assets are a good case, because they are noisy and close together. Shrink towards their grand mean instead of towards 0, which leaves a factor with . Portfolio optimisers do better on such estimates.
Classic wrong answer. Saying this contradicts the sample mean being admissible in one dimension. It holds for . The result is about the total loss, not any single component.
Question 17.39 ★★★★ QR, QT, DS • hedge fund • experienced
A sample of comes from a Cauchy distribution with centre , with density . Compute the Fisher information per observation. Compare the asymptotic variances of the maximum-likelihood estimate, the sample median and the sample mean. How would you compute the first in practice, given that its likelihood can have several local peaks?
Answer
Answer to Question 17.39.
The Fisher information per observation is . So the maximum-likelihood estimate has asymptotic variance , the median has , and the sample mean has no finite variance and is no better than one draw, whatever the value of .
The score is with . So
Using , this becomes .
The median’s variance is , with . So the median has an efficiency of compared with the maximum-likelihood estimate.
The mean of Cauchy draws has the same Cauchy law as one draw, so averaging gains nothing. A simulation shows that the median of stays at 1.
To compute the estimate: the likelihood can have several local peaks, so do not start at random. Start at the median, which is already consistent, and take a few steps of Fisher scoring, adding at each step. That converges to the right peak for large . In a simulation with , the result has a variance close to , and below that of the median.
Classic wrong answer. Using the mean or a variance-based interval. Neither exists in the usual sense for this distribution. Even one big outlier can pull a mean anywhere, which is why a robust estimate or the likelihood itself is needed.
Question 17.40 ★★★★ QR, QT, DS • hedge fund • experienced
Prove that the Benjamini–Hochberg procedure at level controls the false discovery rate at when the p-values are independent, with true nulls, whose p-values are uniform. Hint: for one true null, ask what the number of rejections would be if its p-value were set to 0.
Answer
Answer to Question 17.40.
Let be the number of false rejections and the total. For one true null with p-value , condition on all the other p-values. Let be the number of rejections if were set to 0. Then null is rejected exactly when , and in that case the total number of rejections is exactly .
The proof has two steps.
Step one: if , then moving from 0 up to its true value leaves the sorted list passing at , because is still below the threshold at that rank, and no larger can pass, since it would also have passed with . So there are rejections, including null . If , then null is not rejected: rejecting it would need a passing with , so , and that is again impossible.
Step two: depends only on the other p-values, which are independent of , and is uniform. So
The cancels, and that is why the result is so clean. Sum over the true nulls:
It is exactly this, not merely at most, under independence. A simulation with , and gives , as stated. A direct test of the first step, setting one p-value over a grid while the others stay fixed, gives a rejection chance of .
Classic wrong answer. Trying to condition on the number of rejections . It depends on , so the condition is tangled. The trick is to use , which does not depend on .