Tutorials › Generalized Linear Mixed Models (GLMM) › Posterior Intervals for Variance Components Near Zero

Bayesian GLMM and Prior Specification for Variance Components · Tutorial 286 of 698

Posterior Intervals for Variance Components Near Zero

You will learn how to calculate, compare, and interpret posterior intervals for variance components near zero, and how to check that the interval reflects the posterior and the scale of interest.

Advanced 11 min read

What You'll Learn

  • Define equal-tailed credible intervals from posterior quantiles.
  • Explain why intervals for nonnegative variance components may include zero.
  • Construct a highest-posterior-density interval when the posterior density decreases from the boundary.
  • Transform posterior intervals correctly between variance and standard-deviation scales.
  • Interpret intervals in context and distinguish near-zero uncertainty from a point mass at zero.
  • Check the effect of skewness, posterior computation, and interval choice on conclusions.

Why Intervals Near Zero Need Care

A variance component in a generalized linear mixed model describes variation among groups or other clusters. Write \(\tau^2\) for one such variance and \(\tau\) for its standard deviation. Since \(\tau^2 \geq 0\), a posterior distribution concentrated near zero is constrained by a boundary. It may also be strongly right-skewed: many plausible values can be small, while a smaller set of larger values extends the upper tail.

In that setting, a single estimate can hide important features of the posterior. The posterior mean may be pulled upward by the tail, while a symmetric interval can extend below the allowable value zero. Credible intervals make uncertainty visible, but their construction matters: equal-tailed and highest-posterior-density intervals answer related, not identical, questions.

The intervals here are conditional on the specified likelihood, prior, and observed data. For a continuous prior on \(\tau^2\), the posterior is also continuous, so the posterior probability of the exact value \(\tau^2=0\) is zero. An interval that includes zero does not, by itself, assign positive posterior probability to an exact zero variance.

Two Posterior Interval Constructions

Definition: A \(100(1-\alpha)\%\) equal-tailed posterior credible interval for a scalar parameter \(\theta\) has endpoints at posterior quantiles \(\alpha/2\) and \(1-\alpha/2\). Conditional on the model, prior, and data, it contains posterior probability \(1-\alpha\). A highest-posterior-density (HPD) set contains values with the highest posterior density, up to a density threshold chosen to give the required posterior probability.

For \(\tau^2\), let \(F\) denote its posterior cumulative distribution function. The equal-tailed interval is

$$ \left[F^{-1}\!\left(\frac{\alpha}{2}\right),\ F^{-1}\!\left(1-\frac{\alpha}{2}\right)\right]. $$

Its lower and upper tails each have posterior probability \(\alpha/2\). This construction is defined by posterior quantiles and remains available for skewed distributions. If the posterior is continuous and has support on \([0,\infty)\), its lower endpoint cannot be below zero.

An HPD set is defined by a density threshold: it includes values where the posterior density is at least that threshold, with the threshold chosen so that the set has posterior probability \(1-\alpha\). If the density is unimodal and an HPD interval has both endpoints in the interior of the parameter space, the endpoint densities are typically equal, with higher density inside. If the interval includes a boundary, the boundary endpoint need not have the same density. More generally, HPD sets comprise values above a density threshold, subject to the required probability. In a multimodal posterior, an HPD set may be disconnected rather than a single interval.

A Boundary Case: A Decreasing Posterior Density

A simple posterior illustrates why the boundary changes the HPD construction. Suppose the posterior distribution of \(\tau^2\) is exponential with rate \(\lambda\), so its density and cumulative distribution function for \(v \geq 0\) are

$$ f(v\mid y)=\lambda e^{-\lambda v}, \qquad F(v\mid y)=1-e^{-\lambda v}. $$

The density decreases from its maximum at \(v=0\). Thus, the 95% HPD set starts at zero: the highest-density values are those nearest the boundary. To find its upper endpoint \(U\), set the posterior probability from zero to \(U\) equal to 0.95:

$$ P(0\leq \tau^2\leq U\mid y) =1-e^{-\lambda U}=0.95, \qquad U=\frac{-\log(0.05)}{\lambda}. $$

The equal-tailed interval has different endpoints. Solving \(F(L\mid y)=0.025\) and \(F(U\mid y)=0.975\) gives \(L=-\log(0.975)/\lambda\) and \(U=-\log(0.025)/\lambda\). Both intervals contain 95% posterior probability, but they allocate probability differently. In particular, the HPD interval includes the boundary and does not require equal density at its two endpoints.

Worked Example: Equal-Tailed and HPD Intervals Near Zero

Suppose a hypothetical GLMM analysis gives an exponential posterior for a group-level variance \(\tau^2\), with rate \(\lambda=4\) per unit of variance. The variance is measured in squared log-odds units. Calculate and compare the 95% equal-tailed and HPD intervals.

For the equal-tailed interval, the lower endpoint is \(L=-\log(0.975)/4=0.006329\), and the upper endpoint is \(U=-\log(0.025)/4=0.9222\). Thus the interval is approximately \([0.006329,\ 0.9222]\) squared log-odds units. Each excluded tail has posterior probability 0.025.

For the HPD interval, the decreasing density makes the set with highest density start at zero. Solving \(1-e^{-4U}=0.95\) gives \(U=-\log(0.05)/4=0.7489\). The 95% HPD interval is therefore \([0,\ 0.7489]\) squared log-odds units. Its posterior density at zero is \(4\), while at the upper endpoint it is \(4e^{-4(0.7489)}=4(0.05)=0.2000\). The endpoint densities differ because zero is a boundary, not an interior endpoint.

Both intervals express substantial uncertainty about the upper extent of the variance. The HPD interval has the shortest range for this decreasing density, while the equal-tailed interval allocates equal posterior probability to its two tails. Neither result says that the variance is exactly zero with positive posterior probability.

Interpreting Posterior Intervals on Different Scales

Variance and standard deviation describe the same component on different scales. Because the square-root function is increasing on \([0,\infty)\), transforming the endpoints of a posterior interval for \(\tau^2\) gives the corresponding interval for \(\tau\), provided the transformation is applied to the posterior distribution consistently. In particular, posterior quantiles transform as

$$ Q_{\tau}(p)=\sqrt{Q_{\tau^2}(p)}. $$

This relationship does not mean that summaries such as means can be transformed in the same way: in general, \(E(\tau\mid y)\) is not \(\sqrt{E(\tau^2\mid y)}\). Nor should a standard deviation interval be reported with variance units. The scale and units should always be named.

Worked Example: Transforming an Equal-Tailed Interval

Suppose 1,000 hypothetical posterior draws for a group-level variance, in squared log-odds units, have empirical 2.5th, 50th, and 97.5th percentiles of 0.0025, 0.0400, and 0.3600. Using these quantiles, calculate the 95% equal-tailed interval for the variance and standard deviation.

The 95% equal-tailed interval for \(\tau^2\) is the 2.5th through 97.5th percentiles: \([0.0025,\ 0.3600]\) squared log-odds units. The posterior median variance is \(0.0400\) squared log-odds units.

Apply the square root to each endpoint: \(\sqrt{0.0025}=0.0500\) and \(\sqrt{0.3600}=0.6000\). The corresponding interval for \(\tau\) is \([0.0500,\ 0.6000]\) log-odds units. Its median is \(\sqrt{0.0400}=0.2000\) log-odds units. These are quantiles of the transformed posterior because square root is increasing; the interval retains 95% posterior probability.

The interpretation is conditional: given the model, prior, and data, the posterior probability that the group-level standard deviation lies between 0.0500 and 0.6000 log-odds units is 0.95. This does not state that there is a 95% probability that a fixed parameter lies in this particular interval under repeated sampling.

Choosing and Reporting an Interval

Equal-tailed intervals are often straightforward to calculate from posterior draws: estimate the two specified quantiles. They are especially useful when the goal is to report how much posterior probability lies in each tail. An HPD interval emphasizes the region of highest posterior density and is often shorter than an equal-tailed interval for a unimodal posterior. However, HPD intervals depend on the parameter scale: a nonlinear transformation can change which values have the highest density. Therefore, calculate an HPD interval on the scale whose density-based interpretation you intend to report; do not assume that transforming an HPD interval preserves its HPD property.

For intervals estimated from MCMC draws, the quantiles are estimates, not exact values. Check that the chains mix adequately for the variance component and that effective sample size is sufficient for the tails being reported. Tail quantiles can be noisy even when the posterior median appears stable. Monte Carlo uncertainty in an endpoint should not be mistaken for posterior uncertainty in the parameter itself.

Worked Example: A Practical Range on the Standard-Deviation Scale

Suppose a hypothetical posterior sample for \(\tau^2\), measured in squared log-odds units, has a 90% equal-tailed interval from 0.0100 to 0.4900. Its median is 0.0900. Calculate the corresponding standard-deviation interval and explain what it says.

The variance interval is \([0.0100,\ 0.4900]\) squared log-odds units. Taking square roots gives \(\sqrt{0.0100}=0.1000\) and \(\sqrt{0.4900}=0.7000\). Thus the 90% equal-tailed interval for \(\tau\) is \([0.1000,\ 0.7000]\) log-odds units. The standard-deviation median is \(\sqrt{0.0900}=0.3000\) log-odds units.

Conditional on the model, prior, and data, the interval assigns 90% posterior probability to standard deviations between 0.1000 and 0.7000 log-odds units. The relatively wide range shows that uncertainty remains about the magnitude of group-to-group variation, even though the median is 0.3000. The interval alone does not establish whether the variance is exactly zero or whether the component should be included in a model.

Diagnostics, Alternatives, and Limitations

A posterior interval is only as reliable as the posterior computation and model behind it. A credible interval close to zero can reflect genuine weak information about a variance component, but it can also be affected by poor exploration of the posterior. Look for chains that move through the relevant range, and examine the stability of both lower and upper quantiles across chains or longer runs. A pile-up of sampled values at exactly zero deserves particular attention: it may arise from a model with a point mass at zero, a constrained computational representation, or an implementation issue. Those cases have different interpretations and should not be conflated with a continuous posterior that merely concentrates near zero.

Frequentist confidence intervals and Bayesian credible intervals use different probability statements and depend on different assumptions. A frequentist interval is defined by the long-run coverage of its procedure under repeated sampling; a Bayesian credible interval summarizes posterior probability conditional on the model, prior, and observed data. Standard symmetric approximations can be awkward for a nonnegative variance close to its boundary. A Bayesian interval avoids reporting negative values when its posterior has nonnegative support, but it does not remove sensitivity to the prior, likelihood, or mixing of the posterior computation.

Report the interval type, credibility level, parameter scale, and units. When the posterior is very skewed, the median and interval often communicate location and uncertainty more clearly than the mean and a symmetric range. If practical interpretation depends on whether the standard deviation is below a scientifically meaningful threshold, report that probability separately and state the threshold and units. Do not describe a near-zero interval as proof of no variation.

Common pitfall: “The 95% HPD interval includes zero, so the posterior gives positive probability that the variance is exactly zero.” For a continuous posterior on nonnegative variances, the probability of the single value zero is zero; an interval including zero indicates that the boundary is within the reported set. A positive posterior probability at exactly zero requires a model that assigns positive prior mass to that value.
Key takeaway: Near the zero boundary, posterior intervals should respect nonnegative support and posterior shape. Equal-tailed intervals divide excluded probability equally between tails; HPD sets collect the highest-density values and may start at zero without equal endpoint densities. Always report the scale and interpret the probability conditional on the model, prior, and data.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions below.

  1. A continuous posterior for a variance component is concentrated near zero. Does an interval including zero imply positive posterior probability at exactly zero?
  2. For an exponential posterior with rate 2 per variance unit, calculate the upper endpoint of the 90% HPD interval.
  3. A 95% equal-tailed variance interval is \([0.04,\ 0.64]\) squared units. What is the corresponding standard-deviation interval?
  4. Why might an HPD interval that includes zero have different posterior densities at its two endpoints?
  5. What should be checked before treating MCMC-based tail quantiles as stable interval endpoints?

Solutions. (1) No. For a continuous posterior, the probability of the exact value zero is zero; the interval’s inclusion of zero does not change that. (2) The decreasing exponential density makes the HPD interval \([0,U]\). Solve \(1-e^{-2U}=0.90\), giving \(U=-\log(0.10)/2=1.151\) variance units. (3) Take square roots: \([\sqrt{0.04},\sqrt{0.64}]=[0.2000,\ 0.8000]\) standard-deviation units. (4) Zero is a boundary, so the HPD set can include the maximum-density boundary value and extend to a lower-density interior endpoint; equal endpoint densities are not required. (5) Check chain mixing and effective sample size for the tails, and assess whether quantiles are stable across chains or longer runs.

Clinical Biostats