Documentation

19.22 Log weights, conditional moments, and ESS

Importance log weight is \(-J(\eta_m)/2-\log q(\eta_m)\). nlmx uses log-sum-exp so very small likelihoods do not underflow. Normalized weights produce conditional means and weighted covariances written after SAEM/IMP.

Effective sample size is

\[ ESS=(\sum w)^2/\sum w^2. \]

Equal weights give ESS=M; one dominant weight gives approximately one. nlmx reports minimum and median subject ESS and warns when any subject falls below 10% of draws.

ESS measures weight concentration

Low ESS can improve with more draws, but severe degeneracy may indicate poor proposal, multimodality, failed curvature or model problems. Increasing M linearly raises cost.

Practical interpretation

Subtract the maximum log weight before exponentiating, sum scaled weights, then restore the maximum in log-mean-exp. Test with log weights near −1000 where ordinary exponentiation underflows. ESS is invariant to multiplying all weights by a constant, providing another unit test.

Inspect both ESS count and fraction. ESS 200 may be adequate at M=300 but signals deterioration at M=3000. Report the subject identifier (safely hashed) and conditional diagnostics for the minimum, not only an aggregate.

Weighted covariance must use the same normalized weights and a clearly documented finite-sample convention. Test invariance to adding a constant to every log weight and to permuting draw order.

Track the largest normalized weight as a companion diagnostic. A high maximum weight and low ESS identify a fragile integral even when OFV appears numerically finite.

Common mistakes

Do not compute weights on ordinary scale, average unnormalized conditional moments, or report only median ESS while one pivotal subject fails.

Checklist

  • Use stable log-sum-exp.
  • Normalize weights per subject.
  • Calculate mean/covariance consistently.
  • Report minimum/median ESS fraction.
  • Investigate low-ESS subjects.

Further reading

See reportable OFV/covariance and settings diagnostics.