Objective
Most machine-learning intuition comes from problems where a good model explains most of the variance. Return prediction is a different regime: a great model explains a few percent. You should be able to translate an into a correlation, a hit rate and a Sharpe ratio; predict how much in-sample noise features will produce; choose a target and a regularisation strength suited to the noise; and explain why a model with negative can still make money.
How small is small
Write the forecast-return correlation (the information coefficient, IC) as . For a linear forecast the out-of-sample is at best , so:
| IC | Hit rate | Sharpe per period | |
|---|---|---|---|
| 0.02 | 0.04% | 50.6% | 0.020 |
| 0.05 | 0.25% | 51.6% | 0.050 |
| 0.10 | 1.0% | 53.2% | 0.099 |
The hit rate is the probability that forecast and return have the same sign when both are jointly normal. The Sharpe column is for a position proportional to the forecast. With standardised forecast and return , the per-period P&L is , with and, for jointly normal variables, , so and the Sharpe is .
Two consequences. A daily IC of , which is a good signal, gives an annualised Sharpe of about on a single asset. And by the fundamental law of active management, the information ratio scales like for independent bets, which is why quant equity strategies spread a tiny IC across thousands of stocks.
Label noise sets the ceiling
Write the target as . The best possible is , whatever the model. Noise in the target does not bias a regression, but it inflates the variance of every estimate and, through the gradient, of every network weight. Noise in the features is worse: it biases linear coefficients towards zero (attenuation). Financial targets carry extra noise from bid-ask bounce, stale prices and a few extreme days, and overlapping multi-day labels reuse the same noise in many rows, so the effective sample is smaller than the row count.
How much in-sample fit is noise
For OLS with pure-noise standardised features and rows, the expected in-sample is about even though the true is zero. With a true of , roughly
The second formula comes from the out-of-sample prediction error of OLS with Gaussian features, : each estimated coefficient adds its own estimation noise to every forecast. When is a few percent and is comparable, the in-sample number is mostly noise and the out-of-sample number is negative.
Worked example
translating an IC of 0.05
A daily forecast for one asset has a true IC of . Translate it into , hit rate and annualised Sharpe. Roughly how many days of out-of-sample data do you need before its IC is two standard errors from zero?
Show solutionHide solution
, i.e. 0.25% of the variance.
Hit rate: .
Sharpe per day: ; annualised, .
Detection: a sample correlation from independent points has standard error about , so its -statistic is about . Setting gives days, about 6.3 years. A signal worth trading can take years of live data to confirm, which is why research leans on cross-sectional breadth and on priors about why a signal should work.
Worked example
what 50 features and 1,000 days buy you
You regress daily returns on 50 standardised features using 1,000 days. One feature carries a real signal with population ; the other 49 are noise. What in-sample and out-of-sample should you expect from OLS? What is the IC of the true model, and its annualised Sharpe?
Show solutionHide solution
In sample: . About 5 of the 6 percentage points are fitted noise.
Out of sample: . The model is worse than predicting zero, despite containing the real feature.
True model: the IC is , so the per-period Sharpe is , or annualised. A genuinely valuable signal, invisible behind an in-sample of 6% that promises much more and an OLS out-of-sample that promises nothing. The simulation below confirms all three numbers.
A simulation of how in-sample fit misleads
Two hundred repetitions of the worked example: OLS on all 50 features, ridge with the penalty chosen by cross-validation inside the training data, OLS on the 5 features with the largest in-sample correlation, and the true model. Each is scored on 5,000 fresh rows by and by the Sharpe of a position proportional to the forecast. Returns have zero mean by construction, so no model has an intercept (we do not want the forecast to bet on drift).
import numpy as np
from sklearn.linear_model import LinearRegression, RidgeCV
rng = np.random.default_rng(0)
n_tr, n_te, p, trials = 1000, 5000, 50, 200
beta = np.zeros(p)
beta[0] = 0.1 # one real feature; true R^2 = 0.01 / 1.01, about 1%
def r2(y, q):
return 1 - np.mean((y - q) ** 2) / np.var(y)
def sharpe(y, q): # position proportional to the forecast, per period
pnl = q * y
return pnl.mean() / pnl.std()
res = {k: [] for k in ["OLS, 50 feats", "ridge (CV)", "top-5 by corr", "true model"]}
for _ in range(trials):
X = rng.normal(size=(n_tr + n_te, p))
y = X @ beta + rng.normal(size=n_tr + n_te)
Xtr, ytr, Xte, yte = X[:n_tr], y[:n_tr], X[n_tr:], y[n_tr:]
top = np.argsort([abs(np.corrcoef(Xtr[:, j], ytr)[0, 1]) for j in range(p)])[-5:]
fits = {
"OLS, 50 feats": (LinearRegression(fit_intercept=False).fit(Xtr, ytr), slice(None)),
"ridge (CV)": (RidgeCV(alphas=np.logspace(-1, 5, 25), fit_intercept=False)
.fit(Xtr, ytr), slice(None)),
"top-5 by corr": (LinearRegression(fit_intercept=False).fit(Xtr[:, top], ytr), top),
}
for k, (m, cols) in fits.items():
q_in, q_out = m.predict(Xtr[:, cols]), m.predict(Xte[:, cols])
res[k].append((r2(ytr, q_in), r2(yte, q_out), sharpe(yte, q_out)))
res["true model"].append((r2(ytr, Xtr @ beta), r2(yte, Xte @ beta), sharpe(yte, Xte @ beta)))
print(f"{'':14s} {'train R^2':>10s} {'test R^2':>10s} {'test Sharpe':>12s}")
for k, v in res.items():
a = np.mean(v, axis=0)
print(f"{k:14s} {a[0]:+10.4f} {a[1]:+10.4f} {a[2]:+12.4f}")
Output (averages over 200 trials; Sharpe is per period):
train R^2 test R^2 test Sharpe
OLS, 50 feats +0.0578 -0.0414 +0.0407
ridge (CV) +0.0168 +0.0003 +0.0414
top-5 by corr +0.0274 -0.0092 +0.0566
true model +0.0085 +0.0100 +0.1005
- Training ranks the models backwards. OLS looks best in sample and is worst out of sample; the true model looks worst in sample.
- The formulas hold. OLS: in sample and out of sample, against predictions of and .
- and money disagree. OLS has a test of yet a positive Sharpe. punishes forecasts that are too large; a Sharpe ratio (like a correlation) ignores the scale of the forecast and rewards only its direction. Ridge mostly fixes the scale, taking from to zero, but barely changes the direction, so its Sharpe is the same.
- Everyone leaves money on the table. The best estimated model captures about half of the true model's Sharpe of .
Target engineering
With little signal, the choice of target can matter as much as the model:
- Volatility-scaled returns , with known at time (for example an EWMA). Without scaling, high-volatility periods dominate a squared loss; scaling is like weighted least squares and makes the target closer to stationary.
- Cross-sectional ranks (or z-scores within each date). They remove the market-wide move that no stock-level feature can predict, cap the influence of outliers and match how a long-short portfolio is actually built.
- Signs (classification of up versus down). Robust to outliers, but they discard magnitude. For Gaussian noise, , so you lose about 20% of the information.
- Residual returns after removing market or factor exposure, so the model predicts what you will actually trade.
The script below estimates a weak slope (IC about 0.05) with 1,000 rows using three targets, and reports how reliably the slope is detected (its mean over its standard deviation across 4,000 trials, an average -statistic):
import numpy as np
rng = np.random.default_rng(5)
n, trials, df = 1000, 4000, 3
targets = {"raw": lambda y: y,
"sign": np.sign,
"rank": lambda y: np.argsort(np.argsort(y)) / (len(y) - 1) - 0.5}
for noise in ["normal", "t(3)"]:
slopes = {k: [] for k in targets}
for _ in range(trials):
x = rng.normal(size=n)
e = rng.normal(size=n) if noise == "normal" else rng.standard_t(df, n) / np.sqrt(df / (df - 2))
y = 0.05 * x + e # IC about 0.05
for k, g in targets.items():
slopes[k].append(np.polyfit(x, g(y), 1)[0])
# mean / sd of the fitted slope across trials = how reliably the signal is detected
print(f"{noise:7s}", " ".join(f"{k} {np.mean(v) / np.std(v):.2f}" for k, v in slopes.items()))
Output:
normal raw 1.56 sign 1.26 rank 1.52
t(3) raw 1.57 sign 1.99 rank 2.16
With Gaussian noise, the raw target is best and the sign target loses the predicted 20% (). With fat-tailed noise of the same variance, ranks and signs detect the signal far more reliably than raw returns, because a few extreme observations no longer dominate the fit. Real returns are fat-tailed.
How strong should regularisation be?
A Bayesian view sets the scale. With prior and noise variance , the posterior mean is ridge regression with penalty on the sum of squared errors. For standardised, roughly orthogonal features, ridge multiplies each OLS coefficient by .
In the simulation, the total signal variance is spread over 50 features, so and , giving and a shrinkage factor of : the right model shrinks OLS by more than 80%. Cross-validation agrees: the median chosen by RidgeCV across the 200 trials was about 5,600. Penalties that look absurd by textbook standards are normal when is 1%. The same logic gives large minimum leaf sizes for trees, small learning rates with many rounds for boosting, and strong weight decay for networks.
Evaluate by economic value
Choose and report models by the decision they support, measured out of sample:
- IC and rank IC per period, with their -statistics over time, not one pooled number.
- The Sharpe ratio of the portfolio the forecasts imply, after transaction costs, together with turnover. A model that adds 0.002 of by trading twice as often can lose money.
- Stability across sub-periods and assets, since one good year can carry an average.
- Calibration matters only if you size positions from the forecast's magnitude; then fix the scale (shrink) separately from improving the ranking.
And remember that every model, feature set and hyperparameter you tried is a trial: the best of many backtests is optimistically biased, which is why the final test block is touched once.
Knowledge check
A daily single-asset signal has an out-of-sample IC of 0.04. Which is closest to the annualised Sharpe of a position proportional to the signal, before costs (252 trading days)?
Knowledge check
You fit OLS with 100 features on 2,000 observations of a target that is pure noise. Roughly what in-sample R² should you expect?
Knowledge check
A model has a test R² of −3% but its forecasts have a positive, statistically significant correlation with realised returns. What is the most sensible reading?
Knowledge check
You switch the target from raw next-day returns to their sign. Under which conditions is this most likely to improve out-of-sample performance?
Key takeaways
- : an IC of 0.05 is an of 0.25%, a hit rate of 51.6% and a daily Sharpe of 0.05 (about 0.8 a year).
- Noise features add about to in-sample and subtract about out of sample; in-sample fit can rank models backwards.
- Scale targets by ex-ante volatility, rank cross-sectionally, and prefer robust targets when tails are fat.
- The right ridge penalty is roughly noise variance over prior coefficient variance, which is huge when signals are weak.
- Judge models by out-of-sample IC, Sharpe after costs and stability, not by alone; negative with positive correlation means "shrink", not "discard".
Practice problems
Finished reading?
Answer the 4 knowledge checks to complete this lesson (0 done).