Merlin: Fast and flexible 3x2pt cosmology with simulation-based inference
astro-ph.CO, astro-ph.IM
Submitted: 2026-09-21
Updated: 2026-09-21
Comments: 15 pages, 9 figures, 1 table. The Merlin code is available at https://github.com/Alexandra-Wernersson/merlin
Code: https://github.com/Alexandra-Wernersson/merlin
License: http://creativecommons.org/licenses/by/4.0/
The gist: We present Merlin, a simulation-based inference (SBI) pipeline to perform cosmological analyses of 3x2pt summary statistics: cosmic shear, galaxy clustering and the cross-correlation power spectra.
Terminology
Abstract
We present Merlin, a simulation-based inference (SBI) pipeline to perform cosmological analyses of 3x2pt summary statistics: cosmic shear, galaxy clustering and the cross-correlation power spectra. Our approach combines Marginal Neural Ratio Estimation (MNRE) with 3x2pt angular power spectra predictions from the cloelib library, although the pipeline is readily extensible to other cosmology libraries. We demonstrate this pipeline on a realistic setting representative of a Stage-IV photometric survey, with a 50-dimensional parameter space describing cosmology and a wide range of systematic effects. We find posteriors that are in excellent agreement with the nested sampler Nautilus, while reducing the number of required CPU-hours by two orders of magnitude. Because the generation of training data and the training of inference networks are decoupled processes, a single simulation bank can be reused to perform inference under different analysis choices, further improving the simulator-efficiency. We illustrate this flexibility by applying scale cuts, varying the survey area, and removing cosmic shear from the data vector (2x2pt), all at zero extra model evaluations, whereas sampling-based methods need costly re-runs for each case. The Merlin code is publicly available on GitHub.
Sources
- Euclid Definition Study Report
- Euclid. I. Overview of the Euclid mission
- LSST: from Science Drivers to Reference Design and Anticipated Data Products
- Dark Energy Survey Year 3 Results: Cosmological Constraints from Galaxy Clustering and Weak Lensing
- KiDS-Legacy: Cosmological constraints from cosmic shear with the complete Kilo-Degree Survey
- DESI 2024 VI: Cosmological Constraints from the Measurements of Baryon Acoustic Oscillations
- Dark Energy Survey Year 6 Results: Cosmological Constraints from Galaxy Clustering and Weak Lensing
- Constraints on Dynamical Dark Energy from Multiple Probes in the Full Dark Energy Survey
- Euclid preparation. XCVI. Cosmology Likelihood for Observables in Euclid (CLOE). 3. Inference and Forecasts
- The Non-Gaussian Weak-Lensing Likelihood: A Multivariate Copula Construction and Impact on Cosmological Constraints
- emcee: The MCMC Hammer
- MultiNest: an efficient and robust Bayesian inference tool for cosmology and particle physics
- PolyChord: nested sampling for cosmology
- dynesty: A Dynamic Nested Sampling Package for Estimating Bayesian Posteriors and Evidences
- NAUTILUS: boosting Bayesian importance nested sampling with deep learning
- Euclid preparation: IX. EuclidEmulator2 -- Power spectrum emulation with massive neutrinos and self-consistent dark energy perturbations
- CosmoPower-JAX: high-dimensional Bayesian inference with differentiable cosmological emulators
- Cutting corners: Hypersphere sampling as a new standard for cosmological emulators
- OL'E -- Online Learning Emulation in Cosmology
- Fast emulation of two-point angular statistics for photometric galaxy surveys
Related papers
- Angular clustering and bias of photometric quasars in the Kilo-Degree Survey Data Release 4
- A Novel kinetic Sunyaev-Zel'dovich Estimator for Electron-Electron Correlations
- Magnetic fields at the dawn of structure formation I. The CARLA J1510+5958 proto-cluster
- Dark Energy Survey Year 6 Results: Weak Lensing and Galaxy Clustering Cosmological Analysis Framework
- Exploring the Impact of Systematic Bias in Type Ia Supernova Cosmology Across Diverse Dark Energy Parametrizations
- Non-Gaussian Galaxy Stochasticity and the Noise-Field Formulation