Why Let the Variance Prior Depend on Expression?
In expression microarrays, genes can differ not only in their average measured intensity but also in how variable their measurements are. In some data sets, the residual variance tends to change systematically across the range of average expression. A single variance prior shared by every gene can then be a poor reference for genes at one end of that range. A mean-variance trend addresses this by allowing the prior variance to depend on average expression.
The trend does not say that a gene’s average expression determines its biological variability, nor does it replace the gene-wise linear model. It describes a pattern across genes that informs the prior used to stabilize noisy residual-variance estimates. The earlier material on estimating the variance prior across genes supplies the empirical Bayes framework; here the specific change is that the prior scale varies with average expression.
A typical gene-wise model is \(y_g=X\beta_g+\varepsilon_g\), where \(y_g\) is the vector of observed expression values for gene \(g\), \(X\) is the design matrix, and \(\beta_g\) is the vector of gene-specific coefficients. Under the standard linear-model assumptions, the errors have mean zero, variance \(\sigma_g^2\), and are independent with a normal distribution conditional on the model. The design must be of adequate rank, and the residual variance estimate must have positive residual degrees of freedom. The average expression \(A_g\) is calculated from the normalized expression measurements; it is a predictor of the prior scale, not the residual variance estimate itself.
The trend is useful when the expected residual variance changes with average expression. For example, measurement noise may be larger among dim probes, or variability may follow another smooth pattern. The relationship is data-dependent: neither its direction nor its shape should be assumed in advance.
Prior and Moderated Variance
Conditional on the average expression, a common formulation gives each gene a scaled inverse-chi-squared prior for its residual variance. The prior scale is the trend value at that gene’s average expression. The gene-wise residual variance estimate supplies the likelihood information, and empirical Bayes combines it with the prior.
The formula shows exactly how the trend changes moderation. A gene with a small residual degrees of freedom receives more weight from its prior scale. A gene with a large residual degrees of freedom receives relatively more weight from its own residual variance estimate. Since the prior scale is local to average expression, two genes with equal \(s_g^2\) can receive different moderated variances.
For a contrast \(c^\mathsf{T}\beta_g\), let \(\hat\theta_g=c^\mathsf{T}\hat\beta_g\), and let \(v_g\) be the design-based variance factor for that contrast. If the coefficient estimate has variance \(\sigma_g^2v_g\), its moderated standard error and t-statistic are
Under the model and prior assumptions, the moderated statistic is compared with a t distribution having \(d_g+d_0\) degrees of freedom. The variance trend changes the estimated scale in the denominator; it does not change the observed coefficient estimate or the contrast’s design-based variance factor.
Why the Weighted Formula Holds
The gene-wise sampling model contributes a likelihood for \(\sigma_g^2\) proportional to \((\sigma_g^2)^{-d_g/2}\exp[-d_gs_g^2/(2\sigma_g^2)]\). The scaled inverse-chi-squared prior contributes a factor proportional to \((\sigma_g^2)^{-(d_0/2+1)}\exp[-d_0s_{0g}^2/(2\sigma_g^2)]\). Multiplication adds the powers and the exponential terms:
This has the scaled inverse-chi-squared form, with degrees of freedom \(d_0+d_g\). Matching its scale term to the usual form \((d_0+d_g)s_{g,\mathrm{mod}}^2\) gives \(s_{g,\mathrm{mod}}^2=(d_0s_{0g}^2+d_gs_g^2)/(d_0+d_g)\). Thus the weighted estimate follows directly from combining the prior and sampling information. It is the posterior scale used for moderated inference, not in general the posterior mean of \(\sigma_g^2\).
Worked Example: Moderating a Low-Expression Gene
Suppose a hypothetical low-expression gene has average normalized log-expression \(A_g=4.2\), residual variance \(s_g^2=0.16\) log2-expression units squared, and \(d_g=4\). The fitted trend gives a prior scale \(s_{0g}^2=0.03\) in the same squared units, with \(d_0=8\). For a specified contrast, suppose \(\hat\theta_g=0.30\) log2-expression units and \(v_g=0.25\). Assume the gene-wise model is adequately specified and its residual degrees of freedom are positive.
The moderated variance is \(s_{g,\mathrm{mod}}^2=(8(0.03)+4(0.16))/(8+4)=(0.24+0.64)/12=0.07333\) log2-expression units squared. The gene’s noisy variance estimate is pulled toward its lower local prior scale.
The moderated standard error is \(SE_{g,\mathrm{mod}}=\sqrt{0.07333(0.25)}=\sqrt{0.0183325}\approx0.1354\) log2-expression units. Therefore, \(t_{g,\mathrm{mod}}=0.30/0.1354\approx2.216\), with \(4+8=12\) degrees of freedom. The statistic is positive because the estimated contrast is positive. The calculation illustrates moderation; a significance conclusion would additionally require the chosen testing procedure and its applicable multiplicity considerations.
Worked Example: Equal Residual Variances, Different Trend Priors
Consider two hypothetical genes, one at low average expression and one at high average expression. Both have \(s_g^2=0.09\) log2-expression units squared and \(d_g=6\). Let \(d_0=10\). Suppose the fitted trend gives prior scales \(0.04\) for the low-expression gene and \(0.16\) for the high-expression gene. These are hypothetical fitted values, not a claim that every array has this trend.
For the low-expression gene, \(s_{\mathrm{mod}}^2=(10(0.04)+6(0.09))/16=(0.40+0.54)/16=0.05875\). For the high-expression gene, \(s_{\mathrm{mod}}^2=(10(0.16)+6(0.09))/16=(1.60+0.54)/16=0.13375\). Although their observed variances are identical, their moderated variances differ because the trend supplies different local prior scales.
To see the consequence for a contrast, suppose both genes have \(\hat\theta=0.20\) log2-expression units and \(v=0.20\). The low-expression gene has \(SE=\sqrt{0.05875(0.20)}\approx0.1084\), giving \(t\approx0.20/0.1084=1.845\). The high-expression gene has \(SE=\sqrt{0.13375(0.20)}\approx0.1636\), giving \(t\approx0.20/0.1636=1.223\). The different statistics arise from the assumed mean-variance pattern, not from different estimated contrast effects.
Worked Example: Trend Prior Versus a Common Prior
Suppose a hypothetical gene has high average expression, \(s_g^2=0.08\) log2-expression units squared, and \(d_g=5\). Let \(d_0=10\). A fitted trend assigns it \(s_{0g}^2=0.20\), whereas a hypothetical common-prior approach would use \(s_0^2=0.08\) for all genes.
Using the trend prior gives \(s_{g,\mathrm{mod}}^2=(10(0.20)+5(0.08))/15=(2.00+0.40)/15=0.1600\). Using the common prior gives \(s_{g,\mathrm{mod}}^2=(10(0.08)+5(0.08))/15=1.20/15=0.08000\). The trend-based estimate is larger because the gene’s observed variance is below its local prior scale. It is therefore moderated upward. A common prior at \(0.08\) would leave the estimate at \(0.08\) in this example.
This comparison isolates the role of the trend: it changes the prior reference point. It does not mean the trend-based value is automatically more accurate. That depends on whether the fitted relationship represents the variance pattern across the genes being analyzed.
Fitting, Diagnostics, and Alternatives
In practice, average expression and gene-wise residual variance estimates are calculated from the normalized data and fitted gene-wise models. A smooth relationship between average expression and variance information is then estimated across genes. Because individual residual variances are noisy, the trend should represent the broad relationship rather than follow each gene’s estimate. Estimation methods may account for the sampling variability of log residual variances; simply drawing a curve through raw variances can give excessive influence to noisy genes.
The resulting fitted scale \(s_0^2(A_g)\) must be positive and defined across the expression range where it is used. The model also relies on the underlying gene-wise linear models being appropriate, the residual variance estimates having their stated sampling behavior, and the trend being a reasonable summary of how prior variance changes with average expression. The empirical Bayes borrowing further assumes that genes provide useful information about the prior after conditioning on the modeled trend. Genes need not have identical variances, but a smooth common relationship must be informative.
Useful diagnostics include a plot of residual variance information against average expression, with the fitted trend shown; the distribution of departures from that trend; and checks for systematic residual patterns that the smooth curve misses. Inspect whether the fitted curve is being driven by a small number of genes or behaves erratically near the ends of the expression range. A flat or unstable fit, a sharp bend supported by few genes, or a broad pattern of residuals above the curve in one region and below it in another suggests the trend is not capturing the structure adequately.
The main alternatives answer related but distinct needs. A common variance prior is simpler and can be appropriate when there is little evidence of a mean-variance relationship. No moderation uses each gene’s residual variance directly, avoiding prior misspecification but retaining its small-sample instability. A trend prior can improve the local reference for variance moderation when the pattern is real, but it adds a modeling choice and can mislead if the smooth fit is poor. Modeling a mean-dependent variance through observation-level weights is another possible strategy; it changes the variance representation in the linear model rather than merely choosing a gene-specific prior scale. These approaches are not interchangeable without checking their assumptions and the data structure.
Common Pitfalls and Limitations
- Confusing mean expression with residual variance. Average expression predicts the prior scale across genes; it is not a substitute for the gene-wise residual variance.
- Assuming the trend must slope downward. The direction and shape must be supported by the data. A trend that is forced to decrease can impose a false prior pattern.
- Assuming a high or low prior scale determines the gene’s result. The moderated estimate also depends on \(s_g^2\), \(d_g\), and \(d_0\). Genes with more residual degrees of freedom are less influenced by the prior.
- Treating the moderated variance as the posterior mean. The weighted formula is the posterior scale used for moderated inference. The posterior mean, when it exists, has a different denominator.
- Ignoring model or fit failures. A smooth trend cannot repair an incorrect design, unmodeled dependence, poor normalization, or a relationship that changes in ways the fitted curve cannot represent.
Trend-based moderation is valuable when there is a reproducible, sufficiently smooth relationship between average expression and residual variance. It is limited by the quality of the gene-wise models and the trend estimate. A fitted pattern is an empirical prior assumption, not a causal explanation for why expression measurements vary.
Check Your Understanding
Answer each question, then compare with the solutions below.
- A gene has \(s_g^2=0.12\), \(d_g=4\), \(d_0=8\), and local trend scale \(s_{0g}^2=0.06\). Calculate its moderated variance.
- Two genes have the same residual variance and residual degrees of freedom but different average expression. What can make their moderated variances differ?
- For a gene with \(\hat\theta=0.24\), \(v=0.25\), and moderated variance \(0.09\), calculate the moderated standard error and t-statistic.
- What is one diagnostic sign that the fitted mean-variance trend may be inadequate?
Solutions. (1) \(s_{\mathrm{mod}}^2=(8(0.06)+4(0.12))/12=(0.48+0.48)/12=0.08000\). (2) Their local prior scales \(s_0^2(A_g)\) may differ, so the weighted averages differ. (3) \(SE=\sqrt{0.09(0.25)}=0.1500\), and \(t=0.24/0.1500=1.600\). (4) For example, residuals from the fitted trend may show a systematic pattern across average expression, or the curve may be unstable at the range ends.