Skip to main content

Come analyze HEASARC, IRSA, and MAST data in the cloud! The Fornax Initiative is now welcoming all interested beta users.

Xspec Home Page

Choosing a sampler

The following table summarizes the trade-offs between the four samplers.

MH GW HMC nest
Tuning effort Moderate Low Moderate Low
Per-sample cost Cheapest Low High Highest
Effective samples per unit time, smooth posterior Low to moderate Moderate High Moderate
Robustness to multi-modality Poor Poor Poor Good
Robustness to correlated parameters Poor (without good covariance) Good Excellent (with gradients) Good
Returns evidence $Z$? No No No Yes
Requires gradients? No No Yes No
Warm-start from MLE? Helpful Helpful Essential Ignored

A useful decision flow:

  • Few parameters ($D \le 5$), smooth posterior, single source — start with GW (the default). It is the lowest-friction option for routine work.
  • Moderate to many parameters ($D \ge 10$), gradients available for the model components in use — HMC. The gain over GW becomes decisive past about $D = 15$.
  • Multi-modal posterior, or a model-comparison question that needs Bayes factors — nested sampling. Accept the higher elapsed time as the cost of reliability and the bonus of $Z$.
  • Custom proposal needed (e.g. exploiting an exact conditional) or working with a model class that defeats both HMC and nest — MH with a user-defined proposal class through initpackage.