Tutorials › High-Dimensional Genomic Data Analysis › Choosing Lambda For Storey’s Pi0 Estimate

False Discovery Rate · Tutorial 154 of 795

Choosing Lambda For Storey’s Pi0 Estimate

You will learn to choose lambda by balancing alternative-p-value contamination against the increasing variability of an upper-tail estimate.

Intermediate 10 min read

What You'll Learn

  • Define Storey’s estimate of the null proportion using p-values above lambda.
  • Derive how alternative p-values contribute bias to the upper-tail estimate.
  • Quantify the estimate’s variance under an independent mixture model.
  • Compare candidate lambda values using explicit bias and variance calculations.
  • Recognize assumptions and diagnostics that affect a defensible choice.
  • Avoid choosing lambda to force a preferred discovery result.

Why Lambda Matters

Storey’s estimate of the proportion of true null hypotheses uses the fraction of p-values in the upper tail. The threshold \(\lambda\) determines which p-values count as upper-tail observations. A low threshold includes more alternatives, which can make the estimate too large. A high threshold reduces that contamination in some settings, but leaves fewer p-values to estimate the null proportion and can make the estimate noisy. Choosing \(\lambda\) is therefore a bias-variance decision, not a cosmetic setting.

This tutorial focuses on that decision. The estimate is used in Storey’s q-value approach, but the question here is how to choose its threshold, not how to calculate q-values from an estimate. In the formulas below, \(m\) is the number of tested hypotheses, \(p_i\) is the p-value for test \(i\), and \(\pi_0\) is the proportion of hypotheses that are truly null.

The Upper-Tail Estimator and Its Assumptions

Definition: For \(m\) p-values and a threshold \(0 \leq \lambda < 1\), Storey’s raw estimator of the null proportion is
$$ \hat{\pi}_0(\lambda) = \frac{\#\{i:p_i>\lambda\}}{m(1-\lambda)}. $$
The numerator counts p-values above \(\lambda\); \(m(1-\lambda)\) is the expected upper-tail count if all \(m\) p-values were independent and exactly uniform. Implementations may truncate the estimate at 1, since a proportion cannot exceed 1.

The basic mixture model supposes that a fraction \(\pi_0\) of the hypotheses are null, with null p-values uniformly distributed on \([0,1]\), and that the remaining fraction have alternative p-values with cumulative distribution function \(F_1\). This exact-uniform null assumption is appropriate for continuous tests calibrated under the null. It is stronger than merely requiring valid, super-uniform p-values: conservative or discrete null p-values need not have upper-tail probability \(1-\lambda\), so the displayed estimator may require adjustment in those settings.

For the expectation calculation, the model can be read as sampling each p-value from the same mixture: a null p-value with probability \(\pi_0\), or an alternative p-value with probability \(1-\pi_0\). Independence is not needed for this expectation. The simple variance formula used below additionally assumes that the \(m\) p-values are independent and identically distributed under this mixture. Those assumptions are useful for understanding the tradeoff, but genomic tests may violate independence.

How Lambda Controls Bias and Variance

Write \(S_1(\lambda)=P(p_i>\lambda\mid\text{alternative})=1-F_1(\lambda)\), the alternative probability of falling above the threshold. Under the mixture model, the probability that a p-value exceeds \(\lambda\) is

$$ q(\lambda) = \pi_0(1-\lambda)+(1-\pi_0)S_1(\lambda). $$

Dividing the expected upper-tail fraction by \(1-\lambda\) gives the estimator’s expectation. The difference between that expectation and \(\pi_0\) is its bias under this model.

$$ E[\hat{\pi}_0(\lambda)] = \frac{q(\lambda)}{1-\lambda} = \pi_0+(1-\pi_0)\frac{S_1(\lambda)}{1-\lambda}, \qquad \operatorname{Bias}(\hat{\pi}_0(\lambda)) = (1-\pi_0)\frac{S_1(\lambda)}{1-\lambda}. $$

The bias is nonnegative because alternative p-values that remain above \(\lambda\) are counted alongside null p-values. If most alternatives produce small p-values, \(S_1(\lambda)\) can be small, and this source of upward bias is reduced. If alternatives have substantial upper-tail probability, the estimate can remain appreciably above \(\pi_0\), even at a seemingly high threshold.

Under the independent, identically distributed mixture model, the number of p-values above \(\lambda\) has a binomial distribution with size \(m\) and probability \(q(\lambda)\). Therefore,

$$ \operatorname{Var}(\hat{\pi}_0(\lambda)) = \frac{q(\lambda)\{1-q(\lambda)\}}{m(1-\lambda)^2}. $$

The denominator shrinks as \(\lambda\) approaches 1. There are fewer upper-tail observations, so the estimate generally becomes more variable. The formula makes the tradeoff explicit: raising \(\lambda\) can reduce the alternative contribution to bias, but can increase variance. It does not guarantee that variance rises at every possible step for every p-value distribution; it shows why an extreme threshold is often unstable.

Worked Example: Calculating the Estimate From Upper-Tail Counts

Suppose a hypothetical analysis tests \(m=2{,}000\) genomic features. At a prespecified threshold \(\lambda=0.60\), 348 p-values exceed the threshold. The estimate is

$$ \hat{\pi}_0(0.60) = \frac{348}{2{,}000(1-0.60)} = \frac{348}{800} = 0.435. $$

Thus the estimated null proportion is 0.435, or 43.5%. The calculation assumes that the null p-values are uniform so that the upper-tail fraction can be compared with \(1-\lambda=0.40\). The number alone does not establish that 43.5% of hypotheses are truly null: alternatives with p-values above 0.60 also contribute to the count.

For illustration, suppose 154 of the same 2,000 p-values exceed 0.80. Then

$$ \hat{\pi}_0(0.80) = \frac{154}{2{,}000(1-0.80)} = \frac{154}{400} = 0.385. $$

Both calculations use the same observed p-values, but the estimates differ because they use different parts of the upper tail and different denominators. Neither estimate can be declared more accurate from these counts alone. Accuracy depends on how many alternatives remain in each tail and on sampling variability.

A Short Derivation of the Tradeoff

Let \(I_i\) equal 1 when \(p_i>\lambda\), and 0 otherwise. Then \(\hat{\pi}_0(\lambda)=\sum_{i=1}^m I_i/[m(1-\lambda)]\). Under the mixture assumptions, \(E[I_i]=q(\lambda)\), and hence

$$ E[\hat{\pi}_0(\lambda)] = \frac{\sum_{i=1}^m E[I_i]}{m(1-\lambda)} = \frac{m q(\lambda)}{m(1-\lambda)}. $$

Substituting the mixture tail probability gives

$$ \frac{\pi_0(1-\lambda)+(1-\pi_0)S_1(\lambda)}{1-\lambda} = \pi_0+(1-\pi_0)\frac{S_1(\lambda)}{1-\lambda}. $$

This derivation separates the null contribution, which is calibrated to \(\pi_0\), from the excess contributed by alternatives in the tail. For the variance, independence gives \(\operatorname{Var}(\sum I_i)=m q(\lambda)\{1-q(\lambda)\}\); dividing by the square of \(m(1-\lambda)\) yields the variance formula above. If p-values are dependent, covariance terms enter \(\operatorname{Var}(\sum I_i)\), so that independent-binomial formula no longer applies.

Worked Example: A Model-Based Bias and Variance Comparison

Consider a hypothetical mixture with \(\pi_0=0.80\), \(m=1{,}000\), and alternative p-values distributed as \(\operatorname{Beta}(1,4)\). For this alternative distribution, \(S_1(\lambda)=(1-\lambda)^4\). Compare \(\lambda=0.50\) with \(\lambda=0.80\).

At \(\lambda=0.50\), \(S_1(0.50)=0.5^4=0.0625\). The expected estimate and bias are

$$ E[\hat{\pi}_0(0.50)] = 0.80+0.20\frac{0.0625}{0.50} = 0.825, \qquad \operatorname{Bias}=0.025. $$

The upper-tail probability is \(q(0.50)=0.80(0.50)+0.20(0.0625)=0.4125\). The variance and standard deviation are

$$ \operatorname{Var}(\hat{\pi}_0(0.50)) = \frac{0.4125(1-0.4125)}{1{,}000(0.50)^2} = 0.0009694, \qquad SE \approx \sqrt{0.0009694}=0.0311. $$

At \(\lambda=0.80\), \(S_1(0.80)=0.2^4=0.0016\), so

$$ E[\hat{\pi}_0(0.80)] = 0.80+0.20\frac{0.0016}{0.20} = 0.8016, \qquad \operatorname{Bias}=0.0016. $$

Here \(q(0.80)=0.80(0.20)+0.20(0.0016)=0.16032\). Thus

$$ \operatorname{Var}(\hat{\pi}_0(0.80)) = \frac{0.16032(1-0.16032)}{1{,}000(0.20)^2} = 0.003366, \qquad SE \approx 0.0580. $$

In this model, the higher threshold greatly reduces bias but increases the standard deviation from about 0.0311 to 0.0580. These are model-based quantities, not estimates of actual performance in a study unless the mixture assumptions and alternative distribution are credible.

Choosing a Threshold in Practice

There is no universally optimal \(\lambda\). A defensible choice considers the anticipated alternative tail and the number of tests. The aim is to place the threshold high enough that relatively few alternatives remain above it, while retaining enough observations to estimate the null tail with useful precision. A fixed value such as 0.5 is sometimes used as a practical convention, not as a theorem that it is optimal for every data set.

If there is independent scientific or pilot information about the alternative p-value distribution, it can inform the tradeoff. The following hypothetical calculation shows how a threshold can be chosen by comparing approximate mean squared error, the sum of variance and squared bias.

Worked Example: Using an Alternative-Tail Benchmark

Suppose a hypothetical design has \(m=5{,}000\) tests and \(\pi_0=0.70\). Based on an independent pilot model, the anticipated alternative tail probabilities are \(S_1(0.40)=0.25\) and \(S_1(0.70)=0.08\). These values are assumptions for the calculation, not observations used to tune a result. Compare the two thresholds.

At \(\lambda=0.40\), the expected estimate is \(0.70+0.30(0.25/0.60)=0.825\), giving bias \(0.125\). The mixture tail probability is \(q=0.70(0.60)+0.30(0.25)=0.495\), so

$$ \operatorname{Var}(\hat{\pi}_0(0.40)) = \frac{0.495(0.505)}{5{,}000(0.60)^2} = 0.0001389. $$

The approximate mean squared error is \(0.125^2+0.0001389=0.01576\).

At \(\lambda=0.70\), the expected estimate is \(0.70+0.30(0.08/0.30)=0.780\), giving bias \(0.080\). Now \(q=0.70(0.30)+0.30(0.08)=0.234\), and

$$ \operatorname{Var}(\hat{\pi}_0(0.70)) = \frac{0.234(0.766)}{5{,}000(0.30)^2} = 0.0003983. $$

The approximate mean squared error is \(0.080^2+0.0003983=0.006798\). Under the stated benchmark, 0.70 has the smaller approximate mean squared error, despite its larger variance. This conclusion is conditional on the assumed tail probabilities and mixture model; different alternatives or dependence could change it.

Diagnostics, Alternatives, and Limitations

Before relying on an estimate, check whether its assumptions are plausible and whether the upper tail contains enough information. A p-value histogram can reveal gross departures from a uniform-looking null background or a shortage of upper-tail values, but it cannot by itself verify that null p-values are exactly uniform or identify the true labels of null tests. A very small count above \(\lambda\) is a warning that the estimate may be unstable. Estimates above 1, before truncation, can also arise from sampling variation or model mismatch; truncating them does not repair the underlying cause.

A fixed threshold is transparent and reproducible, but may leave considerable bias if alternatives retain substantial upper-tail mass. Raising the threshold can reduce that contamination, but may make the estimate sensitive to a handful of p-values. Model-based choices can use a scientifically justified alternative distribution, as in the preceding example, but are only as reliable as that model. More adaptive methods are possible, yet they do not eliminate the need to state assumptions and assess uncertainty. A systematic examination of how estimates change across thresholds is a separate diagnostic task.

Dependence is an important limitation in genomic applications. The expectation formula follows from marginal mixture probabilities, but the independent variance formula does not account for correlated tests. Likewise, if null p-values are discrete or conservative, replacing their actual tail probability with \(1-\lambda\) can distort the calibration. The estimator is not a direct count of true null hypotheses: it estimates a proportion under a model, using upper-tail p-values as indirect evidence.

Common Mistake

Pitfall: “A larger \(\lambda\) always gives a better estimate because it removes more alternatives from the tail.” This overlooks the shrinking number of tail observations and the resulting increase in variability. The correction is to weigh expected contamination against available tail information under explicit assumptions; a high threshold is not automatically preferable.

Another poor practice is to select \(\lambda\) because it produces a preferred number of discoveries. That makes the estimate outcome-driven and can understate uncertainty. A threshold should be justified by the estimator’s bias-variance behavior and the analysis context, rather than by the desired conclusion.

Check Your Understanding

Answer each question, then compare with the solutions.

  1. For \(m=1{,}500\), \(\lambda=0.60\), and 270 p-values above \(\lambda\), calculate Storey’s raw estimate.
  2. If \(\pi_0=0.75\) and \(S_1(0.50)=0.10\), what are the expected estimate and its bias at \(\lambda=0.50\)?
  3. Why can increasing \(\lambda\) reduce bias but increase variance?
  4. Under what assumption does the binomial variance formula in this tutorial hold?

Solutions. (1) \(\hat{\pi}_0(0.60)=270/[1{,}500(0.40)]=270/600=0.450\). (2) The bias is \((1-0.75)(0.10/0.50)=0.050\), so the expected estimate is \(0.75+0.05=0.800\). (3) A higher threshold can exclude alternatives with small p-values, reducing their contribution to the upper-tail count; at the same time, fewer p-values exceed the threshold, so the estimate has less tail information and can be more variable. (4) The formula assumes independent, identically distributed p-values from the stated null-alternative mixture, with exactly uniform null p-values.

Clinical Biostats