Tutorials › Nonlinear Mixed-Effects Models (NLME) › Gaussian Importance Proposals from Conditional Modes

Importance Sampling and Adaptive Quadrature · Tutorial 180 of 797

Gaussian Importance Proposals from Conditional Modes

Learn to build and check a Gaussian importance proposal from an individual’s conditional mode and Hessian, and understand why local curvature may not capture the full target distribution.

Advanced 10 min read

What You'll Learn

  • Define the individual conditional target as likelihood times random-effects density.
  • Find a conditional mode and use the negative Hessian there to set a Gaussian proposal covariance.
  • Transform a proposal between standard-normal and random-effects coordinates.
  • Work through scalar and multivariate proposals with numerical calculations.
  • Explain how a proposal’s center and scale affect the spread of importance weights.
  • Recognize when a local Gaussian proposal may be unreliable.

Why Center a Proposal at the Conditional Mode?

For subject \(i\), the marginal likelihood contribution integrates that subject’s likelihood over the random-effects distribution. When the data make the subject-specific likelihood concentrate far from the population center, drawing random effects only from the population distribution may yield few draws in the important region. A subject-specific importance proposal instead aims to place draws near the region that contributes most to the integral.

A useful starting point is the conditional mode: the random-effects value that maximizes the individual likelihood multiplied by the random-effects density. The local curvature around this mode gives a principled scale for a Gaussian proposal. This is a proposal-design method, not a replacement for the marginal likelihood integral: importance weights retain the correction for using a proposal rather than the original integration density.

Definition: Let \(y_i\) denote subject \(i\)'s observations, \(\eta_i\) that subject's random-effects vector, and \(\theta\) the model parameters held fixed for the integration. Define the individual likelihood \(L_i(\eta_i;\theta)=p(y_i\mid\eta_i,\theta)\), the random-effects density \(\phi(\eta_i;\theta)\), and the unnormalized conditional target \(g_i(\eta_i;\theta)=L_i(\eta_i;\theta)\phi(\eta_i;\theta)\). The marginal likelihood contribution is \(L_i^{\mathrm{marg}}(\theta)=\int g_i(\eta_i;\theta)\,d\eta_i\). A conditional mode is a maximizer \(\hat\eta_i\) of \(g_i\), or equivalently of \(h_i(\eta_i)=\log g_i(\eta_i;\theta)\), when \(g_i\) is positive.

The random-effects density belongs in this definition. Maximizing the individual likelihood alone generally gives a different value, because it omits the population model's contribution. The conditional mode is also defined at specified \(\theta\); if the population or residual parameters change, the mode and its local curvature can change too.

From Local Curvature to a Gaussian Proposal

Suppose \(h_i\) is twice differentiable near an interior conditional mode \(\hat\eta_i\). At a local maximum, its gradient is zero. Define the observed negative Hessian at that mode by \(J_i=-\nabla^2 h_i(\hat\eta_i)\). If \(J_i\) is positive definite, a second-order Taylor expansion gives a local quadratic approximation to the log target.

$$ h_i(\eta_i)\approx h_i(\hat\eta_i) -\frac{1}{2}(\eta_i-\hat\eta_i)^\mathsf{T} J_i(\eta_i-\hat\eta_i) $$

Exponentiating the quadratic term gives the shape of a multivariate Gaussian centered at \(\hat\eta_i\), with precision matrix \(J_i\) and covariance \(J_i^{-1}\). This motivates the proposal \(q_i(\eta_i)=N(\hat\eta_i,J_i^{-1})\). The approximation need only guide the proposal; the importance weight uses the actual target \(g_i\), not its quadratic approximation.

Proposal construction: For a smooth target with an interior mode and a positive-definite negative Hessian \(J_i\), use the subject-specific Gaussian proposal \(q_i(\eta_i)=N(\hat\eta_i,J_i^{-1})\). In one dimension, the proposal variance is the reciprocal of the negative second derivative of \(h_i\) at the mode.

In practice, random effects are often written in standard-normal coordinates. If \(\eta_i=Lz_i\), where \(LL^\mathsf{T}=\Omega\), then \(z_i\sim N(0,I)\) under the population random-effects model. Define \(h_i(z_i)=\log L_i(Lz_i;\theta)+\log\phi(z_i)\), find its mode \(\hat z_i\), and calculate \(J_{z,i}=-\nabla^2h_i(\hat z_i)\). The proposal in these coordinates is \(z_i\sim N(\hat z_i,J_{z,i}^{-1})\). Transforming back gives mean \(L\hat z_i\) and covariance \(LJ_{z,i}^{-1}L^\mathsf{T}\). The prior contribution must be included in whichever coordinates are used.

Worked Example: A Scalar Conditional Mode and Its Curvature

Consider a hypothetical one-dimensional conditional log target, with terms constant in \(z\) omitted: \(h(z)=-z^2/2+2\exp(z)-\exp(2z)/2\). Its first and second derivatives are \(h'(z)=-z+2\exp(z)-\exp(2z)\) and \(h''(z)=-1+2\exp(z)-2\exp(2z)\). Suppose a numerical root finder gives the stationary point \(\hat z=0.52448\).

At \(z=0.524\), \(h''(0.524)\approx-1+2(1.6888)-2(2.8520)\approx-3.3264\), so the curve is locally concave. At the more precise mode, \(\exp(0.52448)\approx1.6896\) and \(\exp(1.04896)\approx2.8547\). Therefore \(h''(0.52448)\approx-1+2(1.6896)-2(2.8547)=-3.3302\), with small differences in the last decimal depending on rounding. Using unrounded exponentials gives approximately \(-3.33020\). Thus the negative curvature is \(J_z\approx3.33020\).

The mode-based proposal is \(q(z)=N(0.52448,1/3.33020)\). Its variance is approximately \(0.30028\), and its standard deviation is \(\sqrt{0.30028}\approx0.5480\). The resulting proposal is centered on the conditional mode and is narrower than a standard normal. This computation uses the negative second derivative, not the second derivative itself, as the precision.

The Taylor argument also explains the limitation of the method: the Hessian describes curvature only locally. If the target is skewed, has heavy tails, or has multiple modes, a Gaussian centered at one mode may not represent all regions that contribute appreciably to the integral.

What Proposal Location and Scale Do to Weights

For draws \(\eta_i^{(m)}\) from a proposal density \(q_i\), the importance weight is \(w_i^{(m)}=g_i(\eta_i^{(m)};\theta)/q_i(\eta_i^{(m)})\). If \(q_i\) is positive wherever \(g_i\) is positive and the integral is finite, then \[ L_i^{\mathrm{marg}}(\theta) =E_{q_i}\left[\frac{g_i(\eta_i;\theta)}{q_i(\eta_i)}\right]. \] Consequently, the average of \(M\) such weights is an unbiased estimator of the integral when the draws are independent from \(q_i\). A proposal that puts too little density in an important target region can produce occasional very large weights; a proposal that puts excessive density elsewhere can waste draws on regions contributing little to the integral.

Worked Example: Comparing Centers for a Gaussian Target

For illustration, let the normalized target density be \(p(x)=N(0.6,0.25)\), where the second parameter is the variance. Compare it with a proposal \(q_1(x)=N(0,0.25)\). At the target mean \(x=0.6\), \(p(0.6)=1/(\sqrt{2\pi}\,0.5)\approx0.7979\), while \(q_1(0.6)=0.7979\exp[-0.6^2/(2(0.25))]\approx0.3884\). The weight ratio there is \(p(0.6)/q_1(0.6)\approx2.0544\).

The densities have the same scale, but their centers differ. At \(x=1.6\), one unit above the target mean, \(p(1.6)=0.7979\exp[-1^2/(2(0.25))]\approx0.1080\). For the proposal, \(q_1(1.6)=0.7979\exp[-1.6^2/(2(0.25))]\approx0.00477\), giving a ratio of about \(22.65\). This large ratio illustrates how a displaced proposal can assign very little density to a region the target still occupies. Centering the proposal nearer the target mode would reduce this particular mismatch.

Worked Example: Why a Proposal Can Be Too Narrow

Keep \(p(x)=N(0.6,0.25)\), but take \(q_2(x)=N(0.6,0.04)\). This proposal has the correct center but standard deviation \(0.2\), compared with the target's \(0.5\). At \(x=0.6\), \(p(0.6)\approx0.7979\) and \(q_2(0.6)=1/(\sqrt{2\pi}\,0.2)\approx1.9947\), so the weight ratio is about \(0.4000\).

At \(x=1.6\), \(p(1.6)\approx0.1080\), whereas \(q_2(1.6)=1.9947\exp[-1^2/(2(0.04))]=1.9947\exp(-12.5)\approx0.00000743\). The ratio is about \(1.45\times10^4\). The proposal is centered correctly but is so narrow that it rarely samples this target region; when it does, the weight is enormous. A local curvature-based scale is useful, but it does not guarantee that the full target has Gaussian tails or the same width everywhere.

Multivariate Curvature and Coordinate Choice

In multiple dimensions, curvature includes dependence between random-effects components. The off-diagonal entries of \(J_i\) matter: replacing the full covariance \(J_i^{-1}\) with independent marginal variances can miss tilted directions of the target. A positive-definite Hessian is also essential for the stated Gaussian construction. A singular or indefinite matrix does not define a finite positive-definite covariance through inversion.

Worked Example: A Bivariate Curvature Proposal

Suppose a hypothetical conditional log target has mode \(\hat z=(0.4,-0.2)^\mathsf{T}\) and negative Hessian \(J=\begin{pmatrix}4&1\\1&3\end{pmatrix}\). Its determinant is \(4(3)-1(1)=11>0\), and its leading diagonal entry is positive; for this symmetric \(2\times2\) matrix, these facts establish positive definiteness. Its inverse is \(J^{-1}=\frac{1}{11}\begin{pmatrix}3&-1\\-1&4\end{pmatrix}\).

The resulting proposal is \(N(\hat z,J^{-1})\). Its marginal standard deviations are \(\sqrt{3/11}\approx0.5222\) and \(\sqrt{4/11}\approx0.6030\). Its correlation is \[ \frac{-1/11}{\sqrt{(3/11)(4/11)}}=-\frac{1}{\sqrt{12}}\approx-0.2887. \] Thus the local proposal includes a modest negative association between the two coordinates. Dropping the off-diagonal covariance would remove that orientation, even though it is part of the local curvature.

Checking the Construction and Choosing Alternatives

A mode-based Gaussian is most defensible when the target is smooth near a well-defined interior mode and the negative Hessian is stable and positive definite. Check the numerical optimization by evaluating the gradient near the reported mode and confirming that the Hessian has the required sign. For multivariate problems, inspect whether small eigenvalues make the inverse covariance extremely large or whether numerical asymmetry or rounding has affected the Hessian.

These checks do not establish that the target is globally Gaussian. Compare the mode-based proposal with the actual conditional target over a range of plausible random-effects values, and examine whether proposal draws cover regions where the target density is appreciable. Strong skewness, a long tail, separated modes, or large changes in curvature away from the mode warn that local curvature may give a poor scale or miss important regions. When multiple modes are present, a proposal centered on just one mode may fail to represent the others.

A population-centered proposal is simpler and can be reasonable when the subject-specific conditional target remains close to the population random-effects distribution. It may be inefficient when the subject’s data pull the conditional target far from that center. The mode-and-curvature proposal adapts its center and local scale to each subject, but requires optimization and Hessian calculation, and remains a local approximation. Laplace approximation also uses a mode and local curvature, but approximates the integral from those quantities; importance sampling instead evaluates the target-to-proposal density ratio, so the exact target—not only its quadratic approximation—enters each weight. Neither the local Gaussian nor a good mode guarantees low weight dispersion in a skewed or multimodal target.

Common pitfall: A correctly located mode does not by itself make a good proposal. A proposal that is too narrow can assign tiny density to important target regions, creating very large importance weights; a displaced proposal can do the same even if its scale is appropriate. Check both location and scale, and remember that the importance weight must divide by the full proposal density.

Check Your Understanding

Answer each question, then compare with the brief solutions below.

  1. Why is the conditional mode defined using the likelihood multiplied by the random-effects density, rather than the likelihood alone?
  2. In one dimension, the negative second derivative of the conditional log target at its mode is \(5\). What variance and standard deviation does the curvature-based Gaussian proposal use?
  3. A proposal has the right center but is much narrower than the target. What weight behavior may result?
  4. What does a non-positive-definite negative Hessian imply for the direct Gaussian proposal construction?

Solutions. (1) The conditional target is \(g_i=L_i\phi\), so its mode incorporates both subject data and the population random-effects model; omitting \(\phi\) changes the target being integrated. (2) The variance is \(1/5=0.2\), and the standard deviation is \(\sqrt{0.2}\approx0.4472\), in the units of the random-effect coordinate. (3) Important target regions away from the center receive little proposal density, so draws there can have very large target-to-proposal ratios. (4) The inverse is not a valid positive-definite covariance, so the proposed Gaussian is not defined by this construction; check the mode, Hessian calculation, parameterization, and possible non-quadratic or multimodal structure.