Simulation-based inference with neural posterior estimation applied to X-ray spectral fitting - III

Didier Barret, Simon Dupourqué · 2025

Read Simulation-based inference with neural posterior estimation applied to X-ray spectral fitting - III by Didier Barret, Simon Dupourqué (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2512-16709.txt.

Introduction

Didier Barret and Simon Dupourqué improve fast X-ray spectrum fitting with simulation-based inference, in the third paper of a series. The method learns likely parameter ranges from simulated spectra, giving near-instant fits for data from the future newAthena X-IFU instrument.

An auto-encoder first squeezes each spectrum into a small code, trained with a custom loss tied to fit quality. A density model then learns ranges from those codes over several rounds, each round zooming in near the observed data. A final importance sampling step corrects the learned ranges to exact ones. On test data the results match slow nested sampling, at ten times the speed on a laptop.

Catalog record

CREATORDidier Barret, Simon Dupourqué
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE83 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2512-16709

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Simulation-based inference with neural posterior estimation applied to X-ray spectral fitting - III Didier Barret, Simon Dupourqué Abstract Context. Simulation-based inference (SBI) with neural posterior estimation (NPE) can be used for X-ray spectral fitting both in the Gaussian and Poisson regimes, enabling users to rapidly derive approximated posteriors of the model parameters. Aims. We investigate the capabilities of auto-encoders to reduce the dimension of X-ray spectra, such as the ones that will be provided by the X-ray Integral Field Unit ( X-IFU ): the high-resolution X-ray spectrometer to fly on-board the European Space Agency newAthena space X-ray observatory. In addition, taking advantage of the known likelihood, we investigate importance sampling to refine the approximate posteriors. Methods. We build an auto-encoder that compresses X-ray spectra into a low-dimensional latent space while preserving key spectral features. The auto-encoder is trained by minimizing a custom loss equal to the Cash statistic ( C-stat ) between the simulated and reconstructed spectra. A Neural Density Estimator (NDE) is then trained on the latent representations of the spectra. We use multi-round training for both the auto-encoder and the NDE. At each round, new spectra are drawn from a truncated proposal focused on the observation. Finally, when the NDE training has converged, the resulting approximate posteriors, conditioned at the observation, are refined via likelihood-based importance sampling. To evaluate the information content of the latent space, we introduce a diagnostic neural network trained to reconstruct the original spectral model parameters from the latent space. Additionally, we develop a specialized neural network that learns the likelihood function directly, enabling faster importance sampling and enhancing computational efficiency. Results. Reducing the dimension of X-IFU -like X-ray spectra enhances the performance and efficiency of the neural posterior estimation. When combined with multi-round inference, our auto-encoder consistently outperforms other dimensionality reduction techniques such as Principal Component Analysis (PCA) and hand-crafted spectral summaries in terms of accuracy, and robustness. With each inference round, performance improves as the proposal distributions contract toward the observation. Following an importance-sampling correction, the resulting posterior distributions are statistically indistinguishable from those produced by nested sampling algorithms. On a standard multi-core laptop, the full pipeline, including simulations, dimension reduction, inference and subsequent importance sampling, achieves speedups exceeding an order of magnitude. Crucially, validation is based on real observational data, not just simulator outputs. In addition to mock X-IFU spectra, we demonstrate successful applications to high-resolution XRISM -Resolve and lower-resolution NICER and XMM-Newton EPIC-PN observations, confirming the method applicability across different instruments and spectral resolutions. Conclusions. Simulation-based inference with neural posterior estimation on compressed X-ray spectra, when paired with likelihood-based importance sampling, yields posterior distributions that are indistinguishable from classical Bayesian results, offering an exact yet efficient alternative for X-ray spectral fitting. The SIXSA ( S imulation-based I nference for X-ray S pectral A nalysis) python package available on GitHub is being update to include the auto-encoder and the importance sampling. Deriving exact posteriors with dimension reduction and importance sampling 1 Introduction X-ray spectral fitting is a cornerstone of high-energy astrophysics, providing access to the physical properties of compact objects, hot plasmas, and accretion flows through parametric modeling of count spectra folded through complex instrumental responses. Traditionally, parameter inference relies either on gradient-free minimization of fit statistics (e.g. \chi^{2} or C-stat ( 10 ) ) or on Bayesian sampling techniques such as Markov chain Monte Carlo (MCMC) ( 29 ) and Nested Sampling (NS) ( 53 ) , which, while powerful, can be computationally expensive, sensitive to multi-modal or highly degenerate posteriors, and increasingly difficult to scale as models and data grow in complexity, see 8 for a recent comprehensive review of statistical approaches in X-ray spectral analysis. Neural networks have emerged as an alternative, first applied by 35 to high-resolution galaxy cluster spectra, and later by 47 to lower-resolution AGN data from Athena. While offering comparable accuracy and a speed improvement of approximately three orders of magnitude after training, the latter approach lacked error estimates on spectral parameters. This limitation can be addressed within a Bayesian framework using Simulation-Based Inference with Neural Posterior Estimation (SBI-NPE; 45 ; 42 ), which infers the posterior by training a neural network on synthetic spectra sampled from the prior. Unlike traditional Bayesian methods, SBI does not require an explicit likelihood and is thus applicable to complex models where a simulator is available ( 13 ; 16 ) . As with any likelihood-free approach, another strength of NPE is its ability to learn the likelihood function from compressed representations of the data. Dimensionality reduction serves multiple purposes: it isolates informative components, filters out noise, eliminates redundant features, and lowers the computational cost of inference ( 17 , and references therein) . We successfully applied simulation-based inference with neural posterior estimation for X-ray spectral fitting ( 6 ; 20 , hereafter BD24 and DB25) . In BD24, we considered low-resolution spectra from the NICER instrument ( 24 ) . We showed that SBI-NPE performed on par with standard spectral fitting in both Gaussian and Poisson regimes, for both synthetic and real data, providing consistent parameter estimates and posteriors. In DB25, we investigated its applicability to high-resolution spectra expected from the upcoming newAthena X-IFU instrument ( 4 ; 50 ) , leveraging spectral compression and SBI likelihood-free nature. Two spectral compression strategies were tested: (1) hand-crafted summary statistics (e.g. bin counts and ratios), and (2) neural network-based automated feature extraction. We showed that hand-crafted summary statistics yielded superior efficiency, producing posteriors comparable to those from exact inference. As part of these earlier studies, we released SIXSA (Simulation-based Inference for X-ray Spectral Analysis) as a python package available on GitHub. Following this up, we now investigate auto-encoders for compressing X-ray spectra and importance sampling for refining the posterior estimates. A key constraint throughout our study remains the ability to perform the entire analysis on a standard laptop (MacBook Pro, Apple M3 Max, 16 cores) within a practical duration: on the order of tens of minutes. This includes the time required to generate simulations, to train the auto-encoder, to obtain the truncated prior proposals, and to train the neural density estimator, considering that the posterior sampling time is negligible. To this, we now add the time to perform importance sampling. To satisfy this constraint, all components of the pipeline had to be optimized for efficiency. The paper is organized as follows. In section § 1 , we describe the various components of the SIXSA pipeline. In § 3 we present the results of three test cases, involving spectral models of increasing complexity, before demonstrating the applicability of SIXSA to real XRISM -Resolve data. This precedes a discussion in § 4 and the conclusions § 5 . In Appendices A-C, we report further results on SIXSA applied to mock X-IFU data and real NICER and XMM-Newton data. 2 The SIXSA pipeline The different components of the SIXSA pipeline are represented in Figure 1 . Hereafter, we describe each of them, starting with the way the spectral simulations are performed, and following the order in the figure. Figure 1: The SIXSA pipeline: The process begins with sampling parameters \{\theta\}_{i} from a proposal distribution, followed by generating synthetic observations \{x\}_{i} , by passing these parameters to the model. These simulations are then

Read the complete text